Closed zhanglx13 closed 7 months ago
@alefimov-amd I'd suggest we merge this one first since it lays a solid foundation for mfma instructions. You can rebase your mfma4x64 PR and make changes accordingly. I believe this can benefit us in the long run.
This PR refactors the logic of MFMA selection
versionMajor
,versionMinor
,MDim
, andNDim
to MfmaEncodingAttr and removenonKDim
versionMajor
is used to pick arch-specific mfma instructions.versionMinor
is not used for now.MDim
andNDim
indicate the two dimensions of the output of mfma instruction. This helps the mfma4 case where the output tensor has shape 4 x 64.AccelerateAMDMatmul
pass andDotOpToLLVM
lowering passmfmaVersion
comes from the frontend inAccelerateAMDMatmul
, and it is kept in the mfmaLayout.mfmaVersion
comes from the mfmaLayout inDotOpToLLVM
TODO:
versionMajor=2
limits the codegen to MI2xx GPUs. We might want to extend/replace it to/withversionMajor=3
for MI300 GPUs.