Skip to content

Commit 12fe529

Browse files
committed
push_tests_mps
1 parent e49a228 commit 12fe529

File tree

2 files changed

+94
-172
lines changed

2 files changed

+94
-172
lines changed

.github/workflows/pr_tests_mps.yml

Lines changed: 0 additions & 161 deletions
This file was deleted.

.github/workflows/push_tests_mps.yml

Lines changed: 94 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,55 @@ env:
1515
HF_HUB_ENABLE_HF_TRANSFER: 1
1616
PYTEST_TIMEOUT: 600
1717
RUN_SLOW: no
18+
HF_TOKEN: ${{ secrets.HF_TOKEN }}
19+
PYTORCH_MPS_HIGH_WATERMARK_RATIO: 0.0
1820

1921
concurrency:
2022
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
2123
cancel-in-progress: true
2224

2325
jobs:
2426
run_fast_tests_apple_m1:
25-
name: Fast PyTorch MPS tests on MacOS
26-
runs-on: macos-13-xlarge
27+
strategy:
28+
fail-fast: false
29+
matrix:
30+
config:
31+
- name: Fast Pipelines MPS tests
32+
framework: pytorch_pipelines
33+
runner: macos-13-xlarge
34+
report: torch_mps_pipelines
35+
- name: Fast Models MPS tests
36+
framework: pytorch_models
37+
runner: macos-13-xlarge
38+
report: torch_mps_models
39+
- name: Fast Schedulers MPS tests
40+
framework: pytorch_schedulers
41+
runner: macos-13-xlarge
42+
report: torch_mps_schedulers
43+
- name: Fast Others MPS tests
44+
framework: pytorch_others
45+
runner: macos-13-xlarge
46+
report: torch_mps_others
47+
- name: Fast Single File MPS tests
48+
framework: pytorch_single_file
49+
runner: macos-13-xlarge
50+
report: torch_mps_single_file
51+
- name: Fast Lora MPS tests
52+
framework: pytorch_lora
53+
runner: macos-13-xlarge
54+
report: torch_mps_lora
55+
- name: Fast Quantization MPS tests
56+
framework: pytorch_quantization
57+
runner: macos-13-xlarge
58+
report: torch_mps_quantization
59+
60+
name: ${{ matrix.config.name }}
61+
62+
runs-on: ${{ matrix.config.runner }}
63+
64+
defaults:
65+
run:
66+
shell: arch -arch arm64 bash {0}
2767

2868
steps:
2969
- name: Checkout diffusers
@@ -32,7 +72,6 @@ jobs:
3272
fetch-depth: 2
3373

3474
- name: Clean checkout
35-
shell: arch -arch arm64 bash {0}
3675
run: |
3776
git clean -fxd
3877
@@ -42,10 +81,12 @@ jobs:
4281
python-version: 3.9
4382

4483
- name: Install dependencies
45-
shell: arch -arch arm64 bash {0}
4684
run: |
4785
${CONDA_RUN} python -m pip install --upgrade pip uv
4886
${CONDA_RUN} python -m uv pip install -e ".[quality,test]"
87+
${CONDA_RUN} python -m uv pip install hf_transfer
88+
${CONDA_RUN} python -m uv pip install peft
89+
${CONDA_RUN} python -m uv pip install bitsandbytes
4990
${CONDA_RUN} python -m uv pip install torch torchvision torchaudio
5091
${CONDA_RUN} python -m uv pip install accelerate@git+https://github.com/huggingface/accelerate.git
5192
${CONDA_RUN} python -m uv pip install transformers --upgrade
@@ -55,20 +96,62 @@ jobs:
5596
run: |
5697
${CONDA_RUN} python utils/print_env.py
5798
58-
- name: Run fast PyTorch tests on M1 (MPS)
59-
shell: arch -arch arm64 bash {0}
60-
env:
61-
HF_TOKEN: ${{ secrets.HF_TOKEN }}
99+
- name: Run fast PyTorch Pipeline MPS tests
100+
if: ${{ matrix.config.framework == 'pytorch_pipelines' }}
101+
run: |
102+
${CONDA_RUN} python -m pytest -n 0 -s -v -k "not Flax and not Onnx" \
103+
--make-reports=tests_${{ matrix.config.report }} \
104+
tests/pipelines/
105+
106+
- name: Run fast PyTorch Models MPS tests
107+
if: ${{ matrix.config.framework == 'pytorch_models' }}
108+
run: |
109+
${CONDA_RUN} python -m pytest -n 0 -s -v -k "not Flax and not Onnx and not Dependency" \
110+
--make-reports=tests_${{ matrix.config.report }} \
111+
tests/models/
112+
113+
- name: Run fast PyTorch Schedulers MPS tests
114+
if: ${{ matrix.config.framework == 'pytorch_schedulers' }}
115+
run: |
116+
${CONDA_RUN} python -m pytest -n 0 -s -v -k "not Flax and not Onnx and not Dependency" \
117+
--make-reports=tests_${{ matrix.config.report }} \
118+
tests/schedulers/
119+
120+
- name: Run fast PyTorch Others MPS tests
121+
if: ${{ matrix.config.framework == 'pytorch_others' }}
122+
run: |
123+
${CONDA_RUN} python -m pytest -n 0 -s -v \
124+
--make-reports=tests_${{ matrix.config.report }} \
125+
tests/others/
126+
127+
- name: Run fast PyTorch Single File MPS tests
128+
if: ${{ matrix.config.framework == 'pytorch_single_file' }}
129+
run: |
130+
${CONDA_RUN} python -m pytest -n 0 -s -v \
131+
--make-reports=tests_${{ matrix.config.report }} \
132+
tests/single_file/
133+
134+
- name: Run fast PyTorch Lora MPS tests
135+
if: ${{ matrix.config.framework == 'pytorch_lora' }}
136+
run: |
137+
${CONDA_RUN} python -m pytest -n 0 -s -v \
138+
--make-reports=tests_${{ matrix.config.report }} \
139+
tests/lora/
140+
141+
- name: Run fast PyTorch Quantization MPS tests
142+
if: ${{ matrix.config.framework == 'pytorch_quantization' }}
62143
run: |
63-
${CONDA_RUN} python -m pytest -n 0 -s -v --make-reports=tests_torch_mps tests/
144+
${CONDA_RUN} python -m pytest -n 0 -s -v \
145+
--make-reports=tests_${{ matrix.config.report }} \
146+
tests/quantization/
64147
65148
- name: Failure short reports
66149
if: ${{ failure() }}
67-
run: cat reports/tests_torch_mps_failures_short.txt
150+
run: cat reports/tests_${{ matrix.config.report }}_failures_short.txt
68151

69152
- name: Test suite reports artifacts
70153
if: ${{ always() }}
71154
uses: actions/upload-artifact@v4
72155
with:
73-
name: pr_torch_mps_test_reports
156+
name: pr_${{ matrix.config.framework }}_${{ matrix.config.report }}_test_reports
74157
path: reports

0 commit comments

Comments
 (0)