Skip to content

Commit 9dbb1d4

Browse files
committed
merge peft pr workflow into the main pr workflow.
1 parent e47cc1f commit 9dbb1d4

File tree

2 files changed

+72
-134
lines changed

2 files changed

+72
-134
lines changed

.github/workflows/pr_test_peft_backend.yml

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

.github/workflows/pr_tests.yml

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,3 +234,75 @@ jobs:
234234
with:
235235
name: pr_${{ matrix.config.report }}_test_reports
236236
path: reports
237+
238+
run_lora_tests:
239+
needs: [check_code_quality, check_repository_consistency]
240+
strategy:
241+
fail-fast: false
242+
matrix:
243+
lib-versions: ["main", "latest"]
244+
245+
name: LoRA - ${{ matrix.lib-versions }}
246+
247+
runs-on:
248+
group: aws-general-8-plus
249+
250+
container:
251+
image: diffusers/diffusers-pytorch-cpu
252+
options: --shm-size "16gb" --ipc host -v /mnt/hf_cache:/mnt/cache/
253+
254+
defaults:
255+
run:
256+
shell: bash
257+
258+
steps:
259+
- name: Checkout diffusers
260+
uses: actions/checkout@v3
261+
with:
262+
fetch-depth: 2
263+
264+
- name: Install dependencies
265+
run: |
266+
python -m venv /opt/venv && export PATH="/opt/venv/bin:$PATH"
267+
python -m uv pip install -e [quality,test]
268+
# TODO (sayakpaul, DN6): revisit `--no-deps`
269+
if [ "${{ matrix.lib-versions }}" == "main" ]; then
270+
python -m pip install -U peft@git+https://github.com/huggingface/peft.git --no-deps
271+
python -m uv pip install -U transformers@git+https://github.com/huggingface/transformers.git --no-deps
272+
pip uninstall accelerate -y && python -m uv pip install -U accelerate@git+https://github.com/huggingface/accelerate.git --no-deps
273+
else
274+
python -m uv pip install -U peft --no-deps
275+
python -m uv pip install -U transformers accelerate --no-deps
276+
fi
277+
278+
- name: Environment
279+
run: |
280+
python -m venv /opt/venv && export PATH="/opt/venv/bin:$PATH"
281+
python utils/print_env.py
282+
283+
- name: Run fast PyTorch LoRA CPU tests with PEFT backend
284+
run: |
285+
python -m venv /opt/venv && export PATH="/opt/venv/bin:$PATH"
286+
python -m pytest -n 4 --max-worker-restart=0 --dist=loadfile \
287+
-s -v \
288+
--make-reports=tests_${{ matrix.lib-versions }} \
289+
tests/lora/
290+
python -m pytest -n 4 --max-worker-restart=0 --dist=loadfile \
291+
-s -v \
292+
--make-reports=tests_models_lora_${{ matrix.lib-versions }} \
293+
tests/models/ -k "lora"
294+
295+
296+
- name: Failure short reports
297+
if: ${{ failure() }}
298+
run: |
299+
cat reports/tests_${{ matrix.lib-versions }}_failures_short.txt
300+
cat reports/tests_models_lora_${{ matrix.lib-versions }}_failures_short.txt
301+
302+
- name: Test suite reports artifacts
303+
if: ${{ always() }}
304+
uses: actions/upload-artifact@v4
305+
with:
306+
name: pr_${{ matrix.lib-versions }}_test_reports
307+
path: reports
308+

0 commit comments

Comments
 (0)