Skip to content

Commit

Permalink
CI: restirct EC2 benchmarking to one instance
Browse files Browse the repository at this point in the history
Signed-off-by: Matthias J. Kannwischer <[email protected]>
  • Loading branch information
mkannwischer committed Nov 21, 2024
1 parent ea73f6b commit 7f47c48
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 2 deletions.
11 changes: 9 additions & 2 deletions .github/workflows/bench.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,54 +64,61 @@ jobs:
opt:
- name: opt
value: true
- name: no_opt
value: false
target:
- name: Graviton2
ec2_instance_type: t4g.small
ec2_ami: ubuntu-latest (aarch64)
archflags: -mcpu=cortex-a76 -march=armv8.2-a
cflags: "-flto -DFORCE_AARCH64"
perf: PERF
matrix_lock_id: 1
- name: Graviton3
ec2_instance_type: c7g.medium
ec2_ami: ubuntu-latest (aarch64)
archflags: -march=armv8.4-a+sha3
cflags: "-flto -DFORCE_AARCH64"
perf: PERF
matrix_lock_id: 2
- name: Graviton4
ec2_instance_type: c8g.medium
ec2_ami: ubuntu-latest (aarch64)
archflags: -march=armv9-a+sha3
cflags: "-flto -DFORCE_AARCH64"
perf: PERF
matrix_lock_id: 3
- name: AMD EPYC 4th gen (c7a)
ec2_instance_type: c7a.medium
ec2_ami: ubuntu-latest (x86_64)
archflags: -mavx2 -mbmi2 -mpopcnt -maes
cflags: "-flto -DFORCE_X86_64"
perf: PMU
matrix_lock_id: 4
- name: Intel Xeon 4th gen (c7i)
ec2_instance_type: c7i.large
ec2_ami: ubuntu-latest (x86_64)
archflags: -mavx2 -mbmi2 -mpopcnt -maes
cflags: "-flto -DFORCE_X86_64"
perf: PMU
matrix_lock_id: 5
- name: AMD EPYC 3rd gen (c6a)
ec2_instance_type: c6a.large
ec2_ami: ubuntu-latest (x86_64)
archflags: -mavx2 -mbmi2 -mpopcnt -maes
cflags: "-flto -DFORCE_X86_64"
perf: PMU
matrix_lock_id: 6
- name: Intel Xeon 3rd gen (c6i)
ec2_instance_type: c6i.large
ec2_ami: ubuntu-latest (x86_64)
archflags: -mavx2 -mbmi2 -mpopcnt -maes
cflags: "-flto -DFORCE_X86_64"
perf: PMU
matrix_lock_id: 7
uses: ./.github/workflows/bench_ec2_reusable.yml
if: github.repository_owner == 'pq-code-package' && (github.event.label.name == 'benchmark' || github.ref == 'refs/heads/main')
with:
matrix_lock: "1,2,3,4,5,6,7"
matrix_lock_id: ${{ matrix.target.matrix_lock_id }}
ec2_instance_type: ${{ matrix.target.ec2_instance_type }}
ec2_ami: ${{ matrix.target.ec2_ami }}
archflags: ${{ matrix.target.archflags }}
Expand Down
25 changes: 25 additions & 0 deletions .github/workflows/bench_ec2_reusable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,14 @@ on:
type: string
description: Additional packages to install when custom compiler is used.
default: ''
matrix_lock:
type: string
description: ''
default: ''
matrix_lock_id:
type: string
description: ''
default: ''
env:
AWS_ROLE: arn:aws:iam::559050233797:role/mlkem-c-aarch64-gh-action
AWS_REGION: us-east-1
Expand All @@ -77,6 +85,18 @@ jobs:
label: ${{ steps.start-ec2-runner.outputs.label }}
ec2-instance-id: ${{ steps.start-ec2-runner.outputs.ec2-instance-id }}
steps:
- name: "Initialize matrix lock"
if: ${{ inputs.matrix_lock_id }} == 1
uses: rakles/matrix-lock@v1
with:
step: init
order: ${{ inputs.matrix_lock }}

- name: "Wait for matrix lock"
uses: rakles/matrix-lock@v1
with:
step: wait
id: ${{ inputs.matrix_lock_id }}
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Determine AMI ID
id: det_ami_id
Expand Down Expand Up @@ -180,3 +200,8 @@ jobs:
github-token: ${{ secrets.AWS_GITHUB_TOKEN }}
label: ${{ needs.start-ec2-runner.outputs.label }}
ec2-instance-id: ${{ needs.start-ec2-runner.outputs.ec2-instance-id }}
- name: "Continue matrix lock"
uses: rakles/matrix-lock@v1
with:
step: continue
id: ${{ inputs.matrix_lock_id }}

0 comments on commit 7f47c48

Please sign in to comment.