8000 Port Orion to HEIR · Issue #269 · google/heir · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Port Orion to HEIR #269

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

Open
j2kun opened this issue Nov 17, 2023 · 3 comments
Open

Port Orion to HEIR #269

j2kun opened this issue Nov 17, 2023 · 3 comments
Labels
research synthesis Reading papers to figure out which ideas can be incorporated

Comments

@j2kun
Copy link
Collaborator
j2kun commented Nov 17, 2023

The Orion paper has a PyTorch -> Lattigo lowering with some ML-specific CKKS packing strategies. We should port their work to HEIR. It would be a good start to arithmetic-FHE for ML in HEIR, and give us another front-end (via torch-mlir), and a starting point for lowering meaningful programs to a CKKS dialect.

This would require at least:

  • Having a recipe to go from PyTorch to TOSA (probably we don't need to integrate torch-mlir proper into this project)
  • A Lattigo exit dialect with the relevant ops
  • A lowering TOSA -> lattigo
  • Somewhere to put the optimizations from the paper
@j2kun j2kun added the research synthesis Reading papers to figure out which ideas can be incorporated label Nov 27, 2023
@j2kun
Copy link
Collaborator Author
j2kun commented Jan 16, 2025

After the talk they gave at Google, I'm reinvigorated to support their convolution method, which is a variant of SISO using a baby-step-giant-step method that seems very efficient.

The bootstrap placement algorithm they use also seems nice, but is a bit more complicated. In short, it seems to require simulating the neural network layer latency in order to build a graph, and then run a series of shortest-path algorithms to determine how to insert bootstrap ops. The main obstacle here is the simulation, which I believe is dataset specific. While we still don't have a sense of how we might incorporate such things into HEIR, we have had other cases in which knowing about the dataset can help the compiler be more optimal (e.g., in picking a polynomial approximation).

@AlexanderViand
Copy link
Collaborator

Looks like the code was open-sourced last month! https://github.com/baahl-nyu/orion

@j2kun
Copy link
Collaborator Author
j2kun commented May 1, 2025

Just a quick peek: looks like they also do tracing to get per-node min/max stats for poly eval: https://github.com/baahl-nyu/orion/blob/f0581052b28d02a00299cce742949930b3260aa8/orion/core/tracer.py#L149. This may help inform #1700

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
research synthesis Reading papers to figure out which ideas can be incorporated
Projects
None yet
Development

No branches or pull requests

2 participants
0