Run icount benchmarks once with softfloat and once with hardfloat

These benchmarks are fast to run, so the time cost here is pretty
minimal. Running softfloat benchmarks just ensures that we don't e.g.
test the performance of `_mm_sqrt_ss` rather than our implementation,
and running without softfloat gives us a way to see the effect of arch
intrinsics.
This commit is contained in:
Trevor Gross 2025-01-21 07:44:13 +00:00
parent f9041943f1
commit ba0cfe58dd
2 changed files with 54 additions and 23 deletions

View file

@ -170,29 +170,7 @@ jobs:
- name: Run icount benchmarks
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
set -eux
iai_home="iai-home"
# Download the baseline from master
./ci/ci-util.py locate-baseline --download --extract
# Run iai-callgrind benchmarks
cargo bench --no-default-features \
--features unstable,unstable-float,icount \
--bench icount \
-- \
--save-baseline=default \
--home "$(pwd)/$iai_home" \
--regression='ir=5.0' \
--save-summary
# NB: iai-callgrind should exit on error but does not, so we inspect the sumary
# for errors. See https://github.com/iai-callgrind/iai-callgrind/issues/337
./ci/ci-util.py check-regressions "$iai_home"
# Name and tar the new baseline
name="baseline-icount-$(date -u +'%Y%m%d%H%M')-${GITHUB_SHA:0:12}"
echo "BASELINE_NAME=$name" >> "$GITHUB_ENV"
tar cJf "$name.tar.xz" "$iai_home"
run: ./ci/bench-icount.sh
- name: Upload the benchmark baseline
uses: actions/upload-artifact@v4

View file

@ -0,0 +1,53 @@
#!/bin/bash
set -eux
iai_home="iai-home"
# Download the baseline from master
./ci/ci-util.py locate-baseline --download --extract
# Run benchmarks once
function run_icount_benchmarks() {
cargo_args=(
"--bench" "icount"
"--no-default-features"
"--features" "unstable,unstable-float,icount"
)
iai_args=(
"--home" "$(pwd)/$iai_home"
"--regression=ir=5.0"
"--save-summary"
)
# Parse `cargo_arg0 cargo_arg1 -- iai_arg0 iai_arg1` syntax
parsing_iai_args=0
while [ "$#" -gt 0 ]; do
if [ "$parsing_iai_args" == "1" ]; then
iai_args+=("$1")
elif [ "$1" == "--" ]; then
parsing_iai_args=1
else
cargo_args+=("$1")
fi
shift
done
# Run iai-callgrind benchmarks
cargo bench "${cargo_args[@]}" -- "${iai_args[@]}"
# NB: iai-callgrind should exit on error but does not, so we inspect the sumary
# for errors. See https://github.com/iai-callgrind/iai-callgrind/issues/337
./ci/ci-util.py check-regressions --home "$iai_home" || true
}
# Run once with softfloats, once with arch instructions enabled
run_icount_benchmarks --features force-soft-floats -- --save-baseline=softfloat
run_icount_benchmarks -- --save-baseline=hardfloat
# Name and tar the new baseline
name="baseline-icount-$(date -u +'%Y%m%d%H%M')-${GITHUB_SHA:0:12}"
echo "BASELINE_NAME=$name" >>"$GITHUB_ENV"
tar cJf "$name.tar.xz" "$iai_home"