-
Notifications
You must be signed in to change notification settings - Fork 47
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
Secret to BGV to OpenFHE e2e pipeline #624
Conversation
OK this monster PR is working now, EXCEPT for one tiny detail: I can't figure out how to get the new Even if I run Edit: I think I understand now: the |
4b586ba
to
ca04b23
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.
Thank you for all the fixes to the config settings and adding the compilation flag!
Sub changes: - add public/private key types, encrypt/decrypt, and associated lowerings for BGV & OpenFHE - Add heir-opt.bzl for running heir-opt as part of a bazel macro - Improve the yosys enabling flags, env var override - Add OpenFHE codegen for index_cast, tensor-shaped arith.constant, tensor types, and encrypt/decrypt/encode/decode - Avoid unnecessary copies in generated OpenFHE code
Squashed and ready to pull |
This PR runs an end-to-end example (
simple_sum
) through theheir-simd-vectorizer
pipeline, with the newbgv-add-client-interface
, down to OpenFHE codegen, and runs the generated code in a test.Deficiencies (still need to file TODOs):
MakePackedPlaintext
will zero-pad to the ring degreeN
, and this breaks the rotate-and-reduce trick, so instead I have to manually repeat the coefficients cyclically until it fills the whole ciphertext. I'd like to add this to the encode helper, and it suggests a bunch more work to do if we have an input cleartext tensor that is not divisible by the OpenFHE's ring degree (rotate-and-reduce tricks won't work in that case, or will have to be tweaked to account for the true underlying ring degree).int64_t
casting to a higher-level lowering (say, from BGV to OpenFHE)The output code generated for simple_sum