mirror of
https://github.com/zama-ai/tfhe-rs.git
synced 2026-01-09 14:47:56 -05:00
wip g4
This commit is contained in:
@@ -128,6 +128,7 @@ fn multi_bit_benchmark_parameters<Scalar: UnsignedInteger + Default>(
|
||||
PARAM_MULTI_BIT_MESSAGE_1_CARRY_1_GROUP_3_KS_PBS,
|
||||
PARAM_MULTI_BIT_MESSAGE_2_CARRY_2_GROUP_3_KS_PBS,
|
||||
PARAM_MULTI_BIT_MESSAGE_3_CARRY_3_GROUP_3_KS_PBS,
|
||||
PARAM_MULTI_BIT_MESSAGE_1_CARRY_1_GROUP_4_KS_PBS,
|
||||
]
|
||||
.iter()
|
||||
.map(|params| {
|
||||
@@ -311,30 +312,32 @@ fn multi_bit_pbs<
|
||||
tfhe::core_crypto::prelude::CiphertextModulus::new_native(),
|
||||
);
|
||||
|
||||
let id = format!("{bench_name}_{name}_parallelized");
|
||||
bench_group.bench_function(&id, |b| {
|
||||
b.iter(|| {
|
||||
multi_bit_programmable_bootstrap_lwe_ciphertext(
|
||||
&lwe_ciphertext_in,
|
||||
&mut out_pbs_ct,
|
||||
&accumulator.as_view(),
|
||||
&multi_bit_bsk,
|
||||
ThreadCount(10),
|
||||
);
|
||||
black_box(&mut out_pbs_ct);
|
||||
})
|
||||
});
|
||||
for thread_count in 10..25 {
|
||||
let id = format!("{bench_name}_{name}_parallelized_{thread_count}_threads");
|
||||
bench_group.bench_function(&id, |b| {
|
||||
b.iter(|| {
|
||||
multi_bit_programmable_bootstrap_lwe_ciphertext(
|
||||
&lwe_ciphertext_in,
|
||||
&mut out_pbs_ct,
|
||||
&accumulator.as_view(),
|
||||
&multi_bit_bsk,
|
||||
ThreadCount(thread_count),
|
||||
);
|
||||
black_box(&mut out_pbs_ct);
|
||||
})
|
||||
});
|
||||
|
||||
let bit_size = params.message_modulus.unwrap().ilog2();
|
||||
write_to_json(
|
||||
&id,
|
||||
*params,
|
||||
name,
|
||||
"pbs",
|
||||
&OperatorType::Atomic,
|
||||
bit_size,
|
||||
vec![bit_size],
|
||||
);
|
||||
let bit_size = params.message_modulus.unwrap().ilog2();
|
||||
write_to_json(
|
||||
&id,
|
||||
*params,
|
||||
name,
|
||||
"pbs",
|
||||
&OperatorType::Atomic,
|
||||
bit_size,
|
||||
vec![bit_size],
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -62,6 +62,8 @@ named_params_impl!( ShortintParameterSet =>
|
||||
PARAM_MULTI_BIT_MESSAGE_1_CARRY_1_GROUP_3_KS_PBS,
|
||||
PARAM_MULTI_BIT_MESSAGE_2_CARRY_2_GROUP_3_KS_PBS,
|
||||
PARAM_MULTI_BIT_MESSAGE_3_CARRY_3_GROUP_3_KS_PBS,
|
||||
// MiltiBit Group 4
|
||||
PARAM_MULTI_BIT_MESSAGE_1_CARRY_1_GROUP_4_KS_PBS,
|
||||
// CPK
|
||||
PARAM_MESSAGE_1_CARRY_1_COMPACT_PK_KS_PBS,
|
||||
PARAM_MESSAGE_1_CARRY_2_COMPACT_PK_KS_PBS,
|
||||
|
||||
@@ -208,6 +208,28 @@ pub const PARAM_MULTI_BIT_MESSAGE_3_CARRY_3_GROUP_3_KS_PBS: MultiBitPBSParameter
|
||||
deterministic_execution: false,
|
||||
};
|
||||
|
||||
// Group 4
|
||||
// p,log(nu), k, N, n, br_l,br_b, ks_l,ks_b, cost
|
||||
// 2, 2, 3, 9, 772, 1, 17, 2, 6, 20775164
|
||||
pub const PARAM_MULTI_BIT_MESSAGE_1_CARRY_1_GROUP_4_KS_PBS: MultiBitPBSParameters =
|
||||
MultiBitPBSParameters {
|
||||
lwe_dimension: LweDimension(772),
|
||||
glwe_dimension: GlweDimension(3),
|
||||
polynomial_size: PolynomialSize(512),
|
||||
lwe_modular_std_dev: StandardDev(0.000005915594083804978),
|
||||
glwe_modular_std_dev: StandardDev(0.0000000000039666089171633006),
|
||||
pbs_base_log: DecompositionBaseLog(17),
|
||||
pbs_level: DecompositionLevelCount(1),
|
||||
ks_base_log: DecompositionBaseLog(6),
|
||||
ks_level: DecompositionLevelCount(2),
|
||||
message_modulus: MessageModulus(2),
|
||||
carry_modulus: CarryModulus(2),
|
||||
ciphertext_modulus: CiphertextModulus::new_native(),
|
||||
encryption_key_choice: EncryptionKeyChoice::Big,
|
||||
grouping_factor: LweBskGroupingFactor(4),
|
||||
deterministic_execution: false,
|
||||
};
|
||||
|
||||
// Convenience aliases
|
||||
pub const DEFAULT_MULTI_BIT_GROUP_2: MultiBitPBSParameters =
|
||||
PARAM_MULTI_BIT_MESSAGE_2_CARRY_2_GROUP_2_KS_PBS;
|
||||
|
||||
Reference in New Issue
Block a user