Skip to content

Commit 79c1107

Browse files
authored
Merge branch 'main' into npu_ulysses
2 parents a033e7f + c10bdd9 commit 79c1107

File tree

526 files changed

+70283
-6835
lines changed

Some content is hidden

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

526 files changed

+70283
-6835
lines changed

.github/workflows/codeql.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
---
2+
name: CodeQL Security Analysis For Github Actions
3+
4+
on:
5+
push:
6+
branches: ["main"]
7+
workflow_dispatch:
8+
# pull_request:
9+
10+
jobs:
11+
codeql:
12+
name: CodeQL Analysis
13+
uses: huggingface/security-workflows/.github/workflows/codeql-reusable.yml@v1
14+
permissions:
15+
security-events: write
16+
packages: read
17+
actions: read
18+
contents: read
19+
with:
20+
languages: '["actions","python"]'
21+
queries: 'security-extended,security-and-quality'
22+
runner: 'ubuntu-latest' #optional if need custom runner

.github/workflows/mirror_community_pipeline.yml

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ jobs:
2424
mirror_community_pipeline:
2525
env:
2626
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL_COMMUNITY_MIRROR }}
27-
2827
runs-on: ubuntu-22.04
2928
steps:
3029
# Checkout to correct ref
@@ -39,25 +38,28 @@ jobs:
3938
# If ref is 'refs/heads/main' => set 'main'
4039
# Else it must be a tag => set {tag}
4140
- name: Set checkout_ref and path_in_repo
41+
EVENT_NAME: ${{ github.event_name }}
42+
EVENT_INPUT_REF: ${{ github.event.inputs.ref }}
43+
GITHUB_REF: ${{ github.ref }}
4244
run: |
43-
if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then
44-
if [ -z "${{ github.event.inputs.ref }}" ]; then
45+
if [ "$EVENT_NAME" == "workflow_dispatch" ]; then
46+
if [ -z "$EVENT_INPUT_REF" ]; then
4547
echo "Error: Missing ref input"
4648
exit 1
47-
elif [ "${{ github.event.inputs.ref }}" == "main" ]; then
49+
elif [ "$EVENT_INPUT_REF" == "main" ]; then
4850
echo "CHECKOUT_REF=refs/heads/main" >> $GITHUB_ENV
4951
echo "PATH_IN_REPO=main" >> $GITHUB_ENV
5052
else
51-
echo "CHECKOUT_REF=refs/tags/${{ github.event.inputs.ref }}" >> $GITHUB_ENV
52-
echo "PATH_IN_REPO=${{ github.event.inputs.ref }}" >> $GITHUB_ENV
53+
echo "CHECKOUT_REF=refs/tags/$EVENT_INPUT_REF" >> $GITHUB_ENV
54+
echo "PATH_IN_REPO=$EVENT_INPUT_REF" >> $GITHUB_ENV
5355
fi
54-
elif [ "${{ github.ref }}" == "refs/heads/main" ]; then
55-
echo "CHECKOUT_REF=${{ github.ref }}" >> $GITHUB_ENV
56+
elif [ "$GITHUB_REF" == "refs/heads/main" ]; then
57+
echo "CHECKOUT_REF=$GITHUB_REF" >> $GITHUB_ENV
5658
echo "PATH_IN_REPO=main" >> $GITHUB_ENV
5759
else
5860
# e.g. refs/tags/v0.28.1 -> v0.28.1
59-
echo "CHECKOUT_REF=${{ github.ref }}" >> $GITHUB_ENV
60-
echo "PATH_IN_REPO=$(echo ${{ github.ref }} | sed 's/^refs\/tags\///')" >> $GITHUB_ENV
61+
echo "CHECKOUT_REF=$GITHUB_REF" >> $GITHUB_ENV
62+
echo "PATH_IN_REPO=$(echo $GITHUB_REF | sed 's/^refs\/tags\///')" >> $GITHUB_ENV
6163
fi
6264
- name: Print env vars
6365
run: |
@@ -99,4 +101,4 @@ jobs:
99101
- name: Report failure status
100102
if: ${{ failure() }}
101103
run: |
102-
pip install requests && python utils/notify_community_pipelines_mirror.py --status=failure
104+
pip install requests && python utils/notify_community_pipelines_mirror.py --status=failure

.github/workflows/nightly_tests.yml

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -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: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -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: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -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: 18 additions & 15 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:
@@ -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)