-
Notifications
You must be signed in to change notification settings - Fork 62
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
BGV: Populate Moduli Chain from Noise Analysis #1379
BGV: Populate Moduli Chain from Noise Analysis #1379
Conversation
8900c2b
to
272604a
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.
I think attaching this to the module op is a good idea for now. Maybe @AlexanderViand-Intel might be able to better review the generation step, but otherwise I'm happy to merge it in after the noise model PR is merged in and this is rebased.
a6bee0d
to
ea689e2
Compare
Ready for review.
|
ea689e2
to
da1d6e5
Compare
Changed |
da1d6e5
to
7df9b9b
Compare
7df9b9b
to
4e32fbb
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.
LGTM!
Depends on #1343. Implements part of #1168.
For
dot_product.mlir
, it will generate the following parameter:Idea
The idea behind the parameter generation is simple: For each level, the mod reduce should be able to decrease the noise by that amount (e.g. from 69.5 to 23), so the modulus for that level should be at least 47 bit.
For special modulus, the selection is conservative in that we only make sure
P > Q / dnum
and make no other optimization. We default to the HYBRID key switching technique for now.I understand there are implementation using optimizers like KPZ21 and MML+23. This PR is meant for making the pipeline aware of concrete parameters, like
LWE
dialect and backend. Further PR could optimize the selection process.Current status / Discussion
--validate-noise
pass for simplicity. It should be separated into another pass use some attribute to communicate with other passes (e.g.bgv.schemeParam
attribute). Need design discussion.LWE
dialect (secret-to-bgv
) has not been touched. I now directly pass the generated parameter to attr, then backend will pick it up somewhere; further design should pass the information inLWE
Types and backend will get information there.@openfhe//nbtheory.h
. It is quite crude for now.Example
The noise analysis for the generated param
Note that there is nealy no budget given current param generation process. It is OK if we do have a correct bound.
Lattigo Output (using #1374).
Though for the last line it seems to indicate the error exceeds the allowed range, yet its decryption is correct. I will investigate more on the LattigoResolved by #1374 (comment), check the correct trace there.rlwe.Norm
function to understand what happened.