-
Notifications
You must be signed in to change notification settings - Fork 55
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
2f1c4a1
commit 9b2ed10
Showing
7 changed files
with
94 additions
and
20 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
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 |
---|---|---|
@@ -0,0 +1,70 @@ | ||
# Run `fibonacci` GPU benchmark on a given commit | ||
name: GPU benchmark on commit | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
label: | ||
description: "Git reference" | ||
required: true | ||
default: "master" | ||
|
||
env: | ||
CARGO_TERM_COLOR: always | ||
# Disable incremental compilation. | ||
# | ||
# Incremental compilation is useful as part of an edit-build-test-edit cycle, | ||
# as it lets the compiler avoid recompiling code that hasn't changed. However, | ||
# on CI, we're not making small edits; we're almost always building the entire | ||
# project from scratch. Thus, incremental compilation on CI actually | ||
# introduces *additional* overhead to support making future builds | ||
# faster...but no future builds will ever occur in any given CI environment. | ||
# | ||
# See https://matklad.github.io/2021/09/04/fast-rust-builds.html#ci-workflow | ||
# for details. | ||
CARGO_INCREMENTAL: 0 | ||
# Allow more retries for network requests in cargo (downloading crates) and | ||
# rustup (installing toolchains). This should help to reduce flaky CI failures | ||
# from transient network timeouts or other issues. | ||
CARGO_NET_RETRY: 10 | ||
RUSTUP_MAX_RETRIES: 10 | ||
# Don't emit giant backtraces in the CI logs. | ||
RUST_BACKTRACE: short | ||
RUSTFLAGS: -D warnings | ||
|
||
jobs: | ||
# TODO: Fall back to a default if `justfile`/`bench.env` not present | ||
gpu-benchmark: | ||
name: Run fibonacci bench on GPU | ||
runs-on: [self-hosted, gpu-bench] | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
ref: {{ inputs.label.description }} | ||
# 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 | ||
# Install dependencies | ||
- uses: actions-rs/toolchain@v1 | ||
- uses: Swatinem/rust-cache@v2 | ||
- uses: taiki-e/install-action@v2 | ||
with: | ||
tool: just@1.15 | ||
# Run benchmark | ||
- 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 | ||
# TODO: Create `tables.toml` to format/describe the .md file | ||
# Create a `criterion-table` and write to commit comment | ||
- name: Run `criterion-table` | ||
run: cat ${{ github.sha }}.json | criterion-table > BENCHMARKS.md | ||
- name: Write comparative bench on commit comment | ||
uses: peter-evans/commit-comment@v3 | ||
with: | ||
body-path: BENCHMARKS.md |
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
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