From 32bcda3a93cd237fc53dc6469c80fee830703703 Mon Sep 17 00:00:00 2001 From: Agnes Leroy Date: Thu, 30 Mar 2023 11:18:22 +0200 Subject: [PATCH] bench(backend/cuda): restrict the number of inputs for large poly sizes --- .../benchmark/benchmark_bootstrap.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/backends/concrete-cuda/implementation/test_and_benchmark/benchmark/benchmark_bootstrap.cpp b/backends/concrete-cuda/implementation/test_and_benchmark/benchmark/benchmark_bootstrap.cpp index f17213576..e3cefdd73 100644 --- a/backends/concrete-cuda/implementation/test_and_benchmark/benchmark/benchmark_bootstrap.cpp +++ b/backends/concrete-cuda/implementation/test_and_benchmark/benchmark/benchmark_bootstrap.cpp @@ -230,11 +230,17 @@ BootstrapBenchmarkGenerateParams(benchmark::internal::Benchmark *b) { }; // Add to the list of parameters to benchmark - for (auto x : params) - for (int num_samples = 1; num_samples <= 10000; num_samples *= 10) { + for (auto x : params) { + int max_num_samples = 10000; + if (x.polynomial_size >= 8192) { + max_num_samples = 100; + } + for (int num_samples = 1; num_samples <= max_num_samples; + num_samples *= 10) { b->Args({x.lwe_dimension, x.glwe_dimension, x.polynomial_size, x.pbs_base_log, x.pbs_level, num_samples}); } + } } BENCHMARK_REGISTER_F(Bootstrap_u64, ConcreteCuda_AmortizedPBS)