mirror of
https://github.com/ROCm/ROCm.git
synced 2026-04-05 03:01:17 -04:00
This PR adds UpdateMmaForVolta pass to help update the MMA encoding for Volta. Some context is told in https://github.com/openai/triton/pull/1014 # Changes 1. Moving the related MMAv1 patterns from GPUCombine pass to UpdateMmaForVolta pass, 2. Updating both the versionMinor and warpsPerCTA fields for Volta MMA encodings since they could only be determined after the GPUCombine Pass, 3. Moving the FixupLoop pattern from the Combine.cpp to new Utility.h/.cpp files 4. Adding an ID field(takes 5 bits to store an integer) to versionMinor to help assigning a unique ID(on Volta) for each MMA encodings, the reason is as below - Currently, there is a cyclic dependency between {DotOperand, Slice} with MMA layouts, we use a map to help cluster all the DotOperand, Slice, and MMA layout instances into the same group for further updating in bulk - When there are multiple DotOps in a module with the same MMA(literally equivalent), it is possible to get the wrong groups - an ID field is used to help to identify the MMA from different DotOps, thus getting all the MMA, DotOperand, and Slice layout instances in the right groups