Skip to content

Commit 224471b

Browse files
authored
Merge branch 'main' into controlnet_num_train_epochs_patch
2 parents 6a7b80e + 1d9a6a8 commit 224471b

File tree

570 files changed

+30071
-9516
lines changed

Some content is hidden

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

570 files changed

+30071
-9516
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: 10 additions & 22 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
@@ -90,24 +91,11 @@ jobs:
9091

9192
- name: Post to a Slack channel
9293
id: slack
93-
uses: slackapi/slack-github-action@6c661ce58804a1a20f6dc5fbee7f0381b469e001
94+
uses: huggingface/hf-workflows/.github/actions/post-slack@main
9495
with:
9596
# Slack channel id, channel name, or user id to post message.
9697
# See also: https://api.slack.com/methods/chat.postMessage#channels
97-
channel-id: ${{ env.CI_SLACK_CHANNEL }}
98-
# For posting a rich message using Block Kit
99-
payload: |
100-
{
101-
"text": "${{ matrix.image-name }} Docker Image build result: ${{ job.status }}\n${{ github.event.head_commit.url }}",
102-
"blocks": [
103-
{
104-
"type": "section",
105-
"text": {
106-
"type": "mrkdwn",
107-
"text": "${{ matrix.image-name }} Docker Image build result: ${{ job.status }}\n${{ github.event.head_commit.url }}"
108-
}
109-
}
110-
]
111-
}
112-
env:
113-
SLACK_BOT_TOKEN: ${{ secrets.SLACK_CIFEEDBACK_BOT_TOKEN }}
98+
slack_channel: ${{ env.CI_SLACK_CHANNEL }}
99+
title: "🤗 Results of the ${{ matrix.image-name }} Docker Image build"
100+
status: ${{ job.status }}
101+
slack_token: ${{ secrets.SLACK_CIFEEDBACK_BOT_TOKEN }}

.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
Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
name: Mirror Community Pipeline
2+
3+
on:
4+
# Push changes on the main branch
5+
push:
6+
branches:
7+
- main
8+
paths:
9+
- 'examples/community/**.py'
10+
11+
# And on tag creation (e.g. `v0.28.1`)
12+
tags:
13+
- '*'
14+
15+
# Manual trigger with ref input
16+
workflow_dispatch:
17+
inputs:
18+
ref:
19+
description: "Either 'main' or a tag ref"
20+
required: true
21+
default: 'main'
22+
23+
jobs:
24+
mirror_community_pipeline:
25+
runs-on: ubuntu-latest
26+
steps:
27+
# Checkout to correct ref
28+
# If workflow dispatch
29+
# If ref is 'main', set:
30+
# CHECKOUT_REF=refs/heads/main
31+
# PATH_IN_REPO=main
32+
# Else it must be a tag. Set:
33+
# CHECKOUT_REF=refs/tags/{tag}
34+
# PATH_IN_REPO={tag}
35+
# If not workflow dispatch
36+
# If ref is 'refs/heads/main' => set 'main'
37+
# Else it must be a tag => set {tag}
38+
- name: Set checkout_ref and path_in_repo
39+
run: |
40+
if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then
41+
if [ -z "${{ github.event.inputs.ref }}" ]; then
42+
echo "Error: Missing ref input"
43+
exit 1
44+
elif [ "${{ github.event.inputs.ref }}" == "main" ]; then
45+
echo "CHECKOUT_REF=refs/heads/main" >> $GITHUB_ENV
46+
echo "PATH_IN_REPO=main" >> $GITHUB_ENV
47+
else
48+
echo "CHECKOUT_REF=refs/tags/${{ github.event.inputs.ref }}" >> $GITHUB_ENV
49+
echo "PATH_IN_REPO=${{ github.event.inputs.ref }}" >> $GITHUB_ENV
50+
fi
51+
elif [ "${{ github.ref }}" == "refs/heads/main" ]; then
52+
echo "CHECKOUT_REF=${{ github.ref }}" >> $GITHUB_ENV
53+
echo "PATH_IN_REPO=main" >> $GITHUB_ENV
54+
else
55+
# e.g. refs/tags/v0.28.1 -> v0.28.1
56+
echo "CHECKOUT_REF=${{ github.ref }}" >> $GITHUB_ENV
57+
echo "PATH_IN_REPO=${${{ github.ref }}#refs/tags/}" >> $GITHUB_ENV
58+
fi
59+
- name: Print env vars
60+
run: |
61+
echo "CHECKOUT_REF: ${{ env.CHECKOUT_REF }}"
62+
echo "PATH_IN_REPO: ${{ env.PATH_IN_REPO }}"
63+
- uses: actions/checkout@v3
64+
with:
65+
ref: ${{ env.CHECKOUT_REF }}
66+
67+
# Setup + install dependencies
68+
- name: Set up Python
69+
uses: actions/setup-python@v4
70+
with:
71+
python-version: "3.10"
72+
- name: Install dependencies
73+
run: |
74+
python -m pip install --upgrade pip
75+
pip install --upgrade huggingface_hub
76+
77+
# Check secret is set
78+
- name: whoami
79+
run: huggingface-cli whoami
80+
env:
81+
HF_TOKEN: ${{ secrets.HF_TOKEN_MIRROR_COMMUNITY_PIPELINES }}
82+
83+
# Push to HF! (under subfolder based on checkout ref)
84+
# https://huggingface.co/datasets/diffusers/community-pipelines-mirror
85+
- name: Mirror community pipeline to HF
86+
run: huggingface-cli upload diffusers/community-pipelines-mirror ./examples/community ${PATH_IN_REPO} --repo-type dataset
87+
env:
88+
PATH_IN_REPO: ${{ env.PATH_IN_REPO }}
89+
HF_TOKEN: ${{ secrets.HF_TOKEN_MIRROR_COMMUNITY_PIPELINES }}

.github/workflows/nightly_tests.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ jobs:
5959
runs-on: [single-gpu, nvidia-gpu, t4, ci]
6060
container:
6161
image: diffusers/diffusers-pytorch-cuda
62-
options: --shm-size "16gb" --ipc host -v /mnt/hf_cache:/mnt/cache/ --gpus 0
62+
options: --shm-size "16gb" --ipc host -v /mnt/cache/.cache/huggingface/diffusers:/mnt/cache/ --gpus 0
6363
steps:
6464
- name: Checkout diffusers
6565
uses: actions/checkout@v3
@@ -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/pr_test_peft_backend.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,3 +111,21 @@ jobs:
111111
-s -v \
112112
--make-reports=tests_${{ matrix.config.report }} \
113113
tests/lora/
114+
python -m pytest -n 4 --max-worker-restart=0 --dist=loadfile \
115+
-s -v \
116+
--make-reports=tests_models_lora_${{ matrix.config.report }} \
117+
tests/models/ -k "lora"
118+
119+
120+
- name: Failure short reports
121+
if: ${{ failure() }}
122+
run: |
123+
cat reports/tests_${{ matrix.config.report }}_failures_short.txt
124+
cat reports/tests_models_lora_${{ matrix.config.report }}_failures_short.txt
125+
126+
- name: Test suite reports artifacts
127+
if: ${{ always() }}
128+
uses: actions/upload-artifact@v2
129+
with:
130+
name: pr_${{ matrix.config.report }}_test_reports
131+
path: reports

.github/workflows/pr_tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ jobs:
156156
if: ${{ matrix.config.framework == 'pytorch_examples' }}
157157
run: |
158158
python -m venv /opt/venv && export PATH="/opt/venv/bin:$PATH"
159-
python -m uv pip install peft
159+
python -m uv pip install peft timm
160160
python -m pytest -n 4 --max-worker-restart=0 --dist=loadfile \
161161
--make-reports=tests_${{ matrix.config.report }} \
162162
examples

0 commit comments

Comments
 (0)