Repository navigation
[DispatchCreation] Normalize contraction dimensions outside dispatches - #24965
Conversation
Contractions with several contiguous M, N, K or batch dimensions can miss data-tiling encodings because dimension collapsing currently runs inside dispatches. Add a function pass that reuses the existing collapse rules outside dispatches and restores the original tensor shapes at the boundaries. Leave existing dispatches and operations with a preset compilation info or lowering config alone. No pipeline runs the pass yet. A follow-up adds it to an experimental route that assigns and materializes data-tiling layouts before dispatch formation. Co-Authored-By: Claude Opus 5.5 <[email protected]>
a8b799d to
5eca0c5
Compare
|
Thanks @maxbartel! LGTM One question though, if I understand it correctly the CollapseDimensions pass that runs during dispatch creation considers producer and consumer compatibility, whereas this pass considers each contraction independently. Why do we not need to do that here? |
CollapseDimensionsPass runs on dispatch regions that already exist. All the ops in a region have to agree on what to collapse or a reshape gets stuck inside the dispatch. Outside dispatches there's no region yet, so each contraction can be collapsed on its own. SinkReshapes cleans up the reshapes afterwards. |
Contractions with several contiguous M, N, K or batch dimensions can miss data-tiling encodings because dimension collapsing currently runs inside dispatches.
Add a function pass that reuses the existing collapse rules outside dispatches and restores the original tensor shapes at the op boundaries. Leave existing dispatches (regions and workgroups) and ops with a preset compilation info or lowering config alone, since those configurations refer to the original loops.
No pipeline runs the pass yet. #24969 adds it to the experimental early data-tiling route.
This is one of five PRs adding an experimental CPU path that materializes data-tiling layouts before dispatch creation, so that
linalg.mmt4dand data-tiled convolutions fuse with their elementwise epilogues and result unpacks.Assisted by AI.