Debian Codegraph @

others/mbedtls/tf-psa-crypto/drivers/pqcp/mldsa-native/.github/workflows/bench.yml

raw symbols SCIP
1 # Copyright (c) The mlkem-native project authors
2 # Copyright (c) The mldsa-native project authors
3 # SPDX-License-Identifier: Apache-2.0 OR ISC OR MIT
4
5 name: Bench
6 on:
7 workflow_dispatch:
8 push:
9 branches: ["main"]
10 pull_request:
11 branches: ["main"]
12 types: [ "labeled" ]
13
14 concurrency:
15 group: ${{ github.workflow }}-${{ github.ref }}
16 cancel-in-progress: true
17
18 permissions:
19 contents: read
20 pull-requests: read
21
22 jobs:
23 bench:
24 permissions:
25 contents: write
26 pull-requests: write
27 name: ${{ matrix.target.name }}
28 strategy:
29 fail-fast: true
30 matrix:
31 target:
32 - system: rpi4
33 name: Arm Cortex-A72 (Raspberry Pi 4) benchmarks
34 bench_pmu: PMU
35 archflags: -mcpu=cortex-a72 -DMLD_SYS_AARCH64_SLOW_BARREL_SHIFTER
36 cflags: "-flto -DMLD_FORCE_AARCH64"
37 ldflags: "-flto"
38 bench_extra_args: ""
39 nix_shell: ci-bench
40 only_no_opt: false
41 - system: rpi5
42 name: Arm Cortex-A76 (Raspberry Pi 5) benchmarks
43 bench_pmu: PERF
44 archflags: "-mcpu=cortex-a76 -march=armv8.2-a"
45 cflags: "-flto -DMLD_FORCE_AARCH64"
46 ldflags: "-flto"
47 bench_extra_args: ""
48 nix_shell: ci-bench
49 only_no_opt: false
50 - system: a55
51 name: Arm Cortex-A55 (Snapdragon 888) benchmarks
52 bench_pmu: PERF
53 archflags: "-mcpu=cortex-a55 -march=armv8.2-a"
54 cflags: "-flto -DMLD_FORCE_AARCH64"
55 ldflags: "-flto -static"
56 bench_extra_args: -w exec-on-a55
57 nix_shell: ci-bench
58 only_no_opt: false
59 - system: bpi
60 name: SpacemiT K1 8 (Banana Pi F3) benchmarks
61 bench_pmu: PERF
62 archflags: "-march=rv64imafdcv_zicsr_zifencei"
63 cflags: ""
64 ldflags: "-static"
65 bench_extra_args: -w exec-on-bpi
66 cross_prefix: riscv64-unknown-linux-gnu-
67 nix_shell: ci-cross-riscv64
68 only_no_opt: true
69 - system: m1-mac-mini
70 name: Mac Mini (M1, 2020) benchmarks
71 bench_pmu: MAC
72 archflags: "-mcpu=apple-m1 -march=armv8.4-a+sha3"
73 cflags: "-flto"
74 ldflags: "-flto"
75 bench_extra_args: "-r"
76 nix_shell: ci-bench
77 only_no_opt: false
78 if: github.repository_owner == 'pq-code-package' && (github.event.label.name == 'benchmark' || github.ref == 'refs/heads/main')
79 runs-on: self-hosted-${{ matrix.target.system }}
80 steps:
81 - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
82 - uses: ./.github/actions/bench
83 if: ${{ !matrix.target.only_no_opt }}
84 with:
85 name: ${{ matrix.target.name }} (opt)
86 cflags: ${{ matrix.target.cflags }}
87 archflags: ${{ matrix.target.archflags }}
88 ldflags: ${{ matrix.target.ldflags }}
89 perf: ${{ matrix.target.bench_pmu }}
90 store_results: ${{ github.repository_owner == 'pq-code-package' && github.ref == 'refs/heads/main' }}
91 bench_extra_args: ${{ matrix.target.bench_extra_args }}
92 gh_token: ${{ secrets.GITHUB_TOKEN }}
93 nix-shell: ${{ matrix.target.nix_shell }}
94 cross_prefix: ${{ matrix.target.cross_prefix }}
95 opt: true
96 - uses: ./.github/actions/bench
97 with:
98 name: ${{ matrix.target.name }} (no-opt)
99 cflags: ${{ matrix.target.cflags }}
100 archflags: ${{ matrix.target.archflags }}
101 ldflags: ${{ matrix.target.ldflags }}
102 perf: ${{ matrix.target.bench_pmu }}
103 store_results: ${{ github.repository_owner == 'pq-code-package' && github.ref == 'refs/heads/main' }}
104 bench_extra_args: ${{ matrix.target.bench_extra_args }}
105 gh_token: ${{ secrets.GITHUB_TOKEN }}
106 nix-shell: ${{ matrix.target.nix_shell }}
107 cross_prefix: ${{ matrix.target.cross_prefix }}
108 opt: false
109
110 ec2_all:
111 name: ${{ matrix.target.name }} ${{ matrix.opt.name }}
112 permissions:
113 contents: write
114 pull-requests: write
115 id-token: write
116 strategy:
117 fail-fast: false
118 matrix:
119 target:
120 - name: Graviton2
121 ec2_instance_type: t4g.small
122 ec2_ami: ubuntu-latest (aarch64)
123 archflags: -mcpu=cortex-a76 -march=armv8.2-a
124 cflags: "-flto -DMLD_FORCE_AARCH64"
125 ldflags: "-flto"
126 perf: PERF
127 - name: Graviton3
128 ec2_instance_type: c7g.medium
129 ec2_ami: ubuntu-latest (aarch64)
130 archflags: -march=armv8.4-a+sha3
131 cflags: "-flto -DMLD_FORCE_AARCH64"
132 ldflags: "-flto"
133 perf: PERF
134 - name: Graviton4
135 ec2_instance_type: c8g.medium
136 ec2_ami: ubuntu-latest (aarch64)
137 archflags: -march=armv9-a+sha3
138 cflags: "-flto -DMLD_FORCE_AARCH64"
139 ldflags: "-flto"
140 perf: PERF
141 - name: AMD EPYC 4th gen (c7a)
142 ec2_instance_type: c7a.medium
143 ec2_ami: ubuntu-latest (x86_64)
144 archflags: -mavx2 -mbmi2 -mpopcnt -maes -march=znver4
145 cflags: "-flto -DMLD_FORCE_X86_64"
146 ldflags: "-flto"
147 perf: PMU
148 - name: Intel Xeon 4th gen (c7i)
149 ec2_instance_type: c7i.metal-24xl
150 ec2_ami: ubuntu-latest (x86_64)
151 archflags: -mavx2 -mbmi2 -mpopcnt -maes -march=sapphirerapids
152 cflags: "-flto -DMLD_FORCE_X86_64"
153 ldflags: "-flto"
154 perf: PMU
155 - name: AMD EPYC 3rd gen (c6a)
156 ec2_instance_type: c6a.large
157 ec2_ami: ubuntu-latest (x86_64)
158 archflags: -mavx2 -mbmi2 -mpopcnt -maes -march=znver3
159 cflags: "-flto -DMLD_FORCE_X86_64"
160 ldflags: "-flto"
161 perf: PMU
162 - name: Intel Xeon 3rd gen (c6i)
163 ec2_instance_type: c6i.large
164 ec2_ami: ubuntu-latest (x86_64)
165 archflags: -mavx2 -mbmi2 -mpopcnt -maes -march=icelake-server
166 cflags: "-flto -DMLD_FORCE_X86_64"
167 ldflags: "-flto"
168 perf: PMU
169 uses: ./.github/workflows/bench_ec2_reusable.yml
170 if: github.repository_owner == 'pq-code-package' && (github.event.label.name == 'benchmark' || github.ref == 'refs/heads/main')
171 with:
172 ec2_instance_type: ${{ matrix.target.ec2_instance_type }}
173 ec2_ami: ${{ matrix.target.ec2_ami }}
174 archflags: ${{ matrix.target.archflags }}
175 cflags: ${{ matrix.target.cflags }}
176 ldflags: ${{ matrix.target.ldflags }}
177 opt: "all"
178 store_results: ${{ github.repository_owner == 'pq-code-package' && github.ref == 'refs/heads/main' }} # Only store optimized results
179 name: ${{ matrix.target.name }}
180 perf: ${{ matrix.target.perf }}
181 secrets: inherit