heir icon indicating copy to clipboard operation
heir copied to clipboard

Add HALO/DaCapo frontend to HEIR

Open asraa opened this issue 1 month ago • 3 comments

Related: https://github.com/google/heir/issues/289

DaCapo / HALO are also MLIR based compilers, and they define an EARTH dialect, and then optimize it and create a CKKS dialect. It would be great to add a translation from their optimized CKKS dialect to a HEIR dialect. I think their CKKS dialect is fairly similar to ours, so it might be possible to just write an importer directly into the CKKS dialect?

Their dialect already includes modswitch and noise management operations, but I don't know how that will interact with us lowering to the Openfhe backend (whether the parameters selected with Openfhe will be compatible)

asraa avatar Nov 03 '25 17:11 asraa

I think for consistency with other frontends (and uncertainty in the hurdles that will come up when doing the translation) it would be best to have an entry dialect for HALO even if the translation to ckks ends up being a trivial 1-1 mapping of op names.

j2kun avatar Nov 03 '25 18:11 j2kun

For reference, here is a link to the CKKS dialect in Halo: https://github.com/corelab-src/elasm/tree/main/include/hecate/Dialect/CKKS/IR. There appear to be enough ops that are not in ckks (e.g., upscale) that a dedicated entry dialect would be best.

We should be able to just copy their tablegen as a starting point.

j2kun avatar Nov 03 '25 18:11 j2kun

I think it might be this link now https://github.com/corelab-src/dacapo/tree/dacapo/include/hecate/Dialect/CKKS/IR

ah they're just a port

asraa avatar Nov 03 '25 18:11 asraa