From a1e65e3ac8fe7d729d189a0bb753ddc9ac13ac25 Mon Sep 17 00:00:00 2001 From: Samuel Burnham <45365069+samuelburnham@users.noreply.github.com> Date: Tue, 31 Oct 2023 15:52:59 -0400 Subject: [PATCH] Fix bugs in #790 --- .github/workflows/bench-deploy.yml | 2 +- .github/workflows/merge-tests.yml | 18 +++++++++++------- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/.github/workflows/bench-deploy.yml b/.github/workflows/bench-deploy.yml index 85108420e8..13f443594d 100644 --- a/.github/workflows/bench-deploy.yml +++ b/.github/workflows/bench-deploy.yml @@ -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 diff --git a/.github/workflows/merge-tests.yml b/.github/workflows/merge-tests.yml index bfd358b8e6..292ac6173f 100644 --- a/.github/workflows/merge-tests.yml +++ b/.github/workflows/merge-tests.yml @@ -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: @@ -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')