Skip to content

Commit d10fa09

Browse files
authored
Merge branch 'main' into fix_flax_use_memory_efficient_attention
2 parents 5c9b971 + 86555c9 commit d10fa09

File tree

246 files changed

+10018
-2306
lines changed

Some content is hidden

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

246 files changed

+10018
-2306
lines changed

.github/workflows/benchmark.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ jobs:
3939
python utils/print_env.py
4040
- name: Diffusers Benchmarking
4141
env:
42-
HUGGING_FACE_HUB_TOKEN: ${{ secrets.DIFFUSERS_BOT_TOKEN }}
42+
HF_TOKEN: ${{ secrets.DIFFUSERS_BOT_TOKEN }}
4343
BASE_PATH: benchmark_outputs
4444
run: |
4545
export TOTAL_GPU_MEMORY=$(python -c "import torch; print(torch.cuda.get_device_properties(0).total_memory / (1024**3))")

.github/workflows/build_docker_images.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,17 +25,17 @@ jobs:
2525
steps:
2626
- name: Set up Docker Buildx
2727
uses: docker/setup-buildx-action@v1
28-
28+
2929
- name: Check out code
3030
uses: actions/checkout@v3
31-
31+
3232
- name: Find Changed Dockerfiles
3333
id: file_changes
3434
uses: jitterbit/get-changed-files@v1
3535
with:
3636
format: 'space-delimited'
3737
token: ${{ secrets.GITHUB_TOKEN }}
38-
38+
3939
- name: Build Changed Docker Images
4040
run: |
4141
CHANGED_FILES="${{ steps.file_changes.outputs.all }}"
@@ -52,7 +52,7 @@ jobs:
5252
build-and-push-docker-images:
5353
runs-on: [ self-hosted, intel-cpu, 8-cpu, ci ]
5454
if: github.event_name != 'pull_request'
55-
55+
5656
permissions:
5757
contents: read
5858
packages: write
@@ -69,6 +69,7 @@ jobs:
6969
- diffusers-flax-tpu
7070
- diffusers-onnxruntime-cpu
7171
- diffusers-onnxruntime-cuda
72+
- diffusers-doc-builder
7273

7374
steps:
7475
- name: Checkout repository

.github/workflows/build_documentation.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
package: diffusers
2222
notebook_folder: diffusers_doc
2323
languages: en ko zh ja pt
24-
24+
custom_container: diffusers/diffusers-doc-builder
2525
secrets:
2626
token: ${{ secrets.HUGGINGFACE_PUSH }}
2727
hf_token: ${{ secrets.HF_DOC_BUILD_PUSH }}

.github/workflows/build_pr_documentation.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,4 @@ jobs:
2020
install_libgl1: true
2121
package: diffusers
2222
languages: en ko zh ja pt
23+
custom_container: diffusers/diffusers-doc-builder

.github/workflows/nightly_tests.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ jobs:
8181
8282
- name: Nightly PyTorch CUDA checkpoint (pipelines) tests
8383
env:
84-
HUGGING_FACE_HUB_TOKEN: ${{ secrets.HUGGING_FACE_HUB_TOKEN }}
84+
HF_TOKEN: ${{ secrets.HF_TOKEN }}
8585
# https://pytorch.org/docs/stable/notes/randomness.html#avoiding-nondeterministic-algorithms
8686
CUBLAS_WORKSPACE_CONFIG: :16:8
8787
run: |
@@ -141,7 +141,7 @@ jobs:
141141
- name: Run nightly PyTorch CUDA tests for non-pipeline modules
142142
if: ${{ matrix.module != 'examples'}}
143143
env:
144-
HUGGING_FACE_HUB_TOKEN: ${{ secrets.HUGGING_FACE_HUB_TOKEN }}
144+
HF_TOKEN: ${{ secrets.HF_TOKEN }}
145145
# https://pytorch.org/docs/stable/notes/randomness.html#avoiding-nondeterministic-algorithms
146146
CUBLAS_WORKSPACE_CONFIG: :16:8
147147
run: |
@@ -154,7 +154,7 @@ jobs:
154154
- name: Run nightly example tests with Torch
155155
if: ${{ matrix.module == 'examples' }}
156156
env:
157-
HUGGING_FACE_HUB_TOKEN: ${{ secrets.HUGGING_FACE_HUB_TOKEN }}
157+
HF_TOKEN: ${{ secrets.HF_TOKEN }}
158158
# https://pytorch.org/docs/stable/notes/randomness.html#avoiding-nondeterministic-algorithms
159159
CUBLAS_WORKSPACE_CONFIG: :16:8
160160
run: |
@@ -211,7 +211,7 @@ jobs:
211211

212212
- name: Run nightly LoRA tests with PEFT and Torch
213213
env:
214-
HUGGING_FACE_HUB_TOKEN: ${{ secrets.HUGGING_FACE_HUB_TOKEN }}
214+
HF_TOKEN: ${{ secrets.HF_TOKEN }}
215215
# https://pytorch.org/docs/stable/notes/randomness.html#avoiding-nondeterministic-algorithms
216216
CUBLAS_WORKSPACE_CONFIG: :16:8
217217
run: |
@@ -269,7 +269,7 @@ jobs:
269269

270270
- name: Run nightly Flax TPU tests
271271
env:
272-
HUGGING_FACE_HUB_TOKEN: ${{ secrets.HUGGING_FACE_HUB_TOKEN }}
272+
HF_TOKEN: ${{ secrets.HF_TOKEN }}
273273
run: |
274274
python -m pytest -n 0 \
275275
-s -v -k "Flax" \
@@ -324,7 +324,7 @@ jobs:
324324

325325
- name: Run nightly ONNXRuntime CUDA tests
326326
env:
327-
HUGGING_FACE_HUB_TOKEN: ${{ secrets.HUGGING_FACE_HUB_TOKEN }}
327+
HF_TOKEN: ${{ secrets.HF_TOKEN }}
328328
run: |
329329
python -m pytest -n 1 --max-worker-restart=0 --dist=loadfile \
330330
-s -v -k "Onnx" \
@@ -390,7 +390,7 @@ jobs:
390390
shell: arch -arch arm64 bash {0}
391391
env:
392392
HF_HOME: /System/Volumes/Data/mnt/cache
393-
HUGGING_FACE_HUB_TOKEN: ${{ secrets.HUGGING_FACE_HUB_TOKEN }}
393+
HF_TOKEN: ${{ secrets.HF_TOKEN }}
394394
run: |
395395
${CONDA_RUN} python -m pytest -n 1 -s -v --make-reports=tests_torch_mps \
396396
--report-log=tests_torch_mps.log \

.github/workflows/push_tests.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ jobs:
8787
python utils/print_env.py
8888
- name: Slow PyTorch CUDA checkpoint tests on Ubuntu
8989
env:
90-
HUGGING_FACE_HUB_TOKEN: ${{ secrets.HUGGING_FACE_HUB_TOKEN }}
90+
HF_TOKEN: ${{ secrets.HF_TOKEN }}
9191
# https://pytorch.org/docs/stable/notes/randomness.html#avoiding-nondeterministic-algorithms
9292
CUBLAS_WORKSPACE_CONFIG: :16:8
9393
run: |
@@ -144,7 +144,7 @@ jobs:
144144
145145
- name: Run slow PyTorch CUDA tests
146146
env:
147-
HUGGING_FACE_HUB_TOKEN: ${{ secrets.HUGGING_FACE_HUB_TOKEN }}
147+
HF_TOKEN: ${{ secrets.HF_TOKEN }}
148148
# https://pytorch.org/docs/stable/notes/randomness.html#avoiding-nondeterministic-algorithms
149149
CUBLAS_WORKSPACE_CONFIG: :16:8
150150
run: |
@@ -194,7 +194,7 @@ jobs:
194194
195195
- name: Run slow PEFT CUDA tests
196196
env:
197-
HUGGING_FACE_HUB_TOKEN: ${{ secrets.HUGGING_FACE_HUB_TOKEN }}
197+
HF_TOKEN: ${{ secrets.HF_TOKEN }}
198198
# https://pytorch.org/docs/stable/notes/randomness.html#avoiding-nondeterministic-algorithms
199199
CUBLAS_WORKSPACE_CONFIG: :16:8
200200
run: |
@@ -243,7 +243,7 @@ jobs:
243243
244244
- name: Run slow Flax TPU tests
245245
env:
246-
HUGGING_FACE_HUB_TOKEN: ${{ secrets.HUGGING_FACE_HUB_TOKEN }}
246+
HF_TOKEN: ${{ secrets.HF_TOKEN }}
247247
run: |
248248
python -m pytest -n 0 \
249249
-s -v -k "Flax" \
@@ -290,7 +290,7 @@ jobs:
290290
291291
- name: Run slow ONNXRuntime CUDA tests
292292
env:
293-
HUGGING_FACE_HUB_TOKEN: ${{ secrets.HUGGING_FACE_HUB_TOKEN }}
293+
HF_TOKEN: ${{ secrets.HF_TOKEN }}
294294
run: |
295295
python -m pytest -n 1 --max-worker-restart=0 --dist=loadfile \
296296
-s -v -k "Onnx" \
@@ -337,7 +337,7 @@ jobs:
337337
python utils/print_env.py
338338
- name: Run example tests on GPU
339339
env:
340-
HUGGING_FACE_HUB_TOKEN: ${{ secrets.HUGGING_FACE_HUB_TOKEN }}
340+
HF_TOKEN: ${{ secrets.HF_TOKEN }}
341341
run: |
342342
python -m pytest -n 1 --max-worker-restart=0 --dist=loadfile -s -v -k "compile" --make-reports=tests_torch_compile_cuda tests/
343343
- name: Failure short reports
@@ -378,7 +378,7 @@ jobs:
378378
python utils/print_env.py
379379
- name: Run example tests on GPU
380380
env:
381-
HUGGING_FACE_HUB_TOKEN: ${{ secrets.HUGGING_FACE_HUB_TOKEN }}
381+
HF_TOKEN: ${{ secrets.HF_TOKEN }}
382382
run: |
383383
python -m pytest -n 1 --max-worker-restart=0 --dist=loadfile -s -v -k "xformers" --make-reports=tests_torch_xformers_cuda tests/
384384
- name: Failure short reports
@@ -423,7 +423,7 @@ jobs:
423423
424424
- name: Run example tests on GPU
425425
env:
426-
HUGGING_FACE_HUB_TOKEN: ${{ secrets.HUGGING_FACE_HUB_TOKEN }}
426+
HF_TOKEN: ${{ secrets.HF_TOKEN }}
427427
run: |
428428
python -m venv /opt/venv && export PATH="/opt/venv/bin:$PATH"
429429
python -m uv pip install timm

.github/workflows/push_tests_mps.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ jobs:
5959
shell: arch -arch arm64 bash {0}
6060
env:
6161
HF_HOME: /System/Volumes/Data/mnt/cache
62-
HUGGING_FACE_HUB_TOKEN: ${{ secrets.HUGGING_FACE_HUB_TOKEN }}
62+
HF_TOKEN: ${{ secrets.HF_TOKEN }}
6363
run: |
6464
${CONDA_RUN} python -m pytest -n 0 -s -v --make-reports=tests_torch_mps tests/
6565

.github/workflows/run_test_from_pr.yml

Lines changed: 0 additions & 56 deletions
This file was deleted.
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
name: Check running SLOW tests from a PR (only GPU)
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
docker_image:
7+
default: 'diffusers/diffusers-pytorch-cuda'
8+
description: 'Name of the Docker image'
9+
required: true
10+
branch:
11+
description: 'PR Branch to test on'
12+
required: true
13+
test:
14+
description: 'Tests to run (e.g.: `tests/models`).'
15+
required: true
16+
17+
env:
18+
DIFFUSERS_IS_CI: yes
19+
IS_GITHUB_CI: "1"
20+
HF_HOME: /mnt/cache
21+
OMP_NUM_THREADS: 8
22+
MKL_NUM_THREADS: 8
23+
PYTEST_TIMEOUT: 600
24+
RUN_SLOW: yes
25+
26+
jobs:
27+
run_tests:
28+
name: "Run a test on our runner from a PR"
29+
runs-on: [single-gpu, nvidia-gpu, t4, ci]
30+
container:
31+
image: ${{ github.event.inputs.docker_image }}
32+
options: --gpus 0 --privileged --ipc host -v /mnt/cache/.cache/huggingface:/mnt/cache/
33+
34+
steps:
35+
- name: Validate test files input
36+
id: validate_test_files
37+
env:
38+
PY_TEST: ${{ github.event.inputs.test }}
39+
run: |
40+
if [[ ! "$PY_TEST" =~ ^tests/ ]]; then
41+
echo "Error: The input string must start with 'tests/'."
42+
exit 1
43+
fi
44+
45+
if [[ ! "$PY_TEST" =~ ^tests/(models|pipelines) ]]; then
46+
echo "Error: The input string must contain either 'models' or 'pipelines' after 'tests/'."
47+
exit 1
48+
fi
49+
50+
if [[ "$PY_TEST" == *";"* ]]; then
51+
echo "Error: The input string must not contain ';'."
52+
exit 1
53+
fi
54+
echo "$PY_TEST"
55+
56+
- name: Checkout PR branch
57+
uses: actions/checkout@v4
58+
with:
59+
ref: ${{ github.event.inputs.branch }}
60+
repository: ${{ github.event.pull_request.head.repo.full_name }}
61+
62+
63+
- name: Install pytest
64+
run: |
65+
python -m venv /opt/venv && export PATH="/opt/venv/bin:$PATH"
66+
python -m uv pip install -e [quality,test]
67+
python -m uv pip install peft
68+
69+
- name: Run tests
70+
env:
71+
PY_TEST: ${{ github.event.inputs.test }}
72+
run: |
73+
pytest "$PY_TEST"

.github/workflows/update_metadata.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,6 @@ jobs:
2525
2626
- name: Update metadata
2727
env:
28-
HUGGING_FACE_HUB_TOKEN: ${{ secrets.SAYAK_HF_TOKEN }}
28+
HF_TOKEN: ${{ secrets.SAYAK_HF_TOKEN }}
2929
run: |
3030
python utils/update_metadata.py --commit_sha ${{ github.sha }}

0 commit comments

Comments
 (0)