Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[GPU][NFC] Follow the official convention to define mfma/wmma attributes #18127

Merged
merged 2 commits into from
Aug 6, 2024

Conversation

hanhanW
Copy link
Contributor

@hanhanW hanhanW commented Aug 6, 2024

The LLVM intrinsics and official docs are all using [output_type]_MxNxK_[input_type] format. The revision updates IREE's definitions to follow the convention.

Some examples from official docs:

This patch is generated by the below commands:

cd compiler
sed -i "s/MFMA_F16_16x16x16_F32/MFMA_F32_16x16x16_F16/g" **/*.mlir
sed -i "s/MFMA_F16_16x16x16_F32/MFMA_F32_16x16x16_F16/g" **/*.td
sed -i "s/MFMA_F16_16x16x16_F32/MFMA_F32_16x16x16_F16/g" **/*.cpp
sed -i "s/MFMA_F16_16x16x16_F32/MFMA_F32_16x16x16_F16/g" **/*.h
sed -i "s/MFMA_F16_32x32x8_F32/MFMA_F32_32x32x8_F16/g" **/*.mlir
sed -i "s/MFMA_F16_32x32x8_F32/MFMA_F32_32x32x8_F16/g" **/*.td
sed -i "s/MFMA_F16_32x32x8_F32/MFMA_F32_32x32x8_F16/g" **/*.h
sed -i "s/MFMA_F16_32x32x8_F32/MFMA_F32_32x32x8_F16/g" **/*.cpp
sed -i "s/MFMA_F8E4M3FNUZ_16x16x32_F32/MFMA_F32_16x16x32_F8E4M3FNUZ/g" **/*.mlir
sed -i "s/MFMA_F8E4M3FNUZ_16x16x32_F32/MFMA_F32_16x16x32_F8E4M3FNUZ/g" **/*.td
sed -i "s/MFMA_F8E4M3FNUZ_16x16x32_F32/MFMA_F32_16x16x32_F8E4M3FNUZ/g" **/*.h
sed -i "s/MFMA_F8E4M3FNUZ_16x16x32_F32/MFMA_F32_16x16x32_F8E4M3FNUZ/g" **/*.cpp
sed -i "s/MFMA_I8_16x16x32_I32/MFMA_I32_16x16x32_I8/g" **/*.mlir
sed -i "s/MFMA_I8_16x16x32_I32/MFMA_I32_16x16x32_I8/g" **/*.td
sed -i "s/MFMA_I8_16x16x32_I32/MFMA_I32_16x16x32_I8/g" **/*.h
sed -i "s/MFMA_I8_16x16x32_I32/MFMA_I32_16x16x32_I8/g" **/*.cpp
sed -i "s/MFMA_I8_32x32x16_I32/MFMA_I32_32x32x16_I8/g" **/*.mlir
sed -i "s/MFMA_I8_32x32x16_I32/MFMA_I32_32x32x16_I8/g" **/*.td
sed -i "s/MFMA_I8_32x32x16_I32/MFMA_I32_32x32x16_I8/g" **/*.h
sed -i "s/MFMA_I8_32x32x16_I32/MFMA_I32_32x32x16_I8/g" **/*.cpp

The LLVM intrinsics and official docs are all using
`[output_type]_MxNxK_[input_type]` format. The revision updates IREE's
definitions to follow the convention.

Some examples from official docs:

- https://gpuopen.com/learn/wmma_on_rdna3/
- https://gpuopen.com/learn/amd-lab-notes/amd-lab-notes-matrix-cores-readme/
- https://github.com/ROCm/amd_matrix_instruction_calculator

Signed-off-by: hanhanW <[email protected]>
Copy link
Contributor

@antiagainst antiagainst left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks @hanhanW! i was a bit wanting to fix inconsistency before..

@hanhanW hanhanW enabled auto-merge (squash) August 6, 2024 22:53
@hanhanW hanhanW merged commit 82012e6 into iree-org:main Aug 6, 2024
40 of 44 checks passed
@hanhanW hanhanW deleted the gpu-enum-intrinsics branch August 6, 2024 23:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants