Add orion entry dialect#2330
Conversation
589461d to
2b47779
Compare
|
CC @eymay |
eymay
left a comment
There was a problem hiding this comment.
Thanks for adding Orion frontend support. The PR looks clean to me, I pointed out some limitations of the translator in comments.
|
@eymay I did find it a bit strange that all the chebyshev ops emitted have a domain start/end as -1, 1 exactly, rather than some domain specific to the network/data distribution. Is that what you observed as well? Or does it indicate a bug on my part? |
|
@eymay sorry to keep bugging you again, but I also noticed that the |
I think this is a desired result from the Orion compilation, this is to ensure a stable polynomial approximation. So Orion normalizes the data distribution for polynomial approximation, from the Orion paper:
My default approach for the attributes in the Orion internal IR was to preserve them in the MLIR IR so they become explicit even if we don't end up using them. |
Please I appreciate the discussion. Yes Orion seems to just keep |
|
Ok, one change I want to make before this PR is submitted is to have the plaintext arguments be cleartext-typed, so that the function encodes them as plaintexts at runtime. This is not optimal, but we need the ability to rotate the plaintexts for the purpose of BSGS (to my knowledge none of these libraries support rotating an encoded plaintext; decoding just to rotate and re-encode seems silly). While we could pre-rotate the diagonals Orion produces in a manner specific to HEIR's implementation of BSGS, it seems quite brittle, and I suspect the runtime hit will not be that bad... |
Fixes #2328
This corresponds to 3a09186eef73f046d4eff1f32e6ba58f4c8da349 which runs orion and exports ckks + orion dialect MLIR.
From that project, after installing deps, I ran
Then ran the result through
heir-optwith this PR (which just extracted type aliases), and persisted the result to the lit tests in this PR