-
Notifications
You must be signed in to change notification settings - Fork 3
49 lines (49 loc) · 1.66 KB
/
benchmark-pr.yml
File metadata and controls
49 lines (49 loc) · 1.66 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
---
name: benchmark-pr
concurrency:
group: gpu-benchmarks-${{ github.head_ref || github.ref_name }}
cancel-in-progress: true
on:
pull_request:
branches:
- '**'
workflow_dispatch: null
jobs:
run-benchmarks:
name: Run benchmarks on GPU and make PR comment
timeout-minutes: 14400 # 10 days (max is 35790 for self-hosted)
if: >-
github.event_name == 'workflow_dispatch'
|| github.event.pull_request.head.repo.full_name == github.repository
runs-on:
- self-hosted
- gpu-benchmark
steps:
- name: Wait for GPU to be free
run: |
echo "Waiting for GPU to be free..."
while nvidia-smi --query-compute-apps=process_name --format=csv,noheader \
| grep -qi python; do
echo "$(date): GPU in use by Python process, retrying in 60s..."
sleep 60
done
echo "GPU is free."
- uses: actions/checkout@v6
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0
- name: Ensure main ref exists
run: git fetch origin main:main || true
- name: Install environment
run: pixi install -e benchmarks-cuda12
- name: Regenerate _version.py
run: >-
echo "__version__ = '$(git describe --tags --always)'"
> src/lcm/_version.py
- name: Setup ASV machine
run: pixi run -e benchmarks-cuda12 asv machine --yes
- name: Run benchmarks and post PR comment
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_PR_NUMBER: ${{ github.event.pull_request.number }}
run: pixi run -e benchmarks-cuda12 asv-run-and-pr-comment