google / heir

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

Multiplicative and Additive Balancing #836

Open lawrencekhlim opened 3 months ago

lawrencekhlim commented 3 months ago

Given a tree of associative operations, say (((a b) c) d), then rebalance the tree to be (a b) (c d). This improves performance because the latter lowers the multiplicative depth by one. One can implement the algorithm provided in this paper: https://eprint.iacr.org/2021/1505.pdf.

This can also be useful for Additive Operations because it means that Additive Operations can be parallelized with better performance.

EDIT: This issue is addressed by #878, see below for more TODOs for a starter project. See also #837 for a distributive property optimization.

AlexanderViand-Intel commented 3 months ago

Sorry, I didn't see this before replying on #837 so I'll just leave a link to my comment there: https://github.com/google/heir/issues/837#issuecomment-2257586402

lawrencekhlim commented 2 months ago

This issue is addressed by PR #878, but there are more improvements that can be done, which are left as future tasks: