Skip to content

Commit 052de9a

Browse files
committed
pr_tests_mps
1 parent b2158a3 commit 052de9a

File tree

1 file changed

+74
-0
lines changed

1 file changed

+74
-0
lines changed

.github/workflows/pr_tests_mps.yml

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
name: Fast mps tests on main
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
paths:
8+
- "src/diffusers/**.py"
9+
- "tests/**.py"
10+
11+
env:
12+
DIFFUSERS_IS_CI: yes
13+
OMP_NUM_THREADS: 8
14+
MKL_NUM_THREADS: 8
15+
HF_HUB_ENABLE_HF_TRANSFER: 1
16+
PYTEST_TIMEOUT: 600
17+
RUN_SLOW: no
18+
19+
concurrency:
20+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
21+
cancel-in-progress: true
22+
23+
jobs:
24+
run_fast_tests_apple_m1:
25+
name: Fast PyTorch MPS tests on MacOS
26+
runs-on: macos-13-xlarge
27+
28+
steps:
29+
- name: Checkout diffusers
30+
uses: actions/checkout@v3
31+
with:
32+
fetch-depth: 2
33+
34+
- name: Clean checkout
35+
shell: arch -arch arm64 bash {0}
36+
run: |
37+
git clean -fxd
38+
39+
- name: Setup miniconda
40+
uses: ./.github/actions/setup-miniconda
41+
with:
42+
python-version: 3.9
43+
44+
- name: Install dependencies
45+
shell: arch -arch arm64 bash {0}
46+
run: |
47+
${CONDA_RUN} python -m pip install --upgrade pip uv
48+
${CONDA_RUN} python -m uv pip install -e ".[quality,test]"
49+
${CONDA_RUN} python -m uv pip install torch torchvision torchaudio
50+
${CONDA_RUN} python -m uv pip install accelerate@git+https://github.com/huggingface/accelerate.git
51+
${CONDA_RUN} python -m uv pip install transformers --upgrade
52+
53+
- name: Environment
54+
shell: arch -arch arm64 bash {0}
55+
run: |
56+
${CONDA_RUN} python utils/print_env.py
57+
58+
- name: Run fast PyTorch tests on M1 (MPS)
59+
shell: arch -arch arm64 bash {0}
60+
env:
61+
HF_TOKEN: ${{ secrets.HF_TOKEN }}
62+
run: |
63+
${CONDA_RUN} python -m pytest -n 0 -s -v --make-reports=tests_torch_mps tests/
64+
65+
- name: Failure short reports
66+
if: ${{ failure() }}
67+
run: cat reports/tests_torch_mps_failures_short.txt
68+
69+
- name: Test suite reports artifacts
70+
if: ${{ always() }}
71+
uses: actions/upload-artifact@v4
72+
with:
73+
name: pr_torch_mps_test_reports
74+
path: reports

0 commit comments

Comments
 (0)