Skip to content

Commit b55179f

Browse files
Merge branch 'huggingface:main' into main
2 parents 7f01e69 + 6708f5c commit b55179f

File tree

469 files changed

+59309
-5854
lines changed

Some content is hidden

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

469 files changed

+59309
-5854
lines changed

.github/workflows/benchmark.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77

88
env:
99
DIFFUSERS_IS_CI: yes
10-
HF_HUB_ENABLE_HF_TRANSFER: 1
10+
HF_XET_HIGH_PERFORMANCE: 1
1111
HF_HOME: /mnt/cache
1212
OMP_NUM_THREADS: 8
1313
MKL_NUM_THREADS: 8

.github/workflows/build_docker_images.yml

Lines changed: 29 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -42,18 +42,39 @@ jobs:
4242
CHANGED_FILES: ${{ steps.file_changes.outputs.all }}
4343
run: |
4444
echo "$CHANGED_FILES"
45-
for FILE in $CHANGED_FILES; do
45+
ALLOWED_IMAGES=(
46+
diffusers-pytorch-cpu
47+
diffusers-pytorch-cuda
48+
diffusers-pytorch-xformers-cuda
49+
diffusers-pytorch-minimum-cuda
50+
diffusers-doc-builder
51+
)
52+
53+
declare -A IMAGES_TO_BUILD=()
54+
55+
for FILE in $CHANGED_FILES; do
4656
# skip anything that isn't still on disk
47-
if [[ ! -f "$FILE" ]]; then
57+
if [[ ! -e "$FILE" ]]; then
4858
echo "Skipping removed file $FILE"
4959
continue
50-
fi
51-
if [[ "$FILE" == docker/*Dockerfile ]]; then
52-
DOCKER_PATH="${FILE%/Dockerfile}"
53-
DOCKER_TAG=$(basename "$DOCKER_PATH")
54-
echo "Building Docker image for $DOCKER_TAG"
55-
docker build -t "$DOCKER_TAG" "$DOCKER_PATH"
5660
fi
61+
62+
for IMAGE in "${ALLOWED_IMAGES[@]}"; do
63+
if [[ "$FILE" == docker/${IMAGE}/* ]]; then
64+
IMAGES_TO_BUILD["$IMAGE"]=1
65+
fi
66+
done
67+
done
68+
69+
if [[ ${#IMAGES_TO_BUILD[@]} -eq 0 ]]; then
70+
echo "No relevant Docker changes detected."
71+
exit 0
72+
fi
73+
74+
for IMAGE in "${!IMAGES_TO_BUILD[@]}"; do
75+
DOCKER_PATH="docker/${IMAGE}"
76+
echo "Building Docker image for $IMAGE"
77+
docker build -t "$IMAGE" "$DOCKER_PATH"
5778
done
5879
if: steps.file_changes.outputs.all != ''
5980

.github/workflows/nightly_tests.yml

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77

88
env:
99
DIFFUSERS_IS_CI: yes
10-
HF_HUB_ENABLE_HF_TRANSFER: 1
10+
HF_XET_HIGH_PERFORMANCE: 1
1111
OMP_NUM_THREADS: 8
1212
MKL_NUM_THREADS: 8
1313
PYTEST_TIMEOUT: 600
@@ -73,6 +73,8 @@ jobs:
7373
run: |
7474
uv pip install -e ".[quality]"
7575
uv pip uninstall accelerate && uv pip install -U accelerate@git+https://github.com/huggingface/accelerate.git
76+
#uv pip uninstall transformers huggingface_hub && uv pip install --prerelease allow -U transformers@git+https://github.com/huggingface/transformers.git
77+
uv pip uninstall transformers huggingface_hub && uv pip install transformers==4.57.1
7678
uv pip install pytest-reportlog
7779
- name: Environment
7880
run: |
@@ -84,7 +86,7 @@ jobs:
8486
CUBLAS_WORKSPACE_CONFIG: :16:8
8587
run: |
8688
pytest -n 1 --max-worker-restart=0 --dist=loadfile \
87-
-s -v -k "not Flax and not Onnx" \
89+
-k "not Flax and not Onnx" \
8890
--make-reports=tests_pipeline_${{ matrix.module }}_cuda \
8991
--report-log=tests_pipeline_${{ matrix.module }}_cuda.log \
9092
tests/pipelines/${{ matrix.module }}
@@ -126,6 +128,8 @@ jobs:
126128
uv pip install -e ".[quality]"
127129
uv pip install peft@git+https://github.com/huggingface/peft.git
128130
uv pip uninstall accelerate && uv pip install -U accelerate@git+https://github.com/huggingface/accelerate.git
131+
#uv pip uninstall transformers huggingface_hub && uv pip install --prerelease allow -U transformers@git+https://github.com/huggingface/transformers.git
132+
uv pip uninstall transformers huggingface_hub && uv pip install transformers==4.57.1
129133
uv pip install pytest-reportlog
130134
- name: Environment
131135
run: python utils/print_env.py
@@ -138,7 +142,7 @@ jobs:
138142
CUBLAS_WORKSPACE_CONFIG: :16:8
139143
run: |
140144
pytest -n 1 --max-worker-restart=0 --dist=loadfile \
141-
-s -v -k "not Flax and not Onnx" \
145+
-k "not Flax and not Onnx" \
142146
--make-reports=tests_torch_${{ matrix.module }}_cuda \
143147
--report-log=tests_torch_${{ matrix.module }}_cuda.log \
144148
tests/${{ matrix.module }}
@@ -151,7 +155,7 @@ jobs:
151155
CUBLAS_WORKSPACE_CONFIG: :16:8
152156
run: |
153157
pytest -n 1 --max-worker-restart=0 --dist=loadfile \
154-
-s -v --make-reports=examples_torch_cuda \
158+
--make-reports=examples_torch_cuda \
155159
--report-log=examples_torch_cuda.log \
156160
examples/
157161
@@ -190,6 +194,8 @@ jobs:
190194
- name: Install dependencies
191195
run: |
192196
uv pip install -e ".[quality,training]"
197+
#uv pip uninstall transformers huggingface_hub && uv pip install --prerelease allow -U transformers@git+https://github.com/huggingface/transformers.git
198+
uv pip uninstall transformers huggingface_hub && uv pip install transformers==4.57.1
193199
- name: Environment
194200
run: |
195201
python utils/print_env.py
@@ -198,7 +204,7 @@ jobs:
198204
HF_TOKEN: ${{ secrets.DIFFUSERS_HF_HUB_READ_TOKEN }}
199205
RUN_COMPILE: yes
200206
run: |
201-
pytest -n 1 --max-worker-restart=0 --dist=loadfile -s -v -k "compile" --make-reports=tests_torch_compile_cuda tests/
207+
pytest -n 1 --max-worker-restart=0 --dist=loadfile -k "compile" --make-reports=tests_torch_compile_cuda tests/
202208
- name: Failure short reports
203209
if: ${{ failure() }}
204210
run: cat reports/tests_torch_compile_cuda_failures_short.txt
@@ -232,6 +238,8 @@ jobs:
232238
uv pip install -e ".[quality]"
233239
uv pip install peft@git+https://github.com/huggingface/peft.git
234240
uv pip uninstall accelerate && uv pip install -U accelerate@git+https://github.com/huggingface/accelerate.git
241+
#uv pip uninstall transformers huggingface_hub && uv pip install --prerelease allow -U transformers@git+https://github.com/huggingface/transformers.git
242+
uv pip uninstall transformers huggingface_hub && uv pip install transformers==4.57.1
235243
uv pip install pytest-reportlog
236244
- name: Environment
237245
run: |
@@ -281,6 +289,8 @@ jobs:
281289
uv pip install -e ".[quality]"
282290
uv pip install peft@git+https://github.com/huggingface/peft.git
283291
uv pip uninstall accelerate && uv pip install -U accelerate@git+https://github.com/huggingface/accelerate.git
292+
#uv pip uninstall transformers huggingface_hub && uv pip install --prerelease allow -U transformers@git+https://github.com/huggingface/transformers.git
293+
uv pip uninstall transformers huggingface_hub && uv pip install transformers==4.57.1
284294
285295
- name: Environment
286296
run: |
@@ -293,7 +303,7 @@ jobs:
293303
CUBLAS_WORKSPACE_CONFIG: :16:8
294304
run: |
295305
pytest -n 1 --max-worker-restart=0 --dist=loadfile \
296-
-s -v -k "not Flax and not Onnx" \
306+
-k "not Flax and not Onnx" \
297307
--make-reports=tests_torch_minimum_version_cuda \
298308
tests/models/test_modeling_common.py \
299309
tests/pipelines/test_pipelines_common.py \
@@ -358,6 +368,8 @@ jobs:
358368
uv pip install ${{ join(matrix.config.additional_deps, ' ') }}
359369
fi
360370
uv pip install pytest-reportlog
371+
#uv pip uninstall transformers huggingface_hub && uv pip install --prerelease allow -U transformers@git+https://github.com/huggingface/transformers.git
372+
uv pip uninstall transformers huggingface_hub && uv pip install transformers==4.57.1
361373
- name: Environment
362374
run: |
363375
python utils/print_env.py
@@ -405,6 +417,8 @@ jobs:
405417
run: |
406418
uv pip install -e ".[quality]"
407419
uv pip install -U bitsandbytes optimum_quanto
420+
#uv pip uninstall transformers huggingface_hub && uv pip install --prerelease allow -U transformers@git+https://github.com/huggingface/transformers.git
421+
uv pip uninstall transformers huggingface_hub && uv pip install transformers==4.57.1
408422
uv pip install pytest-reportlog
409423
- name: Environment
410424
run: |
@@ -531,7 +545,7 @@ jobs:
531545
# HF_HOME: /System/Volumes/Data/mnt/cache
532546
# HF_TOKEN: ${{ secrets.DIFFUSERS_HF_HUB_READ_TOKEN }}
533547
# run: |
534-
# ${CONDA_RUN} pytest -n 1 -s -v --make-reports=tests_torch_mps \
548+
# ${CONDA_RUN} pytest -n 1 --make-reports=tests_torch_mps \
535549
# --report-log=tests_torch_mps.log \
536550
# tests/
537551
# - name: Failure short reports
@@ -587,7 +601,7 @@ jobs:
587601
# HF_HOME: /System/Volumes/Data/mnt/cache
588602
# HF_TOKEN: ${{ secrets.DIFFUSERS_HF_HUB_READ_TOKEN }}
589603
# run: |
590-
# ${CONDA_RUN} pytest -n 1 -s -v --make-reports=tests_torch_mps \
604+
# ${CONDA_RUN} pytest -n 1 --make-reports=tests_torch_mps \
591605
# --report-log=tests_torch_mps.log \
592606
# tests/
593607
# - name: Failure short reports

.github/workflows/pr_modular_tests.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ concurrency:
2626

2727
env:
2828
DIFFUSERS_IS_CI: yes
29-
HF_HUB_ENABLE_HF_TRANSFER: 1
29+
HF_XET_HIGH_PERFORMANCE: 1
3030
OMP_NUM_THREADS: 4
3131
MKL_NUM_THREADS: 4
3232
PYTEST_TIMEOUT: 60
@@ -109,7 +109,8 @@ jobs:
109109
- name: Install dependencies
110110
run: |
111111
uv pip install -e ".[quality]"
112-
uv pip uninstall transformers huggingface_hub && uv pip install --prerelease allow -U transformers@git+https://github.com/huggingface/transformers.git
112+
#uv pip uninstall transformers huggingface_hub && uv pip install --prerelease allow -U transformers@git+https://github.com/huggingface/transformers.git
113+
uv pip uninstall transformers huggingface_hub && uv pip install transformers==4.57.1
113114
uv pip uninstall accelerate && uv pip install -U accelerate@git+https://github.com/huggingface/accelerate.git --no-deps
114115
115116
- name: Environment
@@ -120,7 +121,7 @@ jobs:
120121
if: ${{ matrix.config.framework == 'pytorch_pipelines' }}
121122
run: |
122123
pytest -n 8 --max-worker-restart=0 --dist=loadfile \
123-
-s -v -k "not Flax and not Onnx" \
124+
-k "not Flax and not Onnx" \
124125
--make-reports=tests_${{ matrix.config.report }} \
125126
tests/modular_pipelines
126127

.github/workflows/pr_tests.yml

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ concurrency:
2222

2323
env:
2424
DIFFUSERS_IS_CI: yes
25-
HF_HUB_ENABLE_HF_TRANSFER: 1
25+
HF_XET_HIGH_PERFORMANCE: 1
2626
OMP_NUM_THREADS: 4
2727
MKL_NUM_THREADS: 4
2828
PYTEST_TIMEOUT: 60
@@ -115,7 +115,8 @@ jobs:
115115
- name: Install dependencies
116116
run: |
117117
uv pip install -e ".[quality]"
118-
uv pip uninstall transformers huggingface_hub && uv pip install --prerelease allow -U transformers@git+https://github.com/huggingface/transformers.git
118+
#uv pip uninstall transformers huggingface_hub && uv pip install --prerelease allow -U transformers@git+https://github.com/huggingface/transformers.git
119+
uv pip uninstall transformers huggingface_hub && uv pip install transformers==4.57.1
119120
uv pip uninstall accelerate && uv pip install -U accelerate@git+https://github.com/huggingface/accelerate.git --no-deps
120121
121122
- name: Environment
@@ -126,15 +127,15 @@ jobs:
126127
if: ${{ matrix.config.framework == 'pytorch_pipelines' }}
127128
run: |
128129
pytest -n 8 --max-worker-restart=0 --dist=loadfile \
129-
-s -v -k "not Flax and not Onnx" \
130+
-k "not Flax and not Onnx" \
130131
--make-reports=tests_${{ matrix.config.report }} \
131132
tests/pipelines
132133
133134
- name: Run fast PyTorch Model Scheduler CPU tests
134135
if: ${{ matrix.config.framework == 'pytorch_models' }}
135136
run: |
136137
pytest -n 4 --max-worker-restart=0 --dist=loadfile \
137-
-s -v -k "not Flax and not Onnx and not Dependency" \
138+
-k "not Flax and not Onnx and not Dependency" \
138139
--make-reports=tests_${{ matrix.config.report }} \
139140
tests/models tests/schedulers tests/others
140141
@@ -246,7 +247,8 @@ jobs:
246247
uv pip install -U peft@git+https://github.com/huggingface/peft.git --no-deps
247248
uv pip install -U tokenizers
248249
uv pip uninstall accelerate && uv pip install -U accelerate@git+https://github.com/huggingface/accelerate.git --no-deps
249-
uv pip uninstall transformers huggingface_hub && uv pip install --prerelease allow -U transformers@git+https://github.com/huggingface/transformers.git
250+
#uv pip uninstall transformers huggingface_hub && uv pip install --prerelease allow -U transformers@git+https://github.com/huggingface/transformers.git
251+
uv pip uninstall transformers huggingface_hub && uv pip install transformers==4.57.1
250252
251253
- name: Environment
252254
run: |
@@ -255,11 +257,11 @@ jobs:
255257
- name: Run fast PyTorch LoRA tests with PEFT
256258
run: |
257259
pytest -n 4 --max-worker-restart=0 --dist=loadfile \
258-
-s -v \
260+
\
259261
--make-reports=tests_peft_main \
260262
tests/lora/
261263
pytest -n 4 --max-worker-restart=0 --dist=loadfile \
262-
-s -v \
264+
\
263265
--make-reports=tests_models_lora_peft_main \
264266
tests/models/ -k "lora"
265267

.github/workflows/pr_tests_gpu.yml

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Fast GPU Tests on PR
1+
name: Fast GPU Tests on PR
22

33
on:
44
pull_request:
@@ -24,7 +24,7 @@ env:
2424
DIFFUSERS_IS_CI: yes
2525
OMP_NUM_THREADS: 8
2626
MKL_NUM_THREADS: 8
27-
HF_HUB_ENABLE_HF_TRANSFER: 1
27+
HF_XET_HIGH_PERFORMANCE: 1
2828
PYTEST_TIMEOUT: 600
2929
PIPELINE_USAGE_CUTOFF: 1000000000 # set high cutoff so that only always-test pipelines run
3030

@@ -71,7 +71,7 @@ jobs:
7171
if: ${{ failure() }}
7272
run: |
7373
echo "Repo consistency check failed. Please ensure the right dependency versions are installed with 'pip install -e .[quality]' and run 'make fix-copies'" >> $GITHUB_STEP_SUMMARY
74-
74+
7575
setup_torch_cuda_pipeline_matrix:
7676
needs: [check_code_quality, check_repository_consistency]
7777
name: Setup Torch Pipelines CUDA Slow Tests Matrix
@@ -131,7 +131,8 @@ jobs:
131131
run: |
132132
uv pip install -e ".[quality]"
133133
uv pip uninstall accelerate && uv pip install -U accelerate@git+https://github.com/huggingface/accelerate.git
134-
uv pip uninstall transformers huggingface_hub && uv pip install --prerelease allow -U transformers@git+https://github.com/huggingface/transformers.git
134+
#uv pip uninstall transformers huggingface_hub && uv pip install --prerelease allow -U transformers@git+https://github.com/huggingface/transformers.git
135+
uv pip uninstall transformers huggingface_hub && uv pip install transformers==4.57.1
135136
136137
- name: Environment
137138
run: |
@@ -149,18 +150,18 @@ jobs:
149150
# https://pytorch.org/docs/stable/notes/randomness.html#avoiding-nondeterministic-algorithms
150151
CUBLAS_WORKSPACE_CONFIG: :16:8
151152
run: |
152-
if [ "${{ matrix.module }}" = "ip_adapters" ]; then
153+
if [ "${{ matrix.module }}" = "ip_adapters" ]; then
153154
pytest -n 1 --max-worker-restart=0 --dist=loadfile \
154-
-s -v -k "not Flax and not Onnx" \
155+
-k "not Flax and not Onnx" \
155156
--make-reports=tests_pipeline_${{ matrix.module }}_cuda \
156157
tests/pipelines/${{ matrix.module }}
157-
else
158+
else
158159
pattern=$(cat ${{ steps.extract_tests.outputs.pattern_file }})
159160
pytest -n 1 --max-worker-restart=0 --dist=loadfile \
160-
-s -v -k "not Flax and not Onnx and $pattern" \
161+
-k "not Flax and not Onnx and $pattern" \
161162
--make-reports=tests_pipeline_${{ matrix.module }}_cuda \
162163
tests/pipelines/${{ matrix.module }}
163-
fi
164+
fi
164165
165166
- name: Failure short reports
166167
if: ${{ failure() }}
@@ -201,7 +202,8 @@ jobs:
201202
uv pip install -e ".[quality]"
202203
uv pip install peft@git+https://github.com/huggingface/peft.git
203204
uv pip uninstall accelerate && uv pip install -U accelerate@git+https://github.com/huggingface/accelerate.git
204-
uv pip uninstall transformers huggingface_hub && uv pip install --prerelease allow -U transformers@git+https://github.com/huggingface/transformers.git
205+
#uv pip uninstall transformers huggingface_hub && uv pip install --prerelease allow -U transformers@git+https://github.com/huggingface/transformers.git
206+
uv pip uninstall transformers huggingface_hub && uv pip install transformers==4.57.1
205207
206208
- name: Environment
207209
run: |
@@ -222,11 +224,11 @@ jobs:
222224
run: |
223225
pattern=$(cat ${{ steps.extract_tests.outputs.pattern_file }})
224226
if [ -z "$pattern" ]; then
225-
pytest -n 1 -sv --max-worker-restart=0 --dist=loadfile -k "not Flax and not Onnx" tests/${{ matrix.module }} \
226-
--make-reports=tests_torch_cuda_${{ matrix.module }}
227+
pytest -n 1 --max-worker-restart=0 --dist=loadfile -k "not Flax and not Onnx" tests/${{ matrix.module }} \
228+
--make-reports=tests_torch_cuda_${{ matrix.module }}
227229
else
228-
pytest -n 1 -sv --max-worker-restart=0 --dist=loadfile -k "not Flax and not Onnx and $pattern" tests/${{ matrix.module }} \
229-
--make-reports=tests_torch_cuda_${{ matrix.module }}
230+
pytest -n 1 --max-worker-restart=0 --dist=loadfile -k "not Flax and not Onnx and $pattern" tests/${{ matrix.module }} \
231+
--make-reports=tests_torch_cuda_${{ matrix.module }}
230232
fi
231233
232234
- name: Failure short reports
@@ -262,7 +264,8 @@ jobs:
262264
nvidia-smi
263265
- name: Install dependencies
264266
run: |
265-
uv pip uninstall transformers huggingface_hub && uv pip install --prerelease allow -U transformers@git+https://github.com/huggingface/transformers.git
267+
#uv pip uninstall transformers huggingface_hub && uv pip install --prerelease allow -U transformers@git+https://github.com/huggingface/transformers.git
268+
uv pip uninstall transformers huggingface_hub && uv pip install transformers==4.57.1
266269
uv pip install -e ".[quality,training]"
267270
268271
- name: Environment
@@ -274,7 +277,7 @@ jobs:
274277
HF_TOKEN: ${{ secrets.DIFFUSERS_HF_HUB_READ_TOKEN }}
275278
run: |
276279
uv pip install ".[training]"
277-
pytest -n 1 --max-worker-restart=0 --dist=loadfile -s -v --make-reports=examples_torch_cuda examples/
280+
pytest -n 1 --max-worker-restart=0 --dist=loadfile --make-reports=examples_torch_cuda examples/
278281
279282
- name: Failure short reports
280283
if: ${{ failure() }}

0 commit comments

Comments
 (0)