-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3bc2cdf
commit 8aa4568
Showing
8 changed files
with
85 additions
and
85 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,16 @@ | ||
name: GPU benchmarks | ||
name: GPU benchmark on `master` | ||
on: | ||
workflow_dispatch: | ||
release: | ||
types: [published] | ||
push: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
# TODO: Account for different `justfile` and `bench.env` files | ||
# One option is to upload them to gh-pages for qualitative comparison | ||
# TODO: Fall back to a default if `justfile`/`bench.env` not present | ||
benchmark: | ||
name: Bench and deploy | ||
runs-on: [self-hosted, gpu-bench-t4] | ||
runs-on: [self-hosted, gpu-bench, gh-pages] | ||
steps: | ||
# Install deps | ||
- uses: actions/checkout@v4 | ||
|
@@ -16,14 +19,12 @@ jobs: | |
- uses: taiki-e/install-action@v2 | ||
with: | ||
tool: [email protected] | ||
|
||
# Set up GPU | ||
# Check we have access to the machine's Nvidia drivers | ||
- run: nvidia-smi | ||
# Check that CUDA is installed with a driver-compatible version | ||
# This must also be compatible with the GPU architecture, see above link | ||
- run: nvcc --version | ||
|
||
# Run benchmarks and deploy | ||
- name: Get old benchmarks | ||
uses: actions/checkout@v4 | ||
|
@@ -34,21 +35,25 @@ jobs: | |
- name: Install criterion | ||
run: cargo install cargo-criterion | ||
- name: Run benchmarks | ||
run: just --dotenv-filename bench.env gpu-bench fibonacci | ||
run: just --dotenv-filename bench.env gpu-bench fibonacci_lem | ||
# TODO: Prettify labels for easier viewing | ||
# Compress the benchmark file and metadata for later analysis | ||
- name: Compress artifacts | ||
run: tar -cvzf ${{ github.sha }}.tar.gz Cargo.lock ${{ github.sha }}.json | ||
run: | | ||
echo $LABELS > labels.md | ||
tar -cvzf ${{ github.sha }}.tar.gz Cargo.lock ${{ github.sha }}.json labels.md | ||
- name: Deploy latest benchmark report | ||
uses: peaceiris/actions-gh-pages@v3 | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
publish_dir: ./target/criterion | ||
destination_dir: benchmarks/criterion | ||
- name: Move benchmark json to history | ||
- name: Copy benchmark json to history | ||
run: mkdir history; cp ${{ github.sha }}.tar.gz history/ | ||
- name: Deploy benchmark history | ||
uses: peaceiris/actions-gh-pages@v3 | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
publish_dir: history/ | ||
destination_dir: benchmarks/history | ||
keep_files: true | ||
keep_files: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,8 +6,6 @@ on: | |
types: [opened, synchronize, reopened, ready_for_review] | ||
branches: [master] | ||
merge_group: | ||
# Manual trigger for early signal on local branches | ||
workflow_dispatch: | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | ||
|
@@ -67,56 +65,51 @@ jobs: | |
cargo nextest run --profile ci --workspace --cargo-profile dev-no-assertions -E 'test(circuit::gadgets)' | ||
# TODO: Make this a required status check | ||
# TODO: Cache successful bench run from PR branch on master, keyed on commit hash | ||
# Run comparative benchmark against master | ||
# Run comparative benchmark against master, reject on regression | ||
gpu-benchmark: | ||
# [TEMPORARY] Test one run before attempting merge | ||
#if: github.event_name != 'pull_request' || github.event.action == 'enqueued' | ||
if: github.event_name != 'pull_request' || github.event.action == 'enqueued' | ||
name: Run fibonacci bench on GPU | ||
runs-on: [self-hosted, gpu-bench-t4] | ||
runs-on: [self-hosted, gpu-bench] | ||
steps: | ||
# TODO: Factor this out into an action or into justfile, it's used in 4 places | ||
# TODO: Factor out GPU setup into an action or into justfile, it's used in 4 places | ||
# Set up GPU | ||
# Check we have access to the machine's Nvidia drivers | ||
- run: nvidia-smi | ||
# Check that CUDA is installed with a driver-compatible version | ||
# This must also be compatible with the GPU architecture, see above link | ||
- run: nvcc --version | ||
- uses: actions/checkout@v4 | ||
# Checkout base branch for comparative bench | ||
- uses: actions/checkout@v4 | ||
with: | ||
ref: master | ||
- run: ls -a | ||
- name: Set base ref variable | ||
run: echo "BASE_REF=$(git rev-parse HEAD)" >> $GITHUB_ENV | ||
# Checkout the justfile and env of the source branch so the base can bench | ||
- run: git restore --source ${{ github.sha }} justfile bench.env | ||
- run: ls -a | ||
# Install dependencies | ||
- uses: actions-rs/toolchain@v1 | ||
- uses: Swatinem/rust-cache@v2 | ||
- uses: taiki-e/install-action@v2 | ||
with: | ||
tool: just@1 | ||
# Run benchmark on base branch | ||
tool: [email protected] | ||
- name: Install criterion | ||
run: | | ||
cargo install cargo-criterion | ||
cargo install criterion-table | ||
- name: Run GPU bench | ||
run: just --dotenv-filename bench.env gpu-bench fibonacci | ||
# Switch to triggering branch and run benchmark | ||
- run: rm justfile bench.env | ||
# Checkout base branch for comparative bench | ||
- uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ github.sha }} | ||
- name: Run GPU bench on source branch | ||
run: just --dotenv-filename bench.env gpu-bench fibonacci | ||
# Create a comparative `criterion-table` and write in commit comment | ||
ref: master | ||
path: master | ||
# Copy the script so the base can bench with the same parameters | ||
- name: Copy source script to base branch | ||
run: cd benches && cp justfile bench.env ../master/benches | ||
- name: Set base ref variable | ||
run: cd master && echo "BASE_REF=$(git rev-parse HEAD)" >> $GITHUB_ENV | ||
- run: echo ${{ env.BASE_REF }} | ||
- name: Run GPU bench on base branch | ||
run: cd master/benches && just --dotenv-filename bench.env gpu-bench fibonacci_lem | ||
- name: Copy bench output to PR branch | ||
run: cp master/${{ env.BASE_REF }}.json . | ||
- name: Run GPU bench on PR branch | ||
run: cd benches && just --dotenv-filename bench.env gpu-bench fibonacci_lem | ||
# Create a `criterion-table` and write in commit comment | ||
- name: Run `criterion-table` | ||
run: cat ${{ env.BASE_REF }}.json ${{ github.sha }}.json | criterion-table > BENCHMARKS.md | ||
- name: Write comparative bench on commit comment | ||
run: cat ${{ github.sha }}.json | criterion-table > BENCHMARKS.md | ||
- name: Write bench on commit comment | ||
uses: peter-evans/commit-comment@v3 | ||
with: | ||
body-path: BENCHMARKS.md | ||
|
@@ -132,3 +125,4 @@ jobs: | |
with: | ||
script: | | ||
core.setFailed('Fibonacci bench regression detected') | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
# Lurk config | ||
LURK_PERF=max-parallel-simple | ||
LURK_RC=100,600 | ||
LURK_BENCH_NOISE_THRESHOLD=0.10 | ||
LURK_BENCH_NOISE_THRESHOLD=0.05 | ||
|
||
# CUDA config | ||
NVIDIA_VISIBLE_DEVICES=all | ||
NVIDIA_DRIVER_CAPABILITITES=compute,utility | ||
EC_GPU_FRAMEWORK=cuda | ||
EC_GPU_FRAMEWORK=cuda |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters