Home
About
Blog
Products
Forum
Support
Contact
Sunbelt Computer Software
PL/B Language Development and Support
Home
About
Blog
Products
Forum
Support
Contact
pytorch/.github/workflows/_mac-test-mps.yml at master · ragulpr/pytorch · GitHub
Skip to content
Navigation Menu
Sign in
Products
Platform
GitHub
Repository hosting, code review, and collaboration
Copilot
AI coding agent for tasks, projects and automated work
Build & Ship
Actions
CI/CD and automation
Code Quality
Quality analysis, fixes, and enforcement
Codespaces
Cloud development environments
Secure
Code Security
Vulnerability detection and remediation
Secret Protection
Secret scanning and leak prevention
All Features
Developers
Learn
Documentation
Training
Certifications
Build
Build with Copilot
Customize Copilot
Integrations
Explore
Trending repos
GitHub Sponsors
Events
Changelog
Changelog
Your source for the latest features, improvements, and fixes across GitHub products, all in one place.
Businesses
By Stage
Enterprises
Team
Startups
Nonprofits
By Industry
Healthcare
Financial services
Manufacturing
Government
See all industries
Evaluate GitHub
Why GitHub
Customer Stories
Business insights
Trust Center
Add-ons
GitHub Advanced Security
Enterprise-grade code security
Copilot for business
Enterprise-grade AI features
Premium Support
Enterprise-grade 24/7 support
Resources
Learn & Connect
Documentation
Resource center
Blog
Events & webinars
Community Forum
Customer Stories
Integrations
Support
Customer support
Training
GitHub Status
Company
About
Partners
Changelog
GitHub Universe
GitHub Universe
The event for developers, by developers — talks, workshops, and what’s next for GitHub.
Pricing
Search
/
Sign in
Sign up
Appearance settings
You signed in with another tab or window.
Reload
to refresh your session.
You signed out in another tab or window.
Reload
to refresh your session.
You switched accounts on another tab or window.
Reload
to refresh your session.
Dismiss alert
{{ message }}
ragulpr
pytorch
Repository navigation
Code
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
More
items
Files
Expand file tree
master
Breadcrumbs
pytorch
/
.github
/
workflows
/
_mac-test-mps.yml
Copy path
View runs
Blame
More file actions
Blame
More file actions
Latest commit
History
History
History
144 lines (128 loc) · 4.8 KB
master
Breadcrumbs
pytorch
/
.github
/
workflows
/
_mac-test-mps.yml
Copy path
Top
File metadata and controls
Code
Blame
144 lines (128 loc) · 4.8 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
name
:
mac-test-arm64
on
:
workflow_call
:
inputs
:
build-environment
:
required
:
true
type
:
string
description
:
Top-level label for what's being built/tested.
sync-tag
:
required
:
false
type
:
string
default
:
"
"
description
:
|
If this is set, our linter will use this to make sure that every other
job with the same `sync-tag` is identical.
test-matrix
:
required
:
true
type
:
string
description
:
|
A JSON description of what configs to run later on.
runs-on
:
required
:
false
type
:
string
default
:
"
macos-m1-12
"
description
:
Hardware to run tests on
jobs
:
filter
:
runs-on
:
[self-hosted, linux.large]
outputs
:
test-matrix
:
${{ steps.filter.outputs.test-matrix }}
is-test-matrix-empty
:
${{ steps.filter.outputs.is-test-matrix-empty }}
keep-going
:
${{ steps.filter.outputs.keep-going }}
steps
:
-
name
:
Checkout PyTorch
uses
:
pytorch/pytorch/.github/actions/checkout-pytorch@master
with
:
fetch-depth
:
1
submodules
:
false
-
name
:
Select all requested test configurations
id
:
filter
uses
:
./.github/actions/filter-test-configs
with
:
github-token
:
${{ secrets.GITHUB_TOKEN }}
test-matrix
:
${{ inputs.test-matrix }}
test
:
needs
:
filter
#
Don't run on forked repos.
if
:
github.repository_owner == 'pytorch' && needs.filter.outputs.is-test-matrix-empty == 'False'
strategy
:
matrix
:
${{ fromJSON(needs.filter.outputs.test-matrix) }}
fail-fast
:
false
runs-on
:
${{ inputs.runs-on }}
steps
:
-
name
:
Print runner OS/HW info
shell
:
arch -arch arm64 bash {0}
run
:
|
sysctl machdep.cpu.brand_string kern.osproductversion
-
name
:
Checkout PyTorch
uses
:
malfet/checkout@silent-checkout
with
:
ref
:
${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
quiet-checkout
:
true
-
name
:
Clean checkout
shell
:
arch -arch arm64 bash {0}
run
:
|
git clean -fxd
-
name
:
Download build artifacts
uses
:
./.github/actions/download-build-artifacts
with
:
name
:
${{ inputs.build-environment }}
use-gha
:
true
#
This is copied from the main macos test workflow. It was missed in the earlier fix because macos M1
#
runners are shared and not ephemeral, so the issue wasn't manifested if the runners with the fix were
#
used
-
name
:
Install macOS homebrew dependencies
uses
:
nick-fields/retry@v2.8.2
with
:
timeout_minutes
:
5
max_attempts
:
3
retry_wait_seconds
:
90
command
:
|
# Install dependencies
brew install libomp
brew link --force libomp
-
name
:
Setup miniconda
uses
:
pytorch/test-infra/.github/actions/setup-miniconda@main
with
:
python-version
:
3.9
environment-file
:
.github/requirements/conda-env-${{ runner.os }}-${{ runner.arch }}
pip-requirements-file
:
.github/requirements/pip-requirements-${{ runner.os }}.txt
-
name
:
Install PyTorch and run MPS tests
id
:
test
env
:
ENV_NAME
:
conda-test-env-${{ github.run_id }}
PY_VERS
:
3.9
PR_BODY
:
${{ github.event.pull_request.body }}
PYTORCH_RETRY_TEST_CASES
:
1
PYTORCH_OVERRIDE_FLAKY_SIGNAL
:
1
CONTINUE_THROUGH_ERROR
:
${{ needs.filter.outputs.keep-going }}
shell
:
arch -arch arm64 bash {0}
run
:
|
# shellcheck disable=SC1090
set -ex
if [[ -n "$CONDA_ENV" ]]; then
# Use binaries under conda environment
export PATH="$CONDA_ENV/bin":$PATH
fi
# As wheels are cross-compiled they are reported as x86_64 ones
ORIG_WHLNAME=$(ls -1 dist/*.whl); ARM_WHLNAME=${ORIG_WHLNAME/x86_64/arm64}; mv ${ORIG_WHLNAME} ${ARM_WHLNAME}
${CONDA_RUN} python3 -mpip install --no-index --no-deps dist/*.whl
${CONDA_RUN} python3 test/run_test.py --mps --verbose
-
name
:
Print remaining test logs
shell
:
bash
if
:
always() && steps.test.conclusion
run
:
|
cat test/**/*.log ||
true
-
name
:
Get workflow job id
id
:
get-job-id
uses
:
./.github/actions/get-workflow-job-id
if
:
always()
with
:
github-token
:
${{ secrets.GITHUB_TOKEN }}
-
name
:
Upload test artifacts
uses
:
./.github/actions/upload-test-artifacts
if
:
always() && steps.test.conclusion && steps.test.conclusion != 'skipped'
with
:
use-gha
:
true
file-suffix
:
${{ github.job }}-mps-1-1-macos-m1-12_${{ steps.get-job-id.outputs.job-id }}
You can’t perform that action at this time.