google / heir

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

Avoid fully unrolling loops for insert-rotate #589

Open j2kun opened 5 months ago

j2kun commented 5 months ago

After https://github.com/google/heir/pull/587 the box_blur_64x64 test takes ~53 minutes to compile (up from 1.5 minutes) and canonicalizer takes ~50 minutes of that (95%). Long term we're going to need to be able to run our analyses without doing full loop unrolls, and in this case it's primarily to support identifying a target slot for a given op, or perhaps identifying an affine map that converts the extraction index to its target slot that applies to the whole loop, and upgrading insert-rotate to handle loops.

github-actions[bot] commented 5 months ago

This issue has 1 outstanding TODOs:

This comment was autogenerated by todo-backlinks

j2kun commented 5 months ago

A long-term plan for this is mentioned in the HEIR open meeting notes for 2024-04-04 https://docs.google.com/document/d/121_0mzqYIWYMc7rcW2Et5qS-ux4ut3b-kno1dI9sQq8/edit?usp=sharing

j2kun commented 4 months ago

After https://github.com/google/heir/pull/601 this should be slightly lower priority: by applying folders before canonicalize, we were able to reduce the runtime hit of unrolling loops.