-
Notifications
You must be signed in to change notification settings - Fork 147
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: key compression always #726
Conversation
@@ -347,7 +347,7 @@ def _get_training_quantized_module( | |||
# Enable the underlying FHE circuit to be composed with itself | |||
# This feature is used in order to be able to iterate in the clear n times without having | |||
# to encrypt/decrypt the weight/bias values between each loop | |||
configuration = Configuration(composable=True) | |||
configuration = Configuration(composable=True, compress_evaluation_keys=True) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
compress pbs keys for training
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
which makes me thinkg, it should be using enable_input_compression
as well here !
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, you're right, same as for DF which was not enabled before
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
actually same as below, we should probably revert this change : it's enabled by QM's compilation anyway, so it's a bit confusing to add it here
DF is different because it directly compiles with CP tho yes
@@ -40,6 +40,8 @@ def run_hybrid_llm_test( | |||
# Multi-parameter strategy is used in order to speed-up the FHE executions | |||
configuration = Configuration( | |||
single_precision=False, | |||
compress_input_ciphertexts=True, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these circuits can be fully leveled or not, always good to test with default compilation parameters
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so why not also enabling key compression ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it is enabled by the QM compilation (the env variable defaults to 1)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so is compress_input_ciphertexts
then right ? imo either we put both here or we revert this small change 🤔
@@ -120,6 +122,8 @@ def function_to_compile(x): | |||
enable_unsafe_features=is_fast, | |||
use_insecure_key_cache=is_fast, | |||
insecure_key_cache_location=keyring_dir_as_str, | |||
compress_input_ciphertexts=True, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sanity checks should run with default compile parameters
conftest.py
Outdated
@@ -173,6 +174,7 @@ def simulation_configuration(): | |||
fhe_simulation=True, | |||
fhe_execution=False, | |||
compress_input_ciphertexts=os.environ.get("USE_INPUT_COMPRESSION", "1") == "1", | |||
compress_eval_keys=True, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tests should use the default for compressed keys, which is True
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
imo we shouldn't force it like this but do like for input compression, meaning we use env variables. The main reason is that forcing it like this makes it impossible to disable it for tests or other things through input configuration
objects. Basically this is what I reverted for fhe/simu exec in #724 (which is going to conflict a bit with your PR btw)
additionally we probably want to add tests to make sure that the compression properly works, like we did for input compression
82f7ef0
to
0b7e4e4
Compare
0b7e4e4
to
3a8dca0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks !! I think we could add a few small things in a follow up PR
Coverage passed ✅Coverage details
|
Enable key compression for all models