Add an NTT/INTT and equivalence tests with OpenFHE#3088
Open
copybara-service[bot] wants to merge 1 commit into
Open
Add an NTT/INTT and equivalence tests with OpenFHE#3088copybara-service[bot] wants to merge 1 commit into
copybara-service[bot] wants to merge 1 commit into
Conversation
3ecf387 to
8b231d6
Compare
Collaborator
|
HI @crockeea , with apologies in advance, this is heavily LLM-generated code. But maybe it would suffice for a quick-and-dirty start to enable NTT constant folding in HEIR? |
8b231d6 to
fb01791
Compare
Nb., I am not an expert in NTT/INTT implementations, so I relied heavily on Gemini for the implementation. The equivalence tests should provide some additional certainty about the correctness of the implementation. The benchmark shows that for N=8192, Q=60 bits, this implementation is ~713.0 us, while OpenFHE's implementation is ~188.0 us. One might ask: why not just use OpenFHE's implementation directly? We could, but at least having a fallback free of any dependencies is probably a good idea. PiperOrigin-RevId: 930751144
fb01791 to
8ba58bf
Compare
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.
Add an NTT/INTT and equivalence tests with OpenFHE
Nb., I am not an expert in NTT/INTT implementations, so I relied heavily on Gemini for the implementation. The equivalence tests should provide some additional certainty about the correctness of the implementation. The benchmark shows that for N=8192, Q=60 bits, this implementation is ~713.0 us, while OpenFHE's implementation is ~188.0 us.
One might ask: why not just use OpenFHE's implementation directly? We could, but at least having a fallback free of any dependencies is probably a good idea.