Skip to content

Commit

Permalink
[CI] Fix benchmark triggers (#1011)
Browse files Browse the repository at this point in the history
This fixes both `workflow_dispatch`, now with check-boxes instead of
integers and actually running correctly, as well as `pull_request` that
now doesn't need to remove/add the `benchmark` label every time you
update the PR.
  • Loading branch information
rengolin authored Feb 11, 2025
1 parent 32acfc9 commit bac688f
Showing 1 changed file with 36 additions and 28 deletions.
64 changes: 36 additions & 28 deletions .github/workflows/tpp-benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,20 @@ on:
inputs:
RUN_EMR_BENCH:
description: "Run on Emerald Rapids"
default: "1"
type: boolean
default: true
RUN_ZEN_BENCH:
description: "Run on Zen5"
default: "0"
type: boolean
default: true
RUN_CLX_BENCH:
description: "Run on CLX"
default: "0"
type: boolean
default: true
push:
branches:
- 'main'
pull_request:
types: [ labeled ]

env:
NPROCS_LIMIT_LINK: 8
Expand All @@ -25,18 +27,20 @@ env:

jobs:
Check_LLVM:
if: ${{ github.event_name }} == "push" || \
(${{ github.event_name }} == "pull_request" && ${{ github.event.label.name == 'benchmark' }}) || \
(${{ github.event_name }} == "pull_request" && ${{ github.event.label.name == 'benchmark-all' }})
if: |
(github.event_name == 'push') || (github.event_name == 'workflow_dispatch') ||
(github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'benchmark')) ||
(github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'benchmark-full'))
uses: ./.github/workflows/tpp-llvm.yml
secrets: inherit

TPP-MLIR-EMR-BASE:
runs-on: pcl-tiergarten
if: ${{ github.event_name }} == "push" || \
${{ inputs.RUN_EMR_BENCH }} == 1 || \
(${{ github.event_name }} == "pull_request" && ${{ github.event.label.name == 'benchmark' }}) || \
(${{ github.event_name }} == "pull_request" && ${{ github.event.label.name == 'benchmark-all' }})
if: |
(github.event_name == 'push') ||
(github.event_name == 'workflow_dispatch' && inputs.RUN_EMR_BENCH) ||
(github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'benchmark')) ||
(github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'benchmark-full'))
needs: Check_LLVM
steps:
- uses: actions/checkout@v4
Expand All @@ -48,10 +52,11 @@ jobs:
TPP-MLIR-EMR-OMP:
runs-on: pcl-tiergarten
if: ${{ github.event_name }} == "push" || \
${{ inputs.RUN_EMR_BENCH }} == 1 || \
(${{ github.event_name }} == "pull_request" && ${{ github.event.label.name == 'benchmark' }}) || \
(${{ github.event_name }} == "pull_request" && ${{ github.event.label.name == 'benchmark-all' }})
if: |
(github.event_name == 'push') ||
(github.event_name == 'workflow_dispatch' && inputs.RUN_EMR_BENCH) ||
(github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'benchmark')) ||
(github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'benchmark-full'))
needs: Check_LLVM
steps:
- uses: actions/checkout@v4
Expand All @@ -63,9 +68,10 @@ jobs:
TPP-MLIR-ZEN-BASE:
runs-on: pcl-tiergarten
if: ${{ github.event_name }} == "push" || \
${{ inputs.RUN_ZEN_BENCH }} == 1 || \
(${{ github.event_name }} == "pull_request" && ${{ github.event.label.name == 'benchmark-all' }})
if: |
(github.event_name == 'push') ||
(github.event_name == 'workflow_dispatch' && inputs.RUN_ZEN_BENCH) ||
(github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'benchmark-full'))
needs: Check_LLVM
steps:
- uses: actions/checkout@v4
Expand All @@ -77,9 +83,10 @@ jobs:
TPP-MLIR-ZEN-OMP:
runs-on: pcl-tiergarten
if: ${{ github.event_name }} == "push" || \
${{ inputs.RUN_ZEN_BENCH }} == 1 || \
(${{ github.event_name }} == "pull_request" && ${{ github.event.label.name == 'benchmark-all' }})
if: |
(github.event_name == 'push') ||
(github.event_name == 'workflow_dispatch' && inputs.RUN_ZEN_BENCH) ||
(github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'benchmark-full'))
needs: Check_LLVM
steps:
- uses: actions/checkout@v4
Expand All @@ -91,9 +98,10 @@ jobs:
TPP-MLIR-CLX-BASE:
runs-on: pcl-tiergarten
if: ${{ github.event_name }} == "push" || \
${{ inputs.RUN_CLX_BENCH }} == 1 || \
(${{ github.event_name }} == "pull_request" && ${{ github.event.label.name == 'benchmark-all' }})
if: |
(github.event_name == 'push') ||
(github.event_name == 'workflow_dispatch' && inputs.RUN_CLX_BENCH) ||
(github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'benchmark-full'))
needs: Check_LLVM
steps:
- uses: actions/checkout@v4
Expand All @@ -105,9 +113,10 @@ jobs:
TPP-MLIR-CLX-OMP:
runs-on: pcl-tiergarten
if: ${{ github.event_name }} == "push" || \
${{ inputs.RUN_CLX_BENCH }} == 1 || \
(${{ github.event_name }} == "pull_request" && ${{ github.event.label.name == 'benchmark-all' }})
if: |
(github.event_name == 'push') ||
(github.event_name == 'workflow_dispatch' && inputs.RUN_CLX_BENCH) ||
(github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'benchmark-full'))
needs: Check_LLVM
steps:
- uses: actions/checkout@v4
Expand All @@ -116,4 +125,3 @@ jobs:
CMD="KIND=Release COMPILER=clang LINKER=lld BENCHMARK_NUM_ITER=${{ env.NUM_ITER }} \
${{ github.workspace }}/scripts/github/benchmark.sh -o"
${{ env.SRUN }} --partition=clxap --time=0:30:00 -- $CMD

0 comments on commit bac688f

Please sign in to comment.