Skip to content

Commit fb08f3c

Browse files
authored
Merge branch 'main' into docker-build-workflow
2 parents a24e0c6 + 5d3923b commit fb08f3c

File tree

53 files changed

+959
-217
lines changed

Some content is hidden

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

53 files changed

+959
-217
lines changed

.github/workflows/benchmark.yml

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
name: Benchmarking tests
22

33
on:
4+
workflow_dispatch:
45
schedule:
56
- cron: "30 1 1,15 * *" # every 2 weeks on the 1st and the 15th of every month at 1:30 AM
67

@@ -31,8 +32,9 @@ jobs:
3132
- name: Install dependencies
3233
run: |
3334
apt-get update && apt-get install libsndfile1-dev libgl1 -y
34-
python -m pip install -e .[quality,test]
35-
python -m pip install pandas peft
35+
python -m venv /opt/venv && export PATH="/opt/venv/bin:$PATH"
36+
python -m uv pip install -e [quality,test]
37+
python -m uv pip install pandas peft
3638
- name: Environment
3739
run: |
3840
python utils/print_env.py

.github/workflows/build_docker_images.yml

+25
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ concurrency:
1111

1212
env:
1313
REGISTRY: diffusers
14+
CI_SLACK_CHANNEL: ${{ secrets.CI_DOCKER_CHANNEL }}
1415

1516
jobs:
1617
build-docker-images:
@@ -50,3 +51,27 @@ jobs:
5051
context: ./docker/${{ matrix.image-name }}
5152
push: true
5253
tags: ${{ env.REGISTRY }}/${{ matrix.image-name }}:latest
54+
55+
- name: Post to a Slack channel
56+
id: slack
57+
uses: slackapi/slack-github-action@6c661ce58804a1a20f6dc5fbee7f0381b469e001
58+
with:
59+
# Slack channel id, channel name, or user id to post message.
60+
# See also: https://api.slack.com/methods/chat.postMessage#channels
61+
channel-id: ${{ env.CI_SLACK_CHANNEL }}
62+
# For posting a rich message using Block Kit
63+
payload: |
64+
{
65+
"text": "${{ matrix.image-name }} Docker Image build result: ${{ job.status }}\n${{ github.event.head_commit.url }}",
66+
"blocks": [
67+
{
68+
"type": "section",
69+
"text": {
70+
"type": "mrkdwn",
71+
"text": "${{ matrix.image-name }} Docker Image build result: ${{ job.status }}\n${{ github.event.head_commit.url }}"
72+
}
73+
}
74+
]
75+
}
76+
env:
77+
SLACK_BOT_TOKEN: ${{ secrets.SLACK_CIFEEDBACK_BOT_TOKEN }}

.github/workflows/build_documentation.yml

+4
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ on:
77
- doc-builder*
88
- v*-release
99
- v*-patch
10+
paths:
11+
- "src/diffusers/**.py"
12+
- "examples/**"
13+
- "docs/**"
1014

1115
jobs:
1216
build:

.github/workflows/build_pr_documentation.yml

+4
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@ name: Build PR Documentation
22

33
on:
44
pull_request:
5+
paths:
6+
- "src/diffusers/**.py"
7+
- "examples/**"
8+
- "docs/**"
59

610
concurrency:
711
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}

.github/workflows/nightly_tests.yml

+11-7
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,10 @@ jobs:
6060
6161
- name: Install dependencies
6262
run: |
63-
python -m pip install -e .[quality,test]
64-
python -m pip install -U git+https://github.com/huggingface/transformers
65-
python -m pip install git+https://github.com/huggingface/accelerate
63+
python -m venv /opt/venv && export PATH="/opt/venv/bin:$PATH"
64+
python -m uv pip install -e [quality,test]
65+
python -m uv pip install -U transformers@git+https://github.com/huggingface/transformers
66+
python -m uv pip install accelerate@git+https://github.com/huggingface/accelerate
6667
6768
- name: Environment
6869
run: |
@@ -73,6 +74,7 @@ jobs:
7374
env:
7475
HUGGING_FACE_HUB_TOKEN: ${{ secrets.HUGGING_FACE_HUB_TOKEN }}
7576
run: |
77+
python -m venv /opt/venv && export PATH="/opt/venv/bin:$PATH"
7678
python -m pytest -n 1 --max-worker-restart=0 --dist=loadfile \
7779
-s -v -k "not Flax and not Onnx" \
7880
--make-reports=tests_${{ matrix.config.report }} \
@@ -83,6 +85,7 @@ jobs:
8385
env:
8486
HUGGING_FACE_HUB_TOKEN: ${{ secrets.HUGGING_FACE_HUB_TOKEN }}
8587
run: |
88+
python -m venv /opt/venv && export PATH="/opt/venv/bin:$PATH"
8689
python -m pytest -n 0 \
8790
-s -v -k "Flax" \
8891
--make-reports=tests_${{ matrix.config.report }} \
@@ -93,6 +96,7 @@ jobs:
9396
env:
9497
HUGGING_FACE_HUB_TOKEN: ${{ secrets.HUGGING_FACE_HUB_TOKEN }}
9598
run: |
99+
python -m venv /opt/venv && export PATH="/opt/venv/bin:$PATH"
96100
python -m pytest -n 1 --max-worker-restart=0 --dist=loadfile \
97101
-s -v -k "Onnx" \
98102
--make-reports=tests_${{ matrix.config.report }} \
@@ -132,10 +136,10 @@ jobs:
132136
- name: Install dependencies
133137
shell: arch -arch arm64 bash {0}
134138
run: |
135-
${CONDA_RUN} python -m pip install --upgrade pip
136-
${CONDA_RUN} python -m pip install -e .[quality,test]
137-
${CONDA_RUN} python -m pip install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cpu
138-
${CONDA_RUN} python -m pip install git+https://github.com/huggingface/accelerate
139+
${CONDA_RUN} python -m pip install --upgrade pip uv
140+
${CONDA_RUN} python -m uv pip install -e [quality,test]
141+
${CONDA_RUN} python -m uv pip install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cpu
142+
${CONDA_RUN} python -m uv pip install accelerate@git+https://github.com/huggingface/accelerate
139143
140144
- name: Environment
141145
shell: arch -arch arm64 bash {0}

.github/workflows/pr_dependency_test.yml

+5-3
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,12 @@ jobs:
2525
python-version: "3.8"
2626
- name: Install dependencies
2727
run: |
28-
python -m pip install --upgrade pip
29-
pip install -e .
30-
pip install pytest
28+
python -m venv /opt/venv && export PATH="/opt/venv/bin:$PATH"
29+
python -m pip install --upgrade pip uv
30+
python -m uv pip install -e .
31+
python -m uv pip install pytest
3132
- name: Check for soft dependencies
3233
run: |
34+
python -m venv /opt/venv && export PATH="/opt/venv/bin:$PATH"
3335
pytest tests/others/test_dependencies.py
3436

.github/workflows/pr_flax_dependency_test.yml

+8-6
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,14 @@ jobs:
2525
python-version: "3.8"
2626
- name: Install dependencies
2727
run: |
28-
python -m pip install --upgrade pip
29-
pip install -e .
30-
pip install "jax[cpu]>=0.2.16,!=0.3.2"
31-
pip install "flax>=0.4.1"
32-
pip install "jaxlib>=0.1.65"
33-
pip install pytest
28+
python -m venv /opt/venv && export PATH="/opt/venv/bin:$PATH"
29+
python -m pip install --upgrade pip uv
30+
python -m uv pip install -e .
31+
python -m uv pip install "jax[cpu]>=0.2.16,!=0.3.2"
32+
python -m uv pip install "flax>=0.4.1"
33+
python -m uv pip install "jaxlib>=0.1.65"
34+
python -m uv pip install pytest
3435
- name: Check for soft dependencies
3536
run: |
37+
python -m venv /opt/venv && export PATH="/opt/venv/bin:$PATH"
3638
pytest tests/others/test_dependencies.py

.github/workflows/pr_test_fetcher.yml

+10-3
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@ jobs:
3333
- name: Install dependencies
3434
run: |
3535
apt-get update && apt-get install libsndfile1-dev libgl1 -y
36-
python -m pip install -e .[quality,test]
36+
python -m venv /opt/venv && export PATH="/opt/venv/bin:$PATH"
37+
python -m uv pip install -e [quality,test]
3738
- name: Environment
3839
run: |
3940
python utils/print_env.py
@@ -89,15 +90,18 @@ jobs:
8990
- name: Install dependencies
9091
run: |
9192
apt-get update && apt-get install libsndfile1-dev libgl1 -y
92-
python -m pip install -e .[quality,test]
93+
python -m venv /opt/venv && export PATH="/opt/venv/bin:$PATH"
94+
python -m pip install -e [quality,test]
9395
python -m pip install accelerate
9496
9597
- name: Environment
9698
run: |
99+
python -m venv /opt/venv && export PATH="/opt/venv/bin:$PATH"
97100
python utils/print_env.py
98101
99102
- name: Run all selected tests on CPU
100103
run: |
104+
python -m venv /opt/venv && export PATH="/opt/venv/bin:$PATH"
101105
python -m pytest -n 2 --dist=loadfile -v --make-reports=${{ matrix.modules }}_tests_cpu ${{ fromJson(needs.setup_pr_tests.outputs.test_map)[matrix.modules] }}
102106
103107
- name: Failure short reports
@@ -144,15 +148,18 @@ jobs:
144148
- name: Install dependencies
145149
run: |
146150
apt-get update && apt-get install libsndfile1-dev libgl1 -y
147-
python -m pip install -e .[quality,test]
151+
python -m venv /opt/venv && export PATH="/opt/venv/bin:$PATH"
152+
python -m pip install -e [quality,test]
148153
149154
- name: Environment
150155
run: |
156+
python -m venv /opt/venv && export PATH="/opt/venv/bin:$PATH"
151157
python utils/print_env.py
152158
153159
- name: Run Hub tests for models, schedulers, and pipelines on a staging env
154160
if: ${{ matrix.config.framework == 'hub_tests_pytorch' }}
155161
run: |
162+
python -m venv /opt/venv && export PATH="/opt/venv/bin:$PATH"
156163
HUGGINGFACE_CO_STAGING=true python -m pytest \
157164
-m "is_staging_test" \
158165
--make-reports=tests_${{ matrix.config.report }} \

.github/workflows/pr_test_peft_backend.yml

+8-5
Original file line numberDiff line numberDiff line change
@@ -84,21 +84,24 @@ jobs:
8484
- name: Install dependencies
8585
run: |
8686
apt-get update && apt-get install libsndfile1-dev libgl1 -y
87-
python -m pip install -e .[quality,test]
87+
python -m venv /opt/venv && export PATH="/opt/venv/bin:$PATH"
88+
python -m uv pip install -e [quality,test]
8889
if [ "${{ matrix.lib-versions }}" == "main" ]; then
89-
python -m pip install -U git+https://github.com/huggingface/peft.git
90-
python -m pip install -U git+https://github.com/huggingface/transformers.git
91-
python -m pip install -U git+https://github.com/huggingface/accelerate.git
90+
python -m uv pip install -U peft@git+https://github.com/huggingface/peft.git
91+
python -m uv pip install -U transformers@git+https://github.com/huggingface/transformers.git
92+
python -m uv pip install -U accelerate@git+https://github.com/huggingface/accelerate.git
9293
else
93-
python -m pip install -U peft transformers accelerate
94+
python -m uv pip install -U peft transformers accelerate
9495
fi
9596
9697
- name: Environment
9798
run: |
99+
python -m venv /opt/venv && export PATH="/opt/venv/bin:$PATH"
98100
python utils/print_env.py
99101
100102
- name: Run fast PyTorch LoRA CPU tests with PEFT backend
101103
run: |
104+
python -m venv /opt/venv && export PATH="/opt/venv/bin:$PATH"
102105
python -m pytest -n 1 --max-worker-restart=0 --dist=loadfile \
103106
-s -v \
104107
--make-reports=tests_${{ matrix.config.report }} \

.github/workflows/pr_tests.yml

+13-4
Original file line numberDiff line numberDiff line change
@@ -111,16 +111,19 @@ jobs:
111111
- name: Install dependencies
112112
run: |
113113
apt-get update && apt-get install libsndfile1-dev libgl1 -y
114-
python -m pip install -e .[quality,test]
115-
python -m pip install accelerate
114+
python -m venv /opt/venv && export PATH="/opt/venv/bin:$PATH"
115+
python -m uv pip install -e [quality,test]
116+
python -m uv pip install accelerate
116117
117118
- name: Environment
118119
run: |
120+
python -m venv /opt/venv && export PATH="/opt/venv/bin:$PATH"
119121
python utils/print_env.py
120122
121123
- name: Run fast PyTorch Pipeline CPU tests
122124
if: ${{ matrix.config.framework == 'pytorch_pipelines' }}
123125
run: |
126+
python -m venv /opt/venv && export PATH="/opt/venv/bin:$PATH"
124127
python -m pytest -n 2 --max-worker-restart=0 --dist=loadfile \
125128
-s -v -k "not Flax and not Onnx" \
126129
--make-reports=tests_${{ matrix.config.report }} \
@@ -129,6 +132,7 @@ jobs:
129132
- name: Run fast PyTorch Model Scheduler CPU tests
130133
if: ${{ matrix.config.framework == 'pytorch_models' }}
131134
run: |
135+
python -m venv /opt/venv && export PATH="/opt/venv/bin:$PATH"
132136
python -m pytest -n 2 --max-worker-restart=0 --dist=loadfile \
133137
-s -v -k "not Flax and not Onnx and not Dependency" \
134138
--make-reports=tests_${{ matrix.config.report }} \
@@ -137,6 +141,7 @@ jobs:
137141
- name: Run fast Flax TPU tests
138142
if: ${{ matrix.config.framework == 'flax' }}
139143
run: |
144+
python -m venv /opt/venv && export PATH="/opt/venv/bin:$PATH"
140145
python -m pytest -n 2 --max-worker-restart=0 --dist=loadfile \
141146
-s -v -k "Flax" \
142147
--make-reports=tests_${{ matrix.config.report }} \
@@ -145,7 +150,8 @@ jobs:
145150
- name: Run example PyTorch CPU tests
146151
if: ${{ matrix.config.framework == 'pytorch_examples' }}
147152
run: |
148-
python -m pip install peft
153+
python -m venv /opt/venv && export PATH="/opt/venv/bin:$PATH"
154+
python -m uv pip install peft
149155
python -m pytest -n 2 --max-worker-restart=0 --dist=loadfile \
150156
--make-reports=tests_${{ matrix.config.report }} \
151157
examples
@@ -194,15 +200,18 @@ jobs:
194200
- name: Install dependencies
195201
run: |
196202
apt-get update && apt-get install libsndfile1-dev libgl1 -y
197-
python -m pip install -e .[quality,test]
203+
python -m venv /opt/venv && export PATH="/opt/venv/bin:$PATH"
204+
python -m uv pip install -e [quality,test]
198205
199206
- name: Environment
200207
run: |
208+
python -m venv /opt/venv && export PATH="/opt/venv/bin:$PATH"
201209
python utils/print_env.py
202210
203211
- name: Run Hub tests for models, schedulers, and pipelines on a staging env
204212
if: ${{ matrix.config.framework == 'hub_tests_pytorch' }}
205213
run: |
214+
python -m venv /opt/venv && export PATH="/opt/venv/bin:$PATH"
206215
HUGGINGFACE_CO_STAGING=true python -m pytest \
207216
-m "is_staging_test" \
208217
--make-reports=tests_${{ matrix.config.report }} \

.github/workflows/pr_torch_dependency_test.yml

+6-4
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,12 @@ jobs:
2525
python-version: "3.8"
2626
- name: Install dependencies
2727
run: |
28-
python -m pip install --upgrade pip
29-
pip install -e .
30-
pip install torch torchvision torchaudio
31-
pip install pytest
28+
python -m venv /opt/venv && export PATH="/opt/venv/bin:$PATH"
29+
python -m pip install --upgrade pip uv
30+
python -m uv pip install -e .
31+
python -m uv pip install torch torchvision torchaudio
32+
python -m uv pip install pytest
3233
- name: Check for soft dependencies
3334
run: |
35+
python -m venv /opt/venv && export PATH="/opt/venv/bin:$PATH"
3436
pytest tests/others/test_dependencies.py

0 commit comments

Comments
 (0)