Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 21 additions & 10 deletions .github/workflows/benchmarks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,30 +65,34 @@ jobs:
benchmark:
if: github.event_name != 'pull_request'
needs: validate-report
name: ${{ matrix.device }} Pytest benchmark${{ matrix.python != '3.10.20' && format(' (Python {0})', matrix.python) || '' }}
name: ${{ matrix.device }} Pytest benchmark (Python ${{ matrix.python }}, CUDA ${{ matrix.cuda }})
runs-on: mt-l-x86aavx2-11-41-a10g
timeout-minutes: 120
strategy:
fail-fast: false
matrix:
# Pushes and manual async runs keep the existing Python 3.10 suite.
python: ${{ fromJSON((github.event_name == 'push' || inputs.suite == 'async') && '["3.10.20"]' || '["3.10.20","3.12.16"]') }}
cuda: ${{ fromJSON((github.event_name == 'push' || inputs.suite == 'async') && '["12.6"]' || '["12.6","13.2"]') }}
device: [CPU, GPU]
include:
- device: CPU
image: nvidia/cuda:12.6.3-cudnn-runtime-ubuntu22.04@sha256:5f0d2d827f6436b3cb7468fd8acbdc8c1d41261614e579ae49afe6141da51133
image-cu132: nvidia/cuda:13.2.1-cudnn-runtime-ubuntu22.04@sha256:1f6d3723d8650a1f34dd2df34fd70a3195ada805c332a99f08e0d961e9e96561
- device: GPU
image: nvidia/cuda:12.6.3-cudnn-devel-ubuntu22.04@sha256:b3e7fba84d169f46939f00c25be7d016f712a8d651f4756d6a55e693d84d94f2
image-cu132: nvidia/cuda:13.2.1-cudnn-devel-ubuntu22.04@sha256:29f08e1d33ee43759e1882a820f65ecffaead7a5b08994caeac177fe6041b6bb
defaults:
run:
shell: bash -l {0}
container:
image: ${{ matrix.image }}
image: ${{ matrix.cuda == '13.2' && matrix.image-cu132 || matrix.image }}
options: --gpus all --shm-size=8g
env:
MKL_NUM_THREADS: '1'
OMP_NUM_THREADS: '1'
BENCHMARK_PYTHON_VERSION: ${{ matrix.python }}
BENCHMARK_CUDA_VERSION: ${{ matrix.cuda }}
steps:
- name: Who triggered this?
run: |
Expand Down Expand Up @@ -204,11 +208,17 @@ jobs:
# deprecating the CUDA 12.6 benchmark job in favor of a newer CUDA.
# Install torchvision without dependencies, then honor its exact torch
# requirement. The matching torch wheel is no longer in the index.
python -m pip install --pre 'torchvision==0.30.0.dev20260906+cu126' --index-url https://download.pytorch.org/whl/nightly/cu126 --no-deps -U
cuda_tag="cu${BENCHMARK_CUDA_VERSION/./}"
if [ "$BENCHMARK_CUDA_VERSION" = 12.6 ]; then
python -m pip install --pre 'torchvision==0.30.0.dev20260906+cu126' --index-url https://download.pytorch.org/whl/nightly/cu126 --no-deps -U
else
# The matching CUDA 13.2 torchvision build has left the nightly index.
python -m pip install --no-deps "torchvision @ https://download-r2.pytorch.org/whl/nightly/${cuda_tag}/torchvision-0.30.0.dev20260906%2B${cuda_tag}-${torch_python_tag}-${torch_python_tag}-manylinux_2_28_x86_64.whl"
fi
python -c "import importlib.metadata; print('\n'.join(importlib.metadata.requires('torchvision')))" > /tmp/torchvision-requirements.txt
python -m pip install --pre -r /tmp/torchvision-requirements.txt \
"torch @ https://download-r2.pytorch.org/whl/nightly/cu126/torch-2.15.0.dev20260906%2Bcu126-${torch_python_tag}-${torch_python_tag}-manylinux_2_28_x86_64.whl" \
--index-url https://download.pytorch.org/whl/nightly/cu126 --extra-index-url https://pypi.org/simple
"torch @ https://download-r2.pytorch.org/whl/nightly/${cuda_tag}/torch-2.15.0.dev20260906%2B${cuda_tag}-${torch_python_tag}-${torch_python_tag}-manylinux_2_28_x86_64.whl" \
--index-url "https://download.pytorch.org/whl/nightly/${cuda_tag}" --extra-index-url https://pypi.org/simple
python -c "import importlib.metadata as m; print('torch==' + m.version('torch')); print('torchvision==' + m.version('torchvision'))" > /tmp/torch-constraints.txt
python -m pip install -c /tmp/torch-constraints.txt ninja pytest pytest-benchmark pytest-timeout "hoptorch>=0.1.4" "mujoco>=3.8.1,<3.9.0" "dm_control>=1.0.41" "${gym_requirements[@]}" transformers accelerate
python -m pip install -c /tmp/torch-constraints.txt "pybind11[global]"
Expand Down Expand Up @@ -290,7 +300,7 @@ jobs:
uses: actions/upload-artifact@v4
if: ${{ !cancelled() }}
with:
name: ${{ matrix.device }}-benchmark-results${{ matrix.python != '3.10.20' && format('-py{0}', matrix.python) || '' }}
name: ${{ matrix.device }}-benchmark-results${{ matrix.python != '3.10.20' && format('-py{0}', matrix.python) || '' }}${{ matrix.cuda != '12.6' && format('-cu{0}', matrix.cuda) || '' }}
path: |
benchmarks/*.json
benchmarks/dependencies.txt
Expand All @@ -302,7 +312,7 @@ jobs:
if-no-files-found: warn

benchmark-upload:
name: Publish ${{ matrix.device }} benchmark${{ matrix.python != '3.10.20' && format(' (Python {0})', matrix.python) || '' }}
name: Publish ${{ matrix.device }} benchmark (Python ${{ matrix.python }}, CUDA ${{ matrix.cuda }})
runs-on: ubuntu-latest
needs: benchmark
# One failed device must not suppress another device's successful history.
Expand All @@ -314,9 +324,10 @@ jobs:
max-parallel: 1
matrix:
python: ${{ fromJSON((github.event_name == 'push' || inputs.suite == 'async') && '["3.10.20"]' || '["3.10.20","3.12.16"]') }}
cuda: ${{ fromJSON((github.event_name == 'push' || inputs.suite == 'async') && '["12.6"]' || '["12.6","13.2"]') }}
device: [CPU, GPU]
env:
BENCHMARK_ARTIFACT: ${{ format('{0}-benchmark-results{1}', matrix.device, matrix.python != '3.10.20' && format('-py{0}', matrix.python) || '') }}
BENCHMARK_ARTIFACT: ${{ format('{0}-benchmark-results{1}{2}', matrix.device, matrix.python != '3.10.20' && format('-py{0}', matrix.python) || '', matrix.cuda != '12.6' && format('-cu{0}', matrix.cuda) || '') }}
steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -329,10 +340,10 @@ jobs:
if: ${{ !cancelled() && hashFiles(format('results/{0}/success.txt', env.BENCHMARK_ARTIFACT)) != '' }}
uses: benchmark-action/github-action-benchmark@v1
with:
name: ${{ env.BENCHMARK_SUITE == 'async' && format('Async {0} (v1)', matrix.device) || matrix.python == '3.10.20' && format('{0} Benchmark Results', matrix.device) || format('{0} Benchmark Results (Python {1})', matrix.device, matrix.python) }}
name: ${{ env.BENCHMARK_SUITE == 'async' && format('Async {0} (v1)', matrix.device) || matrix.cuda != '12.6' && format('{0} Benchmark Results (Python {1}, CUDA {2})', matrix.device, matrix.python, matrix.cuda) || matrix.python == '3.10.20' && format('{0} Benchmark Results', matrix.device) || format('{0} Benchmark Results (Python {1})', matrix.device, matrix.python) }}
tool: ${{ env.BENCHMARK_SUITE == 'async' && 'customBiggerIsBetter' || 'pytest' }}
output-file-path: ${{ format('results/{0}/{1}', env.BENCHMARK_ARTIFACT, env.BENCHMARK_SUITE == 'async' && 'trend.json' || 'output.json') }}
benchmark-data-dir-path: ${{ env.BENCHMARK_SUITE == 'async' && 'dev/bench/async' || matrix.python == '3.10.20' && 'dev/bench' || format('dev/bench/py{0}', matrix.python) }}
benchmark-data-dir-path: ${{ env.BENCHMARK_SUITE == 'async' && 'dev/bench/async' || matrix.cuda != '12.6' && format('dev/bench/cu{0}/py{1}', matrix.cuda, matrix.python) || matrix.python == '3.10.20' && 'dev/bench' || format('dev/bench/py{0}', matrix.python) }}
fail-on-alert: false
alert-threshold: '200%'
comment-on-alert: false
Expand Down
Loading