google / heir

A compiler for homomorphic encryption
https://heir.dev/
Apache License 2.0
289 stars 40 forks source link

feat: Integrate tools to optimize circuits #111

Closed asraa closed 7 months ago

asraa commented 1 year ago

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

We can take a high-level arithmetic program and create optimization passes that can invoke tools like Yosys and ABC to optimize and output a combinational circuit.

The combinational circuit can then be lowered to boolean FHE schemes.

asraa commented 1 year ago

See this other tool here: https://github.com/lsils/mockturtle

And some discussion about this here: https://discourse.llvm.org/t/integration-with-abc-optimizer/65264/2

asraa commented 1 year ago

I think it would be nice to go

Arith / other high-level -> Combinational logic block -> [ABC Transform] -> Optimized combinational logic block

Combinational logic can then be lowered to schemes that support boolean gates / luts.

asraa commented 1 year ago

I also noticed this ArithToCombPass from CIRCT: https://github.com/llvm/circt/blob/main/include/circt/Transforms/Passes.td#L56C5-L71

j2kun commented 10 months ago

I think we can mark this one as fixed now.

github-actions[bot] commented 8 months ago

[!NOTE] Re-commenting because this issue was closed with unresolved TODOs.

This issue has 2 outstanding TODOs:

This comment was autogenerated by todo-backlinks

j2kun commented 8 months ago

Reopening so we can migrate the TODOs to new issues