Skip to content

Commit 5439637

Browse files
committed
chore(ci): use new heuristic for throughput benchmarks
This is done to load benchmarks machine in smarter way. This makes sure to saturate compute load of the benchmark machine while keeping execution time reasonable. iter_batched() criterion method is used instead of iter() so that benchmarks are compatible with other flavors of operations (unchecked_* or smart_*).
1 parent 3621d12 commit 5439637

File tree

8 files changed

+1247
-515
lines changed

8 files changed

+1247
-515
lines changed

Makefile

Lines changed: 24 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -284,14 +284,14 @@ check_typos: install_typos_checker
284284
.PHONY: clippy_gpu # Run clippy lints on tfhe with "gpu" enabled
285285
clippy_gpu: install_rs_check_toolchain
286286
RUSTFLAGS="$(RUSTFLAGS)" cargo "$(CARGO_RS_CHECK_TOOLCHAIN)" clippy \
287-
--features=boolean,shortint,integer,internal-keycache,gpu \
287+
--features=boolean,shortint,integer,internal-keycache,gpu,pbs-stats \
288288
--all-targets \
289289
-p $(TFHE_SPEC) -- --no-deps -D warnings
290290

291291
.PHONY: check_gpu # Run check on tfhe with "gpu" enabled
292292
check_gpu: install_rs_check_toolchain
293293
RUSTFLAGS="$(RUSTFLAGS)" cargo "$(CARGO_RS_CHECK_TOOLCHAIN)" check \
294-
--features=boolean,shortint,integer,internal-keycache,gpu \
294+
--features=boolean,shortint,integer,internal-keycache,gpu,pbs-stats \
295295
--all-targets \
296296
-p $(TFHE_SPEC)
297297

@@ -407,10 +407,10 @@ clippy_trivium: install_rs_check_toolchain
407407
.PHONY: clippy_all_targets # Run clippy lints on all targets (benches, examples, etc.)
408408
clippy_all_targets: install_rs_check_toolchain
409409
RUSTFLAGS="$(RUSTFLAGS)" cargo "$(CARGO_RS_CHECK_TOOLCHAIN)" clippy --all-targets \
410-
--features=boolean,shortint,integer,internal-keycache,zk-pok,strings \
410+
--features=boolean,shortint,integer,internal-keycache,zk-pok,strings,pbs-stats \
411411
-p $(TFHE_SPEC) -- --no-deps -D warnings
412412
RUSTFLAGS="$(RUSTFLAGS)" cargo "$(CARGO_RS_CHECK_TOOLCHAIN)" clippy --all-targets \
413-
--features=boolean,shortint,integer,internal-keycache,zk-pok,strings,experimental \
413+
--features=boolean,shortint,integer,internal-keycache,zk-pok,strings,pbs-stats,experimental \
414414
-p $(TFHE_SPEC) -- --no-deps -D warnings
415415

416416
.PHONY: clippy_tfhe_csprng # Run clippy lints on tfhe-csprng
@@ -1075,74 +1075,81 @@ bench_integer: install_rs_check_toolchain
10751075
RUSTFLAGS="$(RUSTFLAGS)" __TFHE_RS_BENCH_OP_FLAVOR=$(BENCH_OP_FLAVOR) __TFHE_RS_FAST_BENCH=$(FAST_BENCH) __TFHE_RS_BENCH_TYPE=$(BENCH_TYPE) \
10761076
cargo $(CARGO_RS_CHECK_TOOLCHAIN) bench \
10771077
--bench integer-bench \
1078-
--features=integer,internal-keycache,nightly-avx512 -p $(TFHE_SPEC) --
1078+
--features=integer,internal-keycache,nightly-avx512,pbs-stats -p $(TFHE_SPEC) --
10791079

10801080
.PHONY: bench_signed_integer # Run benchmarks for signed integer
10811081
bench_signed_integer: install_rs_check_toolchain
10821082
RUSTFLAGS="$(RUSTFLAGS)" __TFHE_RS_BENCH_OP_FLAVOR=$(BENCH_OP_FLAVOR) __TFHE_RS_FAST_BENCH=$(FAST_BENCH) __TFHE_RS_BENCH_TYPE=$(BENCH_TYPE) \
10831083
cargo $(CARGO_RS_CHECK_TOOLCHAIN) bench \
10841084
--bench integer-signed-bench \
1085-
--features=integer,internal-keycache,nightly-avx512 -p $(TFHE_SPEC) --
1085+
--features=integer,internal-keycache,nightly-avx512,pbs-stats -p $(TFHE_SPEC) --
10861086

10871087
.PHONY: bench_integer_gpu # Run benchmarks for integer on GPU backend
10881088
bench_integer_gpu: install_rs_check_toolchain
10891089
RUSTFLAGS="$(RUSTFLAGS)" __TFHE_RS_BENCH_OP_FLAVOR=$(BENCH_OP_FLAVOR) __TFHE_RS_FAST_BENCH=$(FAST_BENCH) __TFHE_RS_BENCH_TYPE=$(BENCH_TYPE) \
10901090
cargo $(CARGO_RS_CHECK_TOOLCHAIN) bench \
10911091
--bench integer-bench \
1092-
--features=integer,gpu,internal-keycache,nightly-avx512 -p $(TFHE_SPEC) --
1092+
--features=integer,gpu,internal-keycache,nightly-avx512,pbs-stats -p $(TFHE_SPEC) --
1093+
1094+
.PHONY: bench_signed_integer_gpu # Run benchmarks for signed integer on GPU backend
1095+
bench_signed_integer_gpu: install_rs_check_toolchain
1096+
RUSTFLAGS="$(RUSTFLAGS)" __TFHE_RS_BENCH_OP_FLAVOR=$(BENCH_OP_FLAVOR) __TFHE_RS_FAST_BENCH=$(FAST_BENCH) __TFHE_RS_BENCH_TYPE=$(BENCH_TYPE) \
1097+
cargo $(CARGO_RS_CHECK_TOOLCHAIN) bench \
1098+
--bench integer-signed-bench \
1099+
--features=integer,gpu,internal-keycache,nightly-avx512,pbs-stats -p $(TFHE_SPEC) --
10931100

10941101
.PHONY: bench_integer_compression # Run benchmarks for unsigned integer compression
10951102
bench_integer_compression: install_rs_check_toolchain
10961103
RUSTFLAGS="$(RUSTFLAGS)" __TFHE_RS_BENCH_TYPE=$(BENCH_TYPE) \
10971104
cargo $(CARGO_RS_CHECK_TOOLCHAIN) bench \
10981105
--bench glwe_packing_compression-integer-bench \
1099-
--features=integer,internal-keycache,nightly-avx512 -p $(TFHE_SPEC) --
1106+
--features=integer,internal-keycache,nightly-avx512,pbs-stats -p $(TFHE_SPEC) --
11001107

11011108
.PHONY: bench_integer_compression_gpu
11021109
bench_integer_compression_gpu: install_rs_check_toolchain
11031110
RUSTFLAGS="$(RUSTFLAGS)" __TFHE_RS_BENCH_TYPE=$(BENCH_TYPE) \
11041111
cargo $(CARGO_RS_CHECK_TOOLCHAIN) bench \
11051112
--bench glwe_packing_compression-integer-bench \
1106-
--features=integer,internal-keycache,gpu -p $(TFHE_SPEC) --
1113+
--features=integer,internal-keycache,gpu,pbs-stats -p $(TFHE_SPEC) --
11071114

11081115
.PHONY: bench_integer_multi_bit # Run benchmarks for unsigned integer using multi-bit parameters
11091116
bench_integer_multi_bit: install_rs_check_toolchain
11101117
RUSTFLAGS="$(RUSTFLAGS)" __TFHE_RS_PARAM_TYPE=MULTI_BIT __TFHE_RS_BENCH_TYPE=$(BENCH_TYPE) \
11111118
__TFHE_RS_BENCH_OP_FLAVOR=$(BENCH_OP_FLAVOR) __TFHE_RS_FAST_BENCH=$(FAST_BENCH) \
11121119
cargo $(CARGO_RS_CHECK_TOOLCHAIN) bench \
11131120
--bench integer-bench \
1114-
--features=integer,internal-keycache,nightly-avx512 -p $(TFHE_SPEC) --
1121+
--features=integer,internal-keycache,nightly-avx512,pbs-stats -p $(TFHE_SPEC) --
11151122

11161123
.PHONY: bench_signed_integer_multi_bit # Run benchmarks for signed integer using multi-bit parameters
11171124
bench_signed_integer_multi_bit: install_rs_check_toolchain
11181125
RUSTFLAGS="$(RUSTFLAGS)" __TFHE_RS_PARAM_TYPE=MULTI_BIT __TFHE_RS_BENCH_TYPE=$(BENCH_TYPE) \
11191126
__TFHE_RS_BENCH_OP_FLAVOR=$(BENCH_OP_FLAVOR) __TFHE_RS_FAST_BENCH=$(FAST_BENCH) \
11201127
cargo $(CARGO_RS_CHECK_TOOLCHAIN) bench \
11211128
--bench integer-signed-bench \
1122-
--features=integer,internal-keycache,nightly-avx512 -p $(TFHE_SPEC) --
1129+
--features=integer,internal-keycache,nightly-avx512,pbs-stats -p $(TFHE_SPEC) --
11231130

11241131
.PHONY: bench_integer_multi_bit_gpu # Run benchmarks for integer on GPU backend using multi-bit parameters
11251132
bench_integer_multi_bit_gpu: install_rs_check_toolchain
11261133
RUSTFLAGS="$(RUSTFLAGS)" __TFHE_RS_PARAM_TYPE=MULTI_BIT \
11271134
__TFHE_RS_BENCH_OP_FLAVOR=$(BENCH_OP_FLAVOR) __TFHE_RS_FAST_BENCH=$(FAST_BENCH) __TFHE_RS_BENCH_TYPE=$(BENCH_TYPE) \
11281135
cargo $(CARGO_RS_CHECK_TOOLCHAIN) bench \
11291136
--bench integer-bench \
1130-
--features=integer,gpu,internal-keycache,nightly-avx512 -p $(TFHE_SPEC) --
1137+
--features=integer,gpu,internal-keycache,nightly-avx512,pbs-stats -p $(TFHE_SPEC) --
11311138

1132-
.PHONY: bench_unsigned_integer_multi_bit_gpu # Run benchmarks for unsigned integer on GPU backend using multi-bit parameters
1133-
bench_unsigned_integer_multi_bit_gpu: install_rs_check_toolchain
1139+
.PHONY: bench_signed_integer_multi_bit_gpu # Run benchmarks for signed integer on GPU backend using multi-bit parameters
1140+
bench_signed_integer_multi_bit_gpu: install_rs_check_toolchain
11341141
RUSTFLAGS="$(RUSTFLAGS)" __TFHE_RS_PARAM_TYPE=MULTI_BIT \
11351142
__TFHE_RS_BENCH_OP_FLAVOR=$(BENCH_OP_FLAVOR) __TFHE_RS_FAST_BENCH=$(FAST_BENCH) __TFHE_RS_BENCH_TYPE=$(BENCH_TYPE) \
11361143
cargo $(CARGO_RS_CHECK_TOOLCHAIN) bench \
1137-
--bench integer-bench \
1138-
--features=integer,gpu,internal-keycache,nightly-avx512 -p $(TFHE_SPEC) -- ::unsigned
1144+
--bench integer-signed-bench \
1145+
--features=integer,gpu,internal-keycache,nightly-avx512,pbs-stats -p $(TFHE_SPEC) --
11391146

11401147
.PHONY: bench_integer_zk # Run benchmarks for integer encryption with ZK proofs
11411148
bench_integer_zk: install_rs_check_toolchain
11421149
RUSTFLAGS="$(RUSTFLAGS)" __TFHE_RS_BENCH_TYPE=$(BENCH_TYPE) \
11431150
cargo $(CARGO_RS_CHECK_TOOLCHAIN) bench \
11441151
--bench zk-pke-bench \
1145-
--features=integer,internal-keycache,zk-pok,nightly-avx512 \
1152+
--features=integer,internal-keycache,zk-pok,nightly-avx512,pbs-stats \
11461153
-p $(TFHE_SPEC) --
11471154

11481155
.PHONY: bench_shortint # Run benchmarks for shortint

0 commit comments

Comments
 (0)