Skip to content

Commit

Permalink
Fix bugs in #790
Browse files Browse the repository at this point in the history
  • Loading branch information
samuelburnham committed Oct 31, 2023
1 parent ab4ff04 commit a1e65e3
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/bench-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
- name: Install criterion
run: cargo install cargo-criterion
- name: Run benchmarks
run: just --dotenv-filename bench.env gpu-bench fibonacci_lem
run: cd benches && 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
Expand Down
18 changes: 11 additions & 7 deletions .github/workflows/merge-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ jobs:
# TODO: Make this a required status check
# Run comparative benchmark against master, reject on regression
gpu-benchmark:
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]
steps:
Expand Down Expand Up @@ -103,25 +103,29 @@ jobs:
- 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 .
run: |
mkdir -p target
cp -r master/target/criterion target
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 ${{ github.sha }}.json | criterion-table > BENCHMARKS.md
- name: Write bench on commit comment
uses: peter-evans/commit-comment@v3
with:
body-path: BENCHMARKS.md
#- name: Write bench on commit comment
# uses: peter-evans/commit-comment@v3
# with:
# body-path: BENCHMARKS.md
# TODO: Use jq for JSON parsing if needed
# Check for benchmark regression based on Criterion's configured noise threshold
- name: Performance regression check
id: check-regression
run: |
echo $(grep -c 'Regressed' ${{ github.sha }}.json)
echo "regress_count=$(grep -c 'Regressed' ${{ github.sha }}.json)" >> $GITHUB_OUTPUT
# Fail job if regression found
- uses: actions/github-script@v6
if: ${{ steps.check-regression.outputs.regress_count }} > 0
if: ${{ steps.check-regression.outputs.regress_count > 0 }}
with:
script: |
core.setFailed('Fibonacci bench regression detected')
Expand Down

0 comments on commit a1e65e3

Please sign in to comment.