Skip to content

Commit c2a1e84

Browse files
authored
Merge branch 'main' into auraflow-i2i
2 parents 9375020 + e27142a commit c2a1e84

File tree

791 files changed

+38852
-9324
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

791 files changed

+38852
-9324
lines changed

.github/workflows/benchmark.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
runs-on:
2424
group: aws-g6-4xlarge-plus
2525
container:
26-
image: diffusers/diffusers-pytorch-compile-cuda
26+
image: diffusers/diffusers-pytorch-cuda
2727
options: --shm-size "16gb" --ipc host --gpus 0
2828
steps:
2929
- name: Checkout diffusers

.github/workflows/build_docker_images.yml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,16 @@ jobs:
3838
token: ${{ secrets.GITHUB_TOKEN }}
3939

4040
- name: Build Changed Docker Images
41+
env:
42+
CHANGED_FILES: ${{ steps.file_changes.outputs.all }}
4143
run: |
42-
CHANGED_FILES="${{ steps.file_changes.outputs.all }}"
43-
for FILE in $CHANGED_FILES; do
44+
echo "$CHANGED_FILES"
45+
for FILE in $CHANGED_FILES; do
46+
# skip anything that isn't still on disk
47+
if [[ ! -f "$FILE" ]]; then
48+
echo "Skipping removed file $FILE"
49+
continue
50+
fi
4451
if [[ "$FILE" == docker/*Dockerfile ]]; then
4552
DOCKER_PATH="${FILE%/Dockerfile}"
4653
DOCKER_TAG=$(basename "$DOCKER_PATH")
@@ -65,7 +72,7 @@ jobs:
6572
image-name:
6673
- diffusers-pytorch-cpu
6774
- diffusers-pytorch-cuda
68-
- diffusers-pytorch-compile-cuda
75+
- diffusers-pytorch-cuda
6976
- diffusers-pytorch-xformers-cuda
7077
- diffusers-pytorch-minimum-cuda
7178
- diffusers-flax-cpu

.github/workflows/nightly_tests.yml

Lines changed: 202 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,9 @@ env:
1313
PYTEST_TIMEOUT: 600
1414
RUN_SLOW: yes
1515
RUN_NIGHTLY: yes
16-
PIPELINE_USAGE_CUTOFF: 5000
16+
PIPELINE_USAGE_CUTOFF: 0
1717
SLACK_API_TOKEN: ${{ secrets.SLACK_CIFEEDBACK_BOT_TOKEN }}
18+
CONSOLIDATED_REPORT_PATH: consolidated_test_report.md
1819

1920
jobs:
2021
setup_torch_cuda_pipeline_matrix:
@@ -99,11 +100,6 @@ jobs:
99100
with:
100101
name: pipeline_${{ matrix.module }}_test_reports
101102
path: reports
102-
- name: Generate Report and Notify Channel
103-
if: always()
104-
run: |
105-
pip install slack_sdk tabulate
106-
python utils/log_reports.py >> $GITHUB_STEP_SUMMARY
107103

108104
run_nightly_tests_for_other_torch_modules:
109105
name: Nightly Torch CUDA Tests
@@ -174,11 +170,48 @@ jobs:
174170
name: torch_${{ matrix.module }}_cuda_test_reports
175171
path: reports
176172

177-
- name: Generate Report and Notify Channel
178-
if: always()
173+
run_torch_compile_tests:
174+
name: PyTorch Compile CUDA tests
175+
176+
runs-on:
177+
group: aws-g4dn-2xlarge
178+
179+
container:
180+
image: diffusers/diffusers-pytorch-cuda
181+
options: --gpus 0 --shm-size "16gb" --ipc host
182+
183+
steps:
184+
- name: Checkout diffusers
185+
uses: actions/checkout@v3
186+
with:
187+
fetch-depth: 2
188+
189+
- name: NVIDIA-SMI
179190
run: |
180-
pip install slack_sdk tabulate
181-
python utils/log_reports.py >> $GITHUB_STEP_SUMMARY
191+
nvidia-smi
192+
- name: Install dependencies
193+
run: |
194+
python -m venv /opt/venv && export PATH="/opt/venv/bin:$PATH"
195+
python -m uv pip install -e [quality,test,training]
196+
- name: Environment
197+
run: |
198+
python utils/print_env.py
199+
- name: Run torch compile tests on GPU
200+
env:
201+
HF_TOKEN: ${{ secrets.DIFFUSERS_HF_HUB_READ_TOKEN }}
202+
RUN_COMPILE: yes
203+
run: |
204+
python -m pytest -n 1 --max-worker-restart=0 --dist=loadfile -s -v -k "compile" --make-reports=tests_torch_compile_cuda tests/
205+
- name: Failure short reports
206+
if: ${{ failure() }}
207+
run: cat reports/tests_torch_compile_cuda_failures_short.txt
208+
209+
- name: Test suite reports artifacts
210+
if: ${{ always() }}
211+
uses: actions/upload-artifact@v4
212+
with:
213+
name: torch_compile_test_reports
214+
path: reports
182215

183216
run_big_gpu_torch_tests:
184217
name: Torch tests on big GPU
@@ -230,12 +263,7 @@ jobs:
230263
with:
231264
name: torch_cuda_big_gpu_test_reports
232265
path: reports
233-
- name: Generate Report and Notify Channel
234-
if: always()
235-
run: |
236-
pip install slack_sdk tabulate
237-
python utils/log_reports.py >> $GITHUB_STEP_SUMMARY
238-
266+
239267
torch_minimum_version_cuda_tests:
240268
name: Torch Minimum Version CUDA Tests
241269
runs-on:
@@ -292,63 +320,6 @@ jobs:
292320
with:
293321
name: torch_minimum_version_cuda_test_reports
294322
path: reports
295-
296-
run_flax_tpu_tests:
297-
name: Nightly Flax TPU Tests
298-
runs-on:
299-
group: gcp-ct5lp-hightpu-8t
300-
if: github.event_name == 'schedule'
301-
302-
container:
303-
image: diffusers/diffusers-flax-tpu
304-
options: --shm-size "16gb" --ipc host --privileged ${{ vars.V5_LITEPOD_8_ENV}} -v /mnt/hf_cache:/mnt/hf_cache
305-
defaults:
306-
run:
307-
shell: bash
308-
steps:
309-
- name: Checkout diffusers
310-
uses: actions/checkout@v3
311-
with:
312-
fetch-depth: 2
313-
314-
- name: Install dependencies
315-
run: |
316-
python -m venv /opt/venv && export PATH="/opt/venv/bin:$PATH"
317-
python -m uv pip install -e [quality,test]
318-
pip uninstall accelerate -y && python -m uv pip install -U accelerate@git+https://github.com/huggingface/accelerate.git
319-
python -m uv pip install pytest-reportlog
320-
321-
- name: Environment
322-
run: python utils/print_env.py
323-
324-
- name: Run nightly Flax TPU tests
325-
env:
326-
HF_TOKEN: ${{ secrets.DIFFUSERS_HF_HUB_READ_TOKEN }}
327-
run: |
328-
python -m pytest -n 0 \
329-
-s -v -k "Flax" \
330-
--make-reports=tests_flax_tpu \
331-
--report-log=tests_flax_tpu.log \
332-
tests/
333-
334-
- name: Failure short reports
335-
if: ${{ failure() }}
336-
run: |
337-
cat reports/tests_flax_tpu_stats.txt
338-
cat reports/tests_flax_tpu_failures_short.txt
339-
340-
- name: Test suite reports artifacts
341-
if: ${{ always() }}
342-
uses: actions/upload-artifact@v4
343-
with:
344-
name: flax_tpu_test_reports
345-
path: reports
346-
347-
- name: Generate Report and Notify Channel
348-
if: always()
349-
run: |
350-
pip install slack_sdk tabulate
351-
python utils/log_reports.py >> $GITHUB_STEP_SUMMARY
352323

353324
run_nightly_onnx_tests:
354325
name: Nightly ONNXRuntime CUDA tests on Ubuntu
@@ -399,18 +370,12 @@ jobs:
399370
name: tests_onnx_cuda_reports
400371
path: reports
401372

402-
- name: Generate Report and Notify Channel
403-
if: always()
404-
run: |
405-
pip install slack_sdk tabulate
406-
python utils/log_reports.py >> $GITHUB_STEP_SUMMARY
407-
408373
run_nightly_quantization_tests:
409374
name: Torch quantization nightly tests
410375
strategy:
411376
fail-fast: false
412377
max-parallel: 2
413-
matrix:
378+
matrix:
414379
config:
415380
- backend: "bitsandbytes"
416381
test_location: "bnb"
@@ -470,11 +435,165 @@ jobs:
470435
with:
471436
name: torch_cuda_${{ matrix.config.backend }}_reports
472437
path: reports
473-
- name: Generate Report and Notify Channel
474-
if: always()
438+
439+
run_nightly_pipeline_level_quantization_tests:
440+
name: Torch quantization nightly tests
441+
strategy:
442+
fail-fast: false
443+
max-parallel: 2
444+
runs-on:
445+
group: aws-g6e-xlarge-plus
446+
container:
447+
image: diffusers/diffusers-pytorch-cuda
448+
options: --shm-size "20gb" --ipc host --gpus 0
449+
steps:
450+
- name: Checkout diffusers
451+
uses: actions/checkout@v3
452+
with:
453+
fetch-depth: 2
454+
- name: NVIDIA-SMI
455+
run: nvidia-smi
456+
- name: Install dependencies
457+
run: |
458+
python -m venv /opt/venv && export PATH="/opt/venv/bin:$PATH"
459+
python -m uv pip install -e [quality,test]
460+
python -m uv pip install -U bitsandbytes optimum_quanto
461+
python -m uv pip install pytest-reportlog
462+
- name: Environment
463+
run: |
464+
python utils/print_env.py
465+
- name: Pipeline-level quantization tests on GPU
466+
env:
467+
HF_TOKEN: ${{ secrets.DIFFUSERS_HF_HUB_READ_TOKEN }}
468+
# https://pytorch.org/docs/stable/notes/randomness.html#avoiding-nondeterministic-algorithms
469+
CUBLAS_WORKSPACE_CONFIG: :16:8
470+
BIG_GPU_MEMORY: 40
471+
run: |
472+
python -m pytest -n 1 --max-worker-restart=0 --dist=loadfile \
473+
--make-reports=tests_pipeline_level_quant_torch_cuda \
474+
--report-log=tests_pipeline_level_quant_torch_cuda.log \
475+
tests/quantization/test_pipeline_level_quantization.py
476+
- name: Failure short reports
477+
if: ${{ failure() }}
478+
run: |
479+
cat reports/tests_pipeline_level_quant_torch_cuda_stats.txt
480+
cat reports/tests_pipeline_level_quant_torch_cuda_failures_short.txt
481+
- name: Test suite reports artifacts
482+
if: ${{ always() }}
483+
uses: actions/upload-artifact@v4
484+
with:
485+
name: torch_cuda_pipeline_level_quant_reports
486+
path: reports
487+
488+
run_flax_tpu_tests:
489+
name: Nightly Flax TPU Tests
490+
runs-on:
491+
group: gcp-ct5lp-hightpu-8t
492+
if: github.event_name == 'schedule'
493+
494+
container:
495+
image: diffusers/diffusers-flax-tpu
496+
options: --shm-size "16gb" --ipc host --privileged ${{ vars.V5_LITEPOD_8_ENV}} -v /mnt/hf_cache:/mnt/hf_cache
497+
defaults:
498+
run:
499+
shell: bash
500+
steps:
501+
- name: Checkout diffusers
502+
uses: actions/checkout@v3
503+
with:
504+
fetch-depth: 2
505+
506+
- name: Install dependencies
507+
run: |
508+
python -m venv /opt/venv && export PATH="/opt/venv/bin:$PATH"
509+
python -m uv pip install -e [quality,test]
510+
pip uninstall accelerate -y && python -m uv pip install -U accelerate@git+https://github.com/huggingface/accelerate.git
511+
python -m uv pip install pytest-reportlog
512+
513+
- name: Environment
514+
run: python utils/print_env.py
515+
516+
- name: Run nightly Flax TPU tests
517+
env:
518+
HF_TOKEN: ${{ secrets.DIFFUSERS_HF_HUB_READ_TOKEN }}
519+
run: |
520+
python -m pytest -n 0 \
521+
-s -v -k "Flax" \
522+
--make-reports=tests_flax_tpu \
523+
--report-log=tests_flax_tpu.log \
524+
tests/
525+
526+
- name: Failure short reports
527+
if: ${{ failure() }}
528+
run: |
529+
cat reports/tests_flax_tpu_stats.txt
530+
cat reports/tests_flax_tpu_failures_short.txt
531+
532+
- name: Test suite reports artifacts
533+
if: ${{ always() }}
534+
uses: actions/upload-artifact@v4
535+
with:
536+
name: flax_tpu_test_reports
537+
path: reports
538+
539+
generate_consolidated_report:
540+
name: Generate Consolidated Test Report
541+
needs: [
542+
run_nightly_tests_for_torch_pipelines,
543+
run_nightly_tests_for_other_torch_modules,
544+
run_torch_compile_tests,
545+
run_big_gpu_torch_tests,
546+
run_nightly_quantization_tests,
547+
run_nightly_pipeline_level_quantization_tests,
548+
run_nightly_onnx_tests,
549+
torch_minimum_version_cuda_tests,
550+
run_flax_tpu_tests
551+
]
552+
if: always()
553+
runs-on:
554+
group: aws-general-8-plus
555+
container:
556+
image: diffusers/diffusers-pytorch-cpu
557+
steps:
558+
- name: Checkout diffusers
559+
uses: actions/checkout@v3
560+
with:
561+
fetch-depth: 2
562+
563+
- name: Create reports directory
564+
run: mkdir -p combined_reports
565+
566+
- name: Download all test reports
567+
uses: actions/download-artifact@v4
568+
with:
569+
path: artifacts
570+
571+
- name: Prepare reports
475572
run: |
573+
# Move all report files to a single directory for processing
574+
find artifacts -name "*.txt" -exec cp {} combined_reports/ \;
575+
576+
- name: Install dependencies
577+
run: |
578+
pip install -e .[test]
476579
pip install slack_sdk tabulate
477-
python utils/log_reports.py >> $GITHUB_STEP_SUMMARY
580+
581+
- name: Generate consolidated report
582+
run: |
583+
python utils/consolidated_test_report.py \
584+
--reports_dir combined_reports \
585+
--output_file $CONSOLIDATED_REPORT_PATH \
586+
--slack_channel_name diffusers-ci-nightly
587+
588+
- name: Show consolidated report
589+
run: |
590+
cat $CONSOLIDATED_REPORT_PATH >> $GITHUB_STEP_SUMMARY
591+
592+
- name: Upload consolidated report
593+
uses: actions/upload-artifact@v4
594+
with:
595+
name: consolidated_test_report
596+
path: ${{ env.CONSOLIDATED_REPORT_PATH }}
478597

479598
# M1 runner currently not well supported
480599
# TODO: (Dhruv) add these back when we setup better testing for Apple Silicon

.github/workflows/pr_tests.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ on:
1111
- "tests/**.py"
1212
- ".github/**.yml"
1313
- "utils/**.py"
14+
- "setup.py"
1415
push:
1516
branches:
1617
- ci-*
@@ -290,8 +291,8 @@ jobs:
290291
- name: Failure short reports
291292
if: ${{ failure() }}
292293
run: |
293-
cat reports/tests_lora_failures_short.txt
294-
cat reports/tests_models_lora_failures_short.txt
294+
cat reports/tests_peft_main_failures_short.txt
295+
cat reports/tests_models_lora_peft_main_failures_short.txt
295296
296297
- name: Test suite reports artifacts
297298
if: ${{ always() }}

0 commit comments

Comments
 (0)