1111 HF_HOME : /mnt/cache
1212 OMP_NUM_THREADS : 8
1313 MKL_NUM_THREADS : 8
14+ BASE_PATH : benchmark_outputs
1415
1516jobs :
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- options : --shm-size "16gb" --ipc host --gpus 0
27+ image : diffusers/diffusers-pytorch-cuda
28+ options : --shm-size "16gb" --ipc host --gpus all
2829 steps :
2930 - name : Checkout diffusers
3031 uses : actions/checkout@v3
@@ -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() }}
0 commit comments