Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 62 additions & 0 deletions .github/workflows/pr_tests_gpu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,16 @@ on:
- "src/diffusers/models/model_loading_utils.py"
- "src/diffusers/pipelines/pipeline_utils.py"
- "src/diffusers/pipelines/pipeline_loading_utils.py"
- "src/diffusers/modular_pipelines/modular_pipeline.py"
- "src/diffusers/modular_pipelines/modular_pipeline_utils.py"
- "src/diffusers/loaders/*lora*.py"
- "src/diffusers/models/lora.py"
- "src/diffusers/**/*peft*.py"
- "tests/lora/**"
- "src/diffusers/hooks/**"
- "tests/hooks/**"
- "tests/pipelines/testing_utils/**.py"
- "tests/modular_pipelines/testing_utils/**.py"
- "tests/models/test_modeling_common.py"
- "tests/models/testing_utils/**.py"
- "examples/**/*.py"
Expand Down Expand Up @@ -187,6 +190,65 @@ jobs:
name: pipeline_${{ matrix.module }}_test_reports
path: reports

torch_modular_pipelines_cuda_tests:
permissions:
contents: read
id-token: write
name: Torch Modular Pipelines CUDA Tests
needs: [check_code_quality, check_repository_consistency]
strategy:
fail-fast: false
max-parallel: 4
matrix:
module: [flux, flux3, ltx2, minimax_h3, stable_diffusion_3, stable_diffusion_xl]

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Following how the standard pipelines restrict to an allow-list. I can add others here too.

runs-on:
group: aws-g4dn-2xlarge
container:
image: diffusers/diffusers-pytorch-cuda:latest
options: --shm-size "16gb" --ipc host --gpus all
steps:
- name: Checkout diffusers
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 2

- name: NVIDIA-SMI
run: |
nvidia-smi
- name: Install dependencies
run: |
printf 'torch==2.10.0\ntorchvision==0.25.0\ntorchaudio==2.10.0\n' > "$UV_OVERRIDE"
uv pip install -e ".[quality]"
uv pip install peft@git+https://github.com/huggingface/peft.git
uv pip uninstall accelerate && uv pip install -U accelerate@git+https://github.com/huggingface/accelerate.git
uv pip uninstall transformers huggingface_hub && UV_PRERELEASE=allow uv pip install -U transformers@git+https://github.com/huggingface/transformers.git

- name: Environment
run: |
diffusers-cli env
- name: PyTorch CUDA modular pipeline tests on Ubuntu
env:
HF_OIDC_RESOURCE: ${{ !github.event.pull_request.head.repo.fork && 'Diffusers-CI-Bot' || '' }}
# https://pytorch.org/docs/stable/notes/randomness.html#avoiding-nondeterministic-algorithms
CUBLAS_WORKSPACE_CONFIG: :16:8
run: |
pytest -n 1 --max-worker-restart=0 --dist=loadfile \
-m "core or memory or cpu_offload or group_offload or lora" \
--make-reports=tests_modular_pipeline_${{ matrix.module }}_cuda \
tests/modular_pipelines/${{ matrix.module }}

- name: Failure short reports
if: ${{ failure() }}
run: |
cat reports/tests_modular_pipeline_${{ matrix.module }}_cuda_stats.txt
cat reports/tests_modular_pipeline_${{ matrix.module }}_cuda_failures_short.txt
- name: Test suite reports artifacts
if: ${{ always() }}
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: modular_pipeline_${{ matrix.module }}_test_reports
path: reports

torch_cuda_tests:
permissions:
contents: read
Expand Down