Skip to content

Commit ad6322a

Browse files
authored
Merge branch 'main' into integrations/first-block-cache-2
2 parents 5ac3d64 + 15d50f1 commit ad6322a

File tree

1,222 files changed

+25175
-6376
lines changed

Some content is hidden

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

1,222 files changed

+25175
-6376
lines changed

.github/workflows/benchmark.yml

Lines changed: 32 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,20 @@ env:
1111
HF_HOME: /mnt/cache
1212
OMP_NUM_THREADS: 8
1313
MKL_NUM_THREADS: 8
14+
BASE_PATH: benchmark_outputs
1415

1516
jobs:
16-
torch_pipelines_cuda_benchmark_tests:
17+
torch_models_cuda_benchmark_tests:
1718
env:
1819
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL_BENCHMARK }}
19-
name: Torch Core Pipelines CUDA Benchmarking Tests
20+
name: Torch Core Models CUDA Benchmarking Tests
2021
strategy:
2122
fail-fast: false
2223
max-parallel: 1
2324
runs-on:
24-
group: aws-g6-4xlarge-plus
25+
group: aws-g6e-4xlarge
2526
container:
26-
image: diffusers/diffusers-pytorch-compile-cuda
27+
image: diffusers/diffusers-pytorch-cuda
2728
options: --shm-size "16gb" --ipc host --gpus 0
2829
steps:
2930
- name: Checkout diffusers
@@ -35,27 +36,47 @@ jobs:
3536
nvidia-smi
3637
- name: Install dependencies
3738
run: |
39+
apt update
40+
apt install -y libpq-dev postgresql-client
3841
python -m venv /opt/venv && export PATH="/opt/venv/bin:$PATH"
3942
python -m uv pip install -e [quality,test]
40-
python -m uv pip install pandas peft
41-
python -m uv pip uninstall transformers && python -m uv pip install transformers==4.48.0
43+
python -m uv pip install -r benchmarks/requirements.txt
4244
- name: Environment
4345
run: |
4446
python utils/print_env.py
4547
- name: Diffusers Benchmarking
4648
env:
47-
HF_TOKEN: ${{ secrets.DIFFUSERS_BOT_TOKEN }}
48-
BASE_PATH: benchmark_outputs
49+
HF_TOKEN: ${{ secrets.DIFFUSERS_HF_HUB_READ_TOKEN }}
4950
run: |
50-
export TOTAL_GPU_MEMORY=$(python -c "import torch; print(torch.cuda.get_device_properties(0).total_memory / (1024**3))")
51-
cd benchmarks && mkdir ${BASE_PATH} && python run_all.py && python push_results.py
51+
cd benchmarks && python run_all.py
52+
53+
- name: Push results to the Hub
54+
env:
55+
HF_TOKEN: ${{ secrets.DIFFUSERS_BOT_TOKEN }}
56+
run: |
57+
cd benchmarks && python push_results.py
58+
mkdir $BASE_PATH && cp *.csv $BASE_PATH
5259
5360
- name: Test suite reports artifacts
5461
if: ${{ always() }}
5562
uses: actions/upload-artifact@v4
5663
with:
5764
name: benchmark_test_reports
58-
path: benchmarks/benchmark_outputs
65+
path: benchmarks/${{ env.BASE_PATH }}
66+
67+
# TODO: enable this once the connection problem has been resolved.
68+
- name: Update benchmarking results to DB
69+
env:
70+
PGDATABASE: metrics
71+
PGHOST: ${{ secrets.DIFFUSERS_BENCHMARKS_PGHOST }}
72+
PGUSER: transformers_benchmarks
73+
PGPASSWORD: ${{ secrets.DIFFUSERS_BENCHMARKS_PGPASSWORD }}
74+
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
75+
run: |
76+
git config --global --add safe.directory /__w/diffusers/diffusers
77+
commit_id=$GITHUB_SHA
78+
commit_msg=$(git show -s --format=%s "$commit_id" | cut -c1-70)
79+
cd benchmarks && python populate_into_db.py "$BRANCH_NAME" "$commit_id" "$commit_msg"
5980
6081
- name: Report success status
6182
if: ${{ success() }}

.github/workflows/build_docker_images.yml

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,16 @@ jobs:
3838
token: ${{ secrets.GITHUB_TOKEN }}
3939

4040
- name: Build Changed Docker Images
41+
env:
42+
CHANGED_FILES: ${{ steps.file_changes.outputs.all }}
4143
run: |
42-
CHANGED_FILES="${{ steps.file_changes.outputs.all }}"
43-
for FILE in $CHANGED_FILES; do
44+
echo "$CHANGED_FILES"
45+
for FILE in $CHANGED_FILES; do
46+
# skip anything that isn't still on disk
47+
if [[ ! -f "$FILE" ]]; then
48+
echo "Skipping removed file $FILE"
49+
continue
50+
fi
4451
if [[ "$FILE" == docker/*Dockerfile ]]; then
4552
DOCKER_PATH="${FILE%/Dockerfile}"
4653
DOCKER_TAG=$(basename "$DOCKER_PATH")
@@ -65,13 +72,9 @@ jobs:
6572
image-name:
6673
- diffusers-pytorch-cpu
6774
- diffusers-pytorch-cuda
68-
- diffusers-pytorch-compile-cuda
75+
- diffusers-pytorch-cuda
6976
- diffusers-pytorch-xformers-cuda
7077
- diffusers-pytorch-minimum-cuda
71-
- diffusers-flax-cpu
72-
- diffusers-flax-tpu
73-
- diffusers-onnxruntime-cpu
74-
- diffusers-onnxruntime-cuda
7578
- diffusers-doc-builder
7679

7780
steps:

0 commit comments

Comments
 (0)