remove scheme flag from openfhe emitter#1302
Merged
copybara-service[bot] merged 1 commit intoJan 24, 2025
Merged
Conversation
j2kun
requested changes
Jan 23, 2025
68345ac to
41eab68
Compare
j2kun
approved these changes
Jan 24, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
As mentioned in today's meeting, no longer needing to specify the scheme as a flag makes building the compilation/translation pipeline much nicer, especially in the Python frontend.
The scheme flag was really only used for two decisions:
getModulePrelude, to decide whether to emitCryptoContextBGVRNSorCryptoContextCKKSRNSgetPackedPlaintextorgetCKKSPackedPlaintextand to check consistencyThe latter use was entirely redundant, as the encoding info on the op (or on the plaintext type of the result/operand) already clearly indicates what should be used. Ensuring consistency is now achieved via verifiers on
openfhe.make_packed_plaintextandopenfhe.make_ckks_packed_plaintext.Unfortunately, the first use wasn't quite as easy to get rid of and required introducing a (hopefully somewhat temporary) helper attribute: the
--secret-to-<scheme>passes now add an attribute to the module (e.g.,{bgv.scheme}) which the openfhe emitter inspects.