bench(compiler): Add e2e benchmark for rounded PBS

This commit is contained in:
aPere3
2023-04-04 17:23:10 +02:00
committed by Quentin Bourgerie
parent 0e59f66a64
commit 141efc8db2
2 changed files with 13 additions and 2 deletions

View File

@@ -331,10 +331,13 @@ $(BENCHMARK_CPU_DIR):
$(BENCHMARK_CPU_DIR)/end_to_end_linalg_apply_lookup_table.yaml: tests/end_to_end_fixture/end_to_end_linalg_apply_lookup_table_gen.py
$(Python3_EXECUTABLE) $< --n-ct 64 128 1024 > $@
$(BENCHMARK_CPU_DIR)/end_to_end_round.yaml: tests/end_to_end_fixture/end_to_end_round_gen.py
$(Python3_EXECUTABLE) $< --shapes 64 128 1024 > $@
$(BENCHMARK_CPU_DIR)/%.yaml: tests/end_to_end_fixture/%_gen.py
$(Python3_EXECUTABLE) $< > $@
generate-cpu-benchmarks: $(BENCHMARK_CPU_DIR) $(BENCHMARK_CPU_DIR)/end_to_end_linalg_apply_lookup_table.yaml $(BENCHMARK_CPU_DIR)/end_to_end_apply_lookup_table.yaml
generate-cpu-benchmarks: $(BENCHMARK_CPU_DIR) $(BENCHMARK_CPU_DIR)/end_to_end_linalg_apply_lookup_table.yaml $(BENCHMARK_CPU_DIR)/end_to_end_apply_lookup_table.yaml $(BENCHMARK_CPU_DIR)/end_to_end_round.yaml
SECURITY_TO_BENCH=128
run-cpu-benchmarks: build-benchmarks generate-cpu-benchmarks

View File

@@ -117,13 +117,14 @@ def generate(args):
print("# /!\ THIS FILE HAS BEEN GENERATED")
np.random.seed(0)
# unsigned_unsigned
shapes = ([shape] for shape in args.shapes) if args.shapes else (None, [3], [2, 3] , [1, 2, 3])
domain = [
(from_p, to_p, signed, with_tlu, with_shape)
for from_p in args.acc_bitwidth
for to_p in args.bitwidth
for signed in (False, True)
for with_tlu in (False, True)
for with_shape in (None, [3], [2, 3] , [1, 2, 3])
for with_shape in shapes
if to_p < from_p
]
for (from_p, to_p, signed, with_tlu, with_shape) in domain:
@@ -155,6 +156,13 @@ if __name__ == "__main__":
type=int,
default=[8, 13, 16],
)
CLI.add_argument(
"--shapes",
help="Specify the shapes to test",
nargs='*',
type=int,
default=[],
)
CLI.add_argument(
"--minimal",
help="Specify whether to generate minimal tests only",