Stream and Flow canonicalization handle workgroup_count_from_slice workload deduplication inconsistently #24813
boydjohnson
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Intro
I am working on a project to write a compiler and runtime for RK3588 NPUs using IREE (https://github.com/boydjohnson/iree-rocket). My general approach for the compiler is using MLIR Transform Dialect with IREE.
Issue
I noticed that Stream --iree-stream-fold-uniform-operands leaves workgroup_count_from_slice(%H, %H, %C) when H and W can be shown to be the same value. I would have expected workgroup_count_from_slice(%H, %C) because the ordinals get remapped in the the same pass.
Before Pass
After Pass
when workgroup_count_from_slice(%H, %C) you get 0 -> %H, 0-> %H, 1 -> %C
when workgroup_count_from_slice(%H, %H, %C) you get 0 -> %H 0-> %H, 1 -> %H
This causes
Flow --iree-flow-canonicalize gives workgroup_count_from_slice(%H, %C)
Stream --iree-stream-fold-uniform-operands give workgroup_count_from_slice(%H, %H, %C)
Flow
Stream unit test
workgroup_count_from_slice lowering
All reactions