Make smarter choices about unrolling loops vis-a-vis bootstrapping iter args
- Dominant language
- MLIR
- Stars
- 906
- Forks
- 171
- Avg merge
- 4d 12h
- Merged PRs (30d)
- 32
Description
TODOs from https://github.com/google/heir/pull/2538
When doing HALO-style loop unrolling, we look at all iter args and see how many levels are consumed by the loop, and use the level consumption to determine how much to unroll the loop. In the case that there are multiple iter args, we take the max level consumption over all iter_args, which means we unroll conservatively. It may be the case that it is better to unroll more, while inserting extra bootstraps in the loop body for the iter_arg that has more level consumption. An extreme case would be one iter_arg consuming a single level while the other consumes many levels.
To support this, it requires a pass that can analyze the estimated latency of the loop body for a candidate loop unroll factor (which may require a target-specific model, cf. https://github.com/google/heir/issues/2554). It also potentially requires a smarter bootstrap placement algorithm for the loop body. HALO relies on DaCapo-style bootstrap placement in their work, and as of this writing we still just have waterline-bootstrapping.
Contributor guide
Assessment
This issue has not been assessed yet.