Repository navigation
[LLVMGPU] Use forall workgroup distribution in TileAndFuse pipeline - #18565
Conversation
Can you share an example of this? If the collapse shape is at the end of workgroup for all, i'd expect we can fold it away with |
You can end up with IR like this: And it would not be correct in general to fold the collapse_shape into the parallel_insert_slice/forall dest. This collapse_shape comes from the tensor.unpack after PackToIntrinsics. Moving PackToIntrinsics and DecomposePackUnPack before workgroup distributions means the collapse_shape will be outside of the scf.forall already, and then the transpose from the unpack can be fused into the forall loop. Then, the collapse_shape can be folded into the |
6008d75 to
b50353c
Compare
b50353c to
25500cb
Compare
25fe98d to
c2435db
Compare
Signed-off-by: Max Dawkins <[email protected]>
c2435db to
13f3240
Compare
…peline (iree-org#18565)" This reverts commit c3fae2f.
…18565) This switches the TileAndFuse pipeline to use scf.forall distribution. Using scf.forall distribution also requires some changes to the pass ordering in the TileAndFuse pipeline, which is also handled by this PR: 1. The main difference is that PackToIntrinsics happens before workgroup distribution. Otherwise, collapse_shape ops can end up at the end of the workgroup forall, and an extra buffer is created. 2. Pack decomposition is now staged, with packs/unpacks at the function boundaries being decomposed early before workgroup decomposition, and the rest being decomposed after reduction tiling as before. This prevents unpacks being fused into the workgroup forall and causing the same problem as in (1). 3. `ConcretizeMmaShapes` now runs before workgroup tiling as well, so the resulting collapse_shape on the multi_mma op result can be propagated to the function boundary before any tiling. This is also to avoid the same problem as in (1). The lowering configs on the MMA path have also changed, since they now need to account for inner tile sizes of packing. depends on #18852 Signed-off-by: Max Dawkins <[email protected]> Signed-off-by: Elias Joseph <[email protected]>
This switches the TileAndFuse pipeline to use scf.forall distribution. Using scf.forall distribution also requires some changes to the pass ordering in the TileAndFuse pipeline, which is also handled by this PR:
createConcretizeMmaShapesnow runs before workgroup tiling as well, so the resulting collapse_shape on the multi_mma op result can be propagated to the function boundary before any tiling. This is also to avoid the same problem as in (1).The lowering configs on the MMA path have also changed, since they now need to account for inner tile sizes of packing.
depends on #18852