Add type inference for LWE/CKKS ops#2412
Merged
copybara-service[bot] merged 1 commit intogoogle:mainfrom Nov 17, 2025
Merged
Conversation
Collaborator
Author
|
For the reviewer: I'm looking for some extra scrutiny on the logic of the type inference, to make sure I'm not incorrectly dropping limbs or dividing by the wrong moduli. |
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.
This came up in the conversion from Orion to CKKS (#2326). That line of work requires me to reimplement chebyshev evaluation and the halevi-shoup kernel, but at the level of CKKS with parameters pre-selected.
#2338 is addressing the finer points of that conversion, but in the mean time it has proven helpful to extend the result type inference capabilities of the LWE/CKKS dialects, because when I insert ciphertext mgmt ops at the CKKS level, I need to re-walk the IR and re-infer result types for all ops.
Yes, I know this is what @ZenithalHourlyRate warned against and why we have mgmt at the higher level. Normally I wouldn't want to do this either, but for comparing against another compiler that handles ciphertext management and parameter selection itself, I don't see another way :)