From b2407d530e052662701e837615402801bd142693 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Test=C3=A9?= Date: Fri, 24 Feb 2023 12:28:53 +0100 Subject: [PATCH] chore(ci): provide hardware name for benchmarks with avx512 This also print a human friendly error from parser if the hardware cannot be found in the product list. --- .github/workflows/boolean_benchmark.yml | 1 + .github/workflows/shortint_benchmark.yml | 1 + ci/benchmark_parser.py | 8 ++++++-- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/boolean_benchmark.yml b/.github/workflows/boolean_benchmark.yml index 4438ea2f1..ca0a20888 100644 --- a/.github/workflows/boolean_benchmark.yml +++ b/.github/workflows/boolean_benchmark.yml @@ -90,6 +90,7 @@ jobs: - name: Parse AVX512 results run: | python3 ./ci/benchmark_parser.py target/criterion ${{ env.RESULTS_FILENAME }} \ + --hardware ${{ inputs.instance_type }} \ --name-suffix avx512 \ --throughput \ --append-results diff --git a/.github/workflows/shortint_benchmark.yml b/.github/workflows/shortint_benchmark.yml index 46cf2acad..1fd2dde2f 100644 --- a/.github/workflows/shortint_benchmark.yml +++ b/.github/workflows/shortint_benchmark.yml @@ -91,6 +91,7 @@ jobs: - name: Parse AVX512 results run: | python3 ./ci/benchmark_parser.py target/criterion ${{ env.RESULTS_FILENAME }} \ + --hardware ${{ inputs.instance_type }} \ --walk-subdirs \ --name-suffix avx512 \ --throughput \ diff --git a/ci/benchmark_parser.py b/ci/benchmark_parser.py index 87141c2f0..5eaa1658e 100644 --- a/ci/benchmark_parser.py +++ b/ci/benchmark_parser.py @@ -227,8 +227,12 @@ if __name__ == "__main__": print("Throughput computation enabled") ec2_costs = json.loads( pathlib.Path("ci/ec2_products_cost.json").read_text(encoding="utf-8")) - hardware_cost = abs(ec2_costs[args.hardware]) - print(f"Hardware hourly cost: {hardware_cost} $/h") + try: + hardware_cost = abs(ec2_costs[args.hardware]) + print(f"Hardware hourly cost: {hardware_cost} $/h") + except KeyError: + print(f"Cannot find hardware hourly cost for '{args.hardware}'") + sys.exit(1) results = recursive_parse(raw_results, args.walk_subdirs, args.name_suffix, args.throughput, hardware_cost)