feat(frontend-python): Expose compress_input_ciphertexts as a compilation options and tests

This commit is contained in:
Bourgerie Quentin
2024-03-12 11:30:22 +01:00
parent 3043573922
commit 9dcf1c4b6f
5 changed files with 84 additions and 0 deletions

View File

@@ -713,6 +713,10 @@ void mlir::concretelang::python::populateCompilerAPISubmodule(
[](CompilationOptions &options, bool b) {
options.compressEvaluationKeys = b;
})
.def("set_compress_input_ciphertexts",
[](CompilationOptions &options, bool b) {
options.compressInputCiphertexts = b;
})
.def("set_optimize_concrete", [](CompilationOptions &options,
bool b) { options.optimizeTFHE = b; })
.def("set_p_error",

View File

@@ -113,6 +113,19 @@ class CompilationOptions(WrapperCpp):
raise TypeError("can't set the option to a non-boolean value")
self.cpp().set_compress_evaluation_keys(compress_evaluation_keys)
def set_compress_input_ciphertexts(self, compress_input_ciphertexts: bool):
"""Set option for compression of input ciphertexts.
Args:
compress_input_ciphertexts (bool): whether to turn it on or off
Raises:
TypeError: if the value to set is not boolean
"""
if not isinstance(compress_input_ciphertexts, bool):
raise TypeError("can't set the option to a non-boolean value")
self.cpp().set_compress_input_ciphertexts(compress_input_ciphertexts)
def set_verify_diagnostics(self, verify_diagnostics: bool):
"""Set option for diagnostics verification.