Skip to content

Commit

Permalink
chore(gpu): update pbs test parameters to match tfhe-rs' integer tests
Browse files Browse the repository at this point in the history
  • Loading branch information
pdroalves committed Nov 5, 2024
1 parent fe99a7a commit 0979879
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 195 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -233,147 +233,15 @@ ::testing::internal::ParamGenerator<ClassicalProgrammableBootstrapTestParams>
// n, k, N, lwe_variance, glwe_variance, pbs_base_log, pbs_level,
// message_modulus, carry_modulus, number_of_inputs, repetitions,
// samples
// BOOLEAN_DEFAULT_PARAMETERS
// PARAM_MESSAGE_2_CARRY_2_KS_PBS_TUNIFORM_2M64
(ClassicalProgrammableBootstrapTestParams){
777, 3, 512, new_gaussian_from_std_dev(sqrt(1.3880686109937e-11)),
new_gaussian_from_std_dev(sqrt(1.1919984450689246e-23)), 18, 1, 2,
2, 2, 2, 40},
// BOOLEAN_TFHE_LIB_PARAMETERS
887, 1, 2048, new_t_uniform(46), new_t_uniform(17), 22, 1, 4, 4,
100, 1, 1},
// PARAM_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64
(ClassicalProgrammableBootstrapTestParams){
830, 2, 1024,
new_gaussian_from_std_dev(sqrt(1.994564705573226e-12)),
new_gaussian_from_std_dev(sqrt(8.645717832544903e-32)), 23, 1, 2, 2,
2, 2, 40},
// SHORTINT_PARAM_MESSAGE_1_CARRY_0
(ClassicalProgrammableBootstrapTestParams){
678, 5, 256, new_gaussian_from_std_dev(sqrt(5.203010004723453e-10)),
new_gaussian_from_std_dev(sqrt(1.3996292326131784e-19)), 15, 1, 2,
1, 2, 2, 40},
// SHORTINT_PARAM_MESSAGE_1_CARRY_1
(ClassicalProgrammableBootstrapTestParams){
684, 3, 512, new_gaussian_from_std_dev(sqrt(4.177054989616946e-10)),
new_gaussian_from_std_dev(sqrt(1.1919984450689246e-23)), 18, 1, 2,
2, 2, 2, 40},
// SHORTINT_PARAM_MESSAGE_2_CARRY_0
(ClassicalProgrammableBootstrapTestParams){
656, 2, 512,
new_gaussian_from_std_dev(sqrt(1.1641198952558192e-09)),
new_gaussian_from_std_dev(sqrt(1.6434266310406663e-15)), 8, 2, 4, 1,
2, 2, 40},
// SHORTINT_PARAM_MESSAGE_1_CARRY_2
// SHORTINT_PARAM_MESSAGE_2_CARRY_1
// SHORTINT_PARAM_MESSAGE_3_CARRY_0
(ClassicalProgrammableBootstrapTestParams){
742, 2, 1024,
new_gaussian_from_std_dev(sqrt(4.998277131225527e-11)),
new_gaussian_from_std_dev(sqrt(8.645717832544903e-32)), 23, 1, 2, 4,
2, 2, 40},
// SHORTINT_PARAM_MESSAGE_1_CARRY_3
// SHORTINT_PARAM_MESSAGE_2_CARRY_2
// SHORTINT_PARAM_MESSAGE_3_CARRY_1
// SHORTINT_PARAM_MESSAGE_4_CARRY_0
(ClassicalProgrammableBootstrapTestParams){
745, 1, 2048,
new_gaussian_from_std_dev(sqrt(4.478453795193731e-11)),
new_gaussian_from_std_dev(sqrt(8.645717832544903e-32)), 23, 1, 2, 8,
2, 2, 40},
// SHORTINT_PARAM_MESSAGE_5_CARRY_0
// SHORTINT_PARAM_MESSAGE_3_CARRY_2
(ClassicalProgrammableBootstrapTestParams){
807, 1, 4096,
new_gaussian_from_std_dev(sqrt(4.629015039118823e-12)),
new_gaussian_from_std_dev(sqrt(4.70197740328915e-38)), 22, 1, 32, 1,
2, 1, 40},
// SHORTINT_PARAM_MESSAGE_6_CARRY_0
(ClassicalProgrammableBootstrapTestParams){
915, 1, 8192,
new_gaussian_from_std_dev(sqrt(8.883173851180252e-14)),
new_gaussian_from_std_dev(sqrt(4.70197740328915e-38)), 22, 1, 64, 1,
2, 1, 2},
// SHORTINT_PARAM_MESSAGE_3_CARRY_3
(ClassicalProgrammableBootstrapTestParams){
864, 1, 8192,
new_gaussian_from_std_dev(sqrt(1.5843564961097632e-15)),
new_gaussian_from_std_dev(sqrt(4.70197740328915e-38)), 15, 2, 8, 8,
2, 1, 2},
// SHORTINT_PARAM_MESSAGE_4_CARRY_3
// SHORTINT_PARAM_MESSAGE_7_CARRY_0
(ClassicalProgrammableBootstrapTestParams){
930, 1, 16384,
new_gaussian_from_std_dev(sqrt(5.129877458078009e-14)),
new_gaussian_from_std_dev(sqrt(4.70197740328915e-38)), 15, 2, 128,
1, 2, 1, 1},

// BOOLEAN_DEFAULT_PARAMETERS
(ClassicalProgrammableBootstrapTestParams){
777, 3, 512, new_gaussian_from_std_dev(sqrt(1.3880686109937e-11)),
new_gaussian_from_std_dev(sqrt(1.1919984450689246e-23)), 18, 1, 2,
2, 100, 2, 40},
// BOOLEAN_TFHE_LIB_PARAMETERS
(ClassicalProgrammableBootstrapTestParams){
830, 2, 1024,
new_gaussian_from_std_dev(sqrt(1.994564705573226e-12)),
new_gaussian_from_std_dev(sqrt(8.645717832544903e-32)), 23, 1, 2, 2,
100, 2, 40},
// SHORTINT_PARAM_MESSAGE_1_CARRY_0
(ClassicalProgrammableBootstrapTestParams){
678, 5, 256, new_gaussian_from_std_dev(sqrt(5.203010004723453e-10)),
new_gaussian_from_std_dev(sqrt(1.3996292326131784e-19)), 15, 1, 2,
1, 100, 2, 40},
// SHORTINT_PARAM_MESSAGE_1_CARRY_1
(ClassicalProgrammableBootstrapTestParams){
684, 3, 512, new_gaussian_from_std_dev(sqrt(4.177054989616946e-10)),
new_gaussian_from_std_dev(sqrt(1.1919984450689246e-23)), 18, 1, 2,
2, 100, 2, 40},
// SHORTINT_PARAM_MESSAGE_2_CARRY_0
(ClassicalProgrammableBootstrapTestParams){
656, 2, 512,
new_gaussian_from_std_dev(sqrt(1.1641198952558192e-09)),
new_gaussian_from_std_dev(sqrt(1.6434266310406663e-15)), 8, 2, 4, 1,
100, 2, 40},
// SHORTINT_PARAM_MESSAGE_1_CARRY_2
// SHORTINT_PARAM_MESSAGE_2_CARRY_1
// SHORTINT_PARAM_MESSAGE_3_CARRY_0
(ClassicalProgrammableBootstrapTestParams){
742, 2, 1024,
new_gaussian_from_std_dev(sqrt(4.998277131225527e-11)),
new_gaussian_from_std_dev(sqrt(8.645717832544903e-32)), 23, 1, 2, 4,
100, 2, 40},
// SHORTINT_PARAM_MESSAGE_1_CARRY_3
// SHORTINT_PARAM_MESSAGE_2_CARRY_2
// SHORTINT_PARAM_MESSAGE_3_CARRY_1
// SHORTINT_PARAM_MESSAGE_4_CARRY_0
(ClassicalProgrammableBootstrapTestParams){
745, 1, 2048,
new_gaussian_from_std_dev(sqrt(4.478453795193731e-11)),
new_gaussian_from_std_dev(sqrt(8.645717832544903e-32)), 23, 1, 2, 8,
100, 2, 40},
// SHORTINT_PARAM_MESSAGE_5_CARRY_0
// SHORTINT_PARAM_MESSAGE_3_CARRY_2
(ClassicalProgrammableBootstrapTestParams){
807, 1, 4096,
new_gaussian_from_std_dev(sqrt(4.629015039118823e-12)),
new_gaussian_from_std_dev(sqrt(4.70197740328915e-38)), 22, 1, 32, 1,
100, 1, 40},
// SHORTINT_PARAM_MESSAGE_6_CARRY_0
(ClassicalProgrammableBootstrapTestParams){
915, 1, 8192,
new_gaussian_from_std_dev(sqrt(8.883173851180252e-14)),
new_gaussian_from_std_dev(sqrt(4.70197740328915e-38)), 22, 1, 64, 1,
100, 1, 2},
// SHORTINT_PARAM_MESSAGE_3_CARRY_3
(ClassicalProgrammableBootstrapTestParams){
864, 1, 8192,
new_gaussian_from_std_dev(sqrt(1.5843564961097632e-15)),
new_gaussian_from_std_dev(sqrt(4.70197740328915e-38)), 15, 2, 8, 8,
100, 1, 2},
// SHORTINT_PARAM_MESSAGE_4_CARRY_3
// SHORTINT_PARAM_MESSAGE_7_CARRY_0
(ClassicalProgrammableBootstrapTestParams){
930, 1, 16384,
new_gaussian_from_std_dev(sqrt(5.129877458078009e-14)),
new_gaussian_from_std_dev(sqrt(4.70197740328915e-38)), 15, 2, 128,
1, 100, 1, 1});
977, 1, 8192, new_gaussian_from_std_dev(3.0144389706858286e-07),
new_gaussian_from_std_dev(2.168404344971009e-19), 16, 2, 8, 8, 100,
1, 1});
std::string printParamName(
::testing::TestParamInfo<ClassicalProgrammableBootstrapTestParams> p) {
ClassicalProgrammableBootstrapTestParams params = p.param;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,70 +171,44 @@ TEST_P(MultiBitProgrammableBootstrapTestPrimitives_u64,
}
}

/**
int lwe_dimension;
int glwe_dimension;
int polynomial_size;
DynamicDistribution lwe_noise_distribution;
DynamicDistribution glwe_noise_distribution;
int pbs_base_log;
int pbs_level;
int message_modulus;
int carry_modulus;
int number_of_inputs;
int grouping_factor;
int repetitions;
int samples;
*/
// Defines for which parameters set the PBS will be tested.
// It executes each src for all pairs on phis X qs (Cartesian product)
::testing::internal::ParamGenerator<MultiBitProgrammableBootstrapTestParams>
multipbs_params_u64 = ::testing::Values(
// fast src
(MultiBitProgrammableBootstrapTestParams){
16, 1, 256, new_gaussian_from_std_dev(sqrt(1.3880686109937e-11)),
new_gaussian_from_std_dev(sqrt(1.1919984450689246e-23)), 23, 1, 2,
2, 1, 2, 1, 10},
(MultiBitProgrammableBootstrapTestParams){
16, 1, 256, new_gaussian_from_std_dev(sqrt(1.3880686109937e-11)),
new_gaussian_from_std_dev(sqrt(1.1919984450689246e-23)), 23, 1, 2,
2, 128, 2, 1, 10},
// 4_bits_multi_bit_group_2
(MultiBitProgrammableBootstrapTestParams){
818, 1, 2048, new_gaussian_from_std_dev(sqrt(1.3880686109937e-11)),
new_gaussian_from_std_dev(sqrt(1.1919984450689246e-23)), 22, 1, 2,
2, 1, 2, 1, 10},
(MultiBitProgrammableBootstrapTestParams){
818, 1, 2048, new_gaussian_from_std_dev(sqrt(1.3880686109937e-15)),
new_gaussian_from_std_dev(sqrt(1.1919984450689246e-24)), 22, 1, 2,
2, 128, 2, 1, 10},
// 4_bits_multi_bit_group_3
(MultiBitProgrammableBootstrapTestParams){
888, 1, 2048,
new_gaussian_from_std_dev(sqrt(4.9571231961752025e-12)),
new_gaussian_from_std_dev(sqrt(9.9409770026944e-32)), 21, 1, 2, 2,
1, 3, 1, 10},
(MultiBitProgrammableBootstrapTestParams){
888, 1, 16384,
new_gaussian_from_std_dev(sqrt(4.9571231961752025e-12)),
new_gaussian_from_std_dev(sqrt(9.9409770026944e-32)), 21, 1, 2, 2,
1, 3, 1, 1},

(MultiBitProgrammableBootstrapTestParams){
888, 1, 1024,
new_gaussian_from_std_dev(sqrt(4.9571231961752025e-12)),
new_gaussian_from_std_dev(sqrt(9.9409770026944e-32)), 21, 1, 2, 2,
128, 3, 1, 10},
(MultiBitProgrammableBootstrapTestParams){
888, 1, 2048,
new_gaussian_from_std_dev(sqrt(4.9571231961752025e-12)),
new_gaussian_from_std_dev(sqrt(9.9409770026944e-32)), 21, 1, 2, 2,
128, 3, 1, 10},
// PARAM_GPU_MULTI_BIT_GROUP_3_MESSAGE_2_CARRY_2_KS_PBS_TUNIFORM_2M64
(MultiBitProgrammableBootstrapTestParams){
888, 1, 4096,
new_gaussian_from_std_dev(sqrt(4.9571231961752025e-12)),
new_gaussian_from_std_dev(sqrt(9.9409770026944e-32)), 21, 1, 2, 2,
128, 3, 1, 10},
882, 1, 2048, new_t_uniform(46), new_t_uniform(17), 14, 2, 8, 8,
100, 3, 1, 1},
// PARAM_GPU_MULTI_BIT_GROUP_3_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64
(MultiBitProgrammableBootstrapTestParams){
888, 1, 8192,
new_gaussian_from_std_dev(sqrt(4.9571231961752025e-12)),
new_gaussian_from_std_dev(sqrt(9.9409770026944e-32)), 21, 1, 2, 2,
128, 3, 1, 1},
978, 1, 8192, new_gaussian_from_std_dev((2.962875621642539e-07)),
new_gaussian_from_std_dev((2.168404344971009e-19)), 14, 2, 8, 8,
100, 3, 1, 1},
// PARAM_GPU_MULTI_BIT_GROUP_2_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64
(MultiBitProgrammableBootstrapTestParams){
888, 1, 16384,
new_gaussian_from_std_dev(sqrt(4.9571231961752025e-12)),
new_gaussian_from_std_dev(sqrt(9.9409770026944e-32)), 21, 1, 2, 2,
128, 3, 1, 1},
836, 1, 2048, new_gaussian_from_std_dev((3.433444883863949e-06)),
new_gaussian_from_std_dev((2.845267479601915e-15)), 22, 2, 4, 4,
100, 2, 1, 1},
// PARAM_GPU_MULTI_BIT_GROUP_2_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64
(MultiBitProgrammableBootstrapTestParams){
972, 1, 8192,
new_gaussian_from_std_dev(sqrt(4.9571231961752025e-12)),
new_gaussian_from_std_dev(sqrt(9.9409770026944e-32)), 14, 2, 8, 8,
68, 3, 1, 1});
978, 1, 8192, new_gaussian_from_std_dev((2.962875621642539e-07)),
new_gaussian_from_std_dev((2.168404344971009e-19)), 14, 2, 8, 8,
100, 2, 1, 1});

std::string printParamName(
::testing::TestParamInfo<MultiBitProgrammableBootstrapTestParams> p) {
Expand Down

0 comments on commit 0979879

Please sign in to comment.