Skip to content

Commit

Permalink
chore(shortint): update multi-bit gpu parameters set
Browse files Browse the repository at this point in the history
Update with the latest improvements from the optimizer.
  • Loading branch information
soonum authored and agnesLeroy committed Sep 26, 2024
1 parent 41fae73 commit 7afe9b7
Show file tree
Hide file tree
Showing 8 changed files with 42 additions and 43 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/gpu_fast_h100_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:
- backends/tfhe-cuda-backend/**
- tfhe/src/core_crypto/gpu/**
- tfhe/src/integer/gpu/**
- tfhe/shortint/parameters/**
- tfhe/src/shortint/parameters/**
- tfhe/src/high_level_api/**
- tfhe/src/c_api/**
- 'tfhe/docs/**.md'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/gpu_fast_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
- backends/tfhe-cuda-backend/**
- tfhe/src/core_crypto/gpu/**
- tfhe/src/integer/gpu/**
- tfhe/shortint/parameters/**
- tfhe/src/shortint/parameters/**
- tfhe/src/high_level_api/**
- tfhe/src/c_api/**
- 'tfhe/docs/**.md'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/gpu_full_multi_gpu_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:
- backends/tfhe-cuda-backend/**
- tfhe/src/core_crypto/gpu/**
- tfhe/src/integer/gpu/**
- tfhe/shortint/parameters/**
- tfhe/src/shortint/parameters/**
- tfhe/src/high_level_api/**
- tfhe/src/c_api/**
- 'tfhe/docs/**.md'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/gpu_signed_integer_h100_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
- backends/tfhe-cuda-backend/**
- tfhe/src/core_crypto/gpu/**
- tfhe/src/integer/gpu/**
- tfhe/shortint/parameters/**
- tfhe/src/shortint/parameters/**
- tfhe/src/high_level_api/**
- tfhe/src/c_api/**
- 'tfhe/docs/**.md'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/gpu_signed_integer_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jobs:
- backends/tfhe-cuda-backend/**
- tfhe/src/core_crypto/gpu/**
- tfhe/src/integer/gpu/**
- tfhe/shortint/parameters/**
- tfhe/src/shortint/parameters/**
- tfhe/src/high_level_api/**
- tfhe/src/c_api/**
- 'tfhe/docs/**.md'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/gpu_unsigned_integer_h100_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
- backends/tfhe-cuda-backend/**
- tfhe/src/core_crypto/gpu/**
- tfhe/src/integer/gpu/**
- tfhe/shortint/parameters/**
- tfhe/src/shortint/parameters/**
- tfhe/src/high_level_api/**
- tfhe/src/c_api/**
- 'tfhe/docs/**.md'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/gpu_unsigned_integer_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jobs:
- backends/tfhe-cuda-backend/**
- tfhe/src/core_crypto/gpu/**
- tfhe/src/integer/gpu/**
- tfhe/shortint/parameters/**
- tfhe/src/shortint/parameters/**
- tfhe/src/high_level_api/**
- tfhe/src/c_api/**
- 'tfhe/docs/**.md'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,40 +5,39 @@ use crate::shortint::parameters::{CarryModulus, MessageModulus};

// Group 2

// p-fail = 2^-64.577, algorithmic cost ~ 65, 2-norm = 3
// p-fail = 2^-64.545, algorithmic cost ~ 62, 2-norm = 3
pub const PARAM_GPU_MULTI_BIT_GROUP_2_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M64:
MultiBitPBSParameters = MultiBitPBSParameters {
lwe_dimension: LweDimension(786),
glwe_dimension: GlweDimension(4),
polynomial_size: PolynomialSize(512),
lwe_dimension: LweDimension(718),
glwe_dimension: GlweDimension(2),
polynomial_size: PolynomialSize(1024),
lwe_noise_distribution: DynamicDistribution::new_gaussian_from_std_dev(StandardDev(
8.135492209468212e-06,
2.62974076167165e-05,
)),
glwe_noise_distribution: DynamicDistribution::new_gaussian_from_std_dev(StandardDev(
2.845267479601915e-15,
)),
pbs_base_log: DecompositionBaseLog(23),
pbs_base_log: DecompositionBaseLog(22),
pbs_level: DecompositionLevelCount(1),
ks_base_log: DecompositionBaseLog(4),
ks_level: DecompositionLevelCount(3),
ks_base_log: DecompositionBaseLog(3),
ks_level: DecompositionLevelCount(5),
message_modulus: MessageModulus(2),
carry_modulus: CarryModulus(2),
max_noise_level: MaxNoiseLevel::new(3),
log2_p_fail: -64.577,
log2_p_fail: -64.545,
ciphertext_modulus: CiphertextModulus::new_native(),
encryption_key_choice: EncryptionKeyChoice::Big,
grouping_factor: LweBskGroupingFactor(2),
deterministic_execution: false,
};

// p-fail = 2^-64.605, algorithmic cost ~ 83, 2-norm = 5
// p-fail = 2^-64.725, algorithmic cost ~ 82, 2-norm = 5
pub const PARAM_GPU_MULTI_BIT_GROUP_2_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64:
MultiBitPBSParameters = MultiBitPBSParameters {
lwe_dimension: LweDimension(842),
lwe_dimension: LweDimension(836),
glwe_dimension: GlweDimension(1),
polynomial_size: PolynomialSize(2048),
lwe_noise_distribution: DynamicDistribution::new_gaussian_from_std_dev(StandardDev(
3.0957909745987987e-06,
3.433444883863949e-06,
)),
glwe_noise_distribution: DynamicDistribution::new_gaussian_from_std_dev(StandardDev(
2.845267479601915e-15,
Expand All @@ -50,20 +49,20 @@ pub const PARAM_GPU_MULTI_BIT_GROUP_2_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64:
message_modulus: MessageModulus(4),
carry_modulus: CarryModulus(4),
max_noise_level: MaxNoiseLevel::new(5),
log2_p_fail: -64.605,
log2_p_fail: -64.725,
ciphertext_modulus: CiphertextModulus::new_native(),
encryption_key_choice: EncryptionKeyChoice::Big,
grouping_factor: LweBskGroupingFactor(2),
deterministic_execution: false,
};
// p-fail = 2^-64.168, algorithmic cost ~ 661, 2-norm = 9
// p-fail = 2^-64.367, algorithmic cost ~ 657, 2-norm = 9
pub const PARAM_GPU_MULTI_BIT_GROUP_2_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64:
MultiBitPBSParameters = MultiBitPBSParameters {
lwe_dimension: LweDimension(984),
lwe_dimension: LweDimension(978),
glwe_dimension: GlweDimension(1),
polynomial_size: PolynomialSize(8192),
lwe_noise_distribution: DynamicDistribution::new_gaussian_from_std_dev(StandardDev(
2.671498718807819e-07,
2.962875621642539e-07,
)),
glwe_noise_distribution: DynamicDistribution::new_gaussian_from_std_dev(StandardDev(
2.168404344971009e-19,
Expand All @@ -75,73 +74,73 @@ pub const PARAM_GPU_MULTI_BIT_GROUP_2_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64:
message_modulus: MessageModulus(8),
carry_modulus: CarryModulus(8),
max_noise_level: MaxNoiseLevel::new(9),
log2_p_fail: -64.168,
log2_p_fail: -64.367,
ciphertext_modulus: CiphertextModulus::new_native(),
encryption_key_choice: EncryptionKeyChoice::Big,
grouping_factor: LweBskGroupingFactor(2),
deterministic_execution: false,
};

// Group 3
// p-fail = 2^-64.579, algorithmic cost ~ 73, 2-norm = 3

// p-fail = 2^-68.192, algorithmic cost ~ 64, 2-norm = 3
pub const PARAM_GPU_MULTI_BIT_GROUP_3_MESSAGE_1_CARRY_1_KS_PBS_GAUSSIAN_2M64:
MultiBitPBSParameters = MultiBitPBSParameters {
lwe_dimension: LweDimension(786),
glwe_dimension: GlweDimension(4),
polynomial_size: PolynomialSize(512),
lwe_dimension: LweDimension(720),
glwe_dimension: GlweDimension(2),
polynomial_size: PolynomialSize(1024),
lwe_noise_distribution: DynamicDistribution::new_gaussian_from_std_dev(StandardDev(
8.135492209468212e-06,
2.540544392252957e-05,
)),
glwe_noise_distribution: DynamicDistribution::new_gaussian_from_std_dev(StandardDev(
2.845267479601915e-15,
)),
pbs_base_log: DecompositionBaseLog(22),
pbs_level: DecompositionLevelCount(1),
ks_base_log: DecompositionBaseLog(4),
ks_level: DecompositionLevelCount(3),
ks_base_log: DecompositionBaseLog(3),
ks_level: DecompositionLevelCount(5),
message_modulus: MessageModulus(2),
carry_modulus: CarryModulus(2),
max_noise_level: MaxNoiseLevel::new(3),
log2_p_fail: -64.579,
log2_p_fail: -68.192,
ciphertext_modulus: CiphertextModulus::new_native(),
encryption_key_choice: EncryptionKeyChoice::Big,
grouping_factor: LweBskGroupingFactor(3),
deterministic_execution: false,
};
// p-fail = 2^-65.005, algorithmic cost ~ 79, 2-norm = 5
// p-fail = 2^-64.655, algorithmic cost ~ 79, 2-norm = 5
pub const PARAM_GPU_MULTI_BIT_GROUP_3_MESSAGE_2_CARRY_2_KS_PBS_GAUSSIAN_2M64:
MultiBitPBSParameters = MultiBitPBSParameters {
lwe_dimension: LweDimension(843),
lwe_dimension: LweDimension(837),
glwe_dimension: GlweDimension(1),
polynomial_size: PolynomialSize(2048),
lwe_noise_distribution: DynamicDistribution::new_gaussian_from_std_dev(StandardDev(
3.0428360625436423e-06,
3.3747142481837397e-06,
)),
glwe_noise_distribution: DynamicDistribution::new_gaussian_from_std_dev(StandardDev(
2.845267479601915e-15,
)),
pbs_base_log: DecompositionBaseLog(22),
pbs_base_log: DecompositionBaseLog(21),
pbs_level: DecompositionLevelCount(1),
ks_base_log: DecompositionBaseLog(3),
ks_level: DecompositionLevelCount(5),
message_modulus: MessageModulus(4),
carry_modulus: CarryModulus(4),
max_noise_level: MaxNoiseLevel::new(5),
log2_p_fail: -65.005,
log2_p_fail: -64.655,
ciphertext_modulus: CiphertextModulus::new_native(),
encryption_key_choice: EncryptionKeyChoice::Big,
grouping_factor: LweBskGroupingFactor(3),
deterministic_execution: false,
};

// p-fail = 2^-64.173, algorithmic cost ~ 645, 2-norm = 9
// p-fail = 2^-64.372, algorithmic cost ~ 641, 2-norm = 9
pub const PARAM_GPU_MULTI_BIT_GROUP_3_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64:
MultiBitPBSParameters = MultiBitPBSParameters {
lwe_dimension: LweDimension(984),
lwe_dimension: LweDimension(978),
glwe_dimension: GlweDimension(1),
polynomial_size: PolynomialSize(8192),
lwe_noise_distribution: DynamicDistribution::new_gaussian_from_std_dev(StandardDev(
2.671498718807819e-07,
2.962875621642539e-07,
)),
glwe_noise_distribution: DynamicDistribution::new_gaussian_from_std_dev(StandardDev(
2.168404344971009e-19,
Expand All @@ -153,7 +152,7 @@ pub const PARAM_GPU_MULTI_BIT_GROUP_3_MESSAGE_3_CARRY_3_KS_PBS_GAUSSIAN_2M64:
message_modulus: MessageModulus(8),
carry_modulus: CarryModulus(8),
max_noise_level: MaxNoiseLevel::new(9),
log2_p_fail: -64.173,
log2_p_fail: -64.372,
ciphertext_modulus: CiphertextModulus::new_native(),
encryption_key_choice: EncryptionKeyChoice::Big,
grouping_factor: LweBskGroupingFactor(3),
Expand Down

0 comments on commit 7afe9b7

Please sign in to comment.