Skip to content

[SYCL][HIP] Add gfx90a joint_matrix float/float MFMA combinations#3

Open
zjin-lcf wants to merge 1 commit into
amd-matrix-gfx942from
amd-matrix-gfx90a-fp32
Open

[SYCL][HIP] Add gfx90a joint_matrix float/float MFMA combinations#3
zjin-lcf wants to merge 1 commit into
amd-matrix-gfx942from
amd-matrix-gfx90a-fp32

Conversation

@zjin-lcf

Copy link
Copy Markdown
Owner

Summary

  • gfx90a (CDNA2 / MI2xx) supports the one-block F32 MFMA instructions V_MFMA_F32_16X16X4F32 and V_MFMA_F32_32X32X2F32 (Table 25 of the MI200 CDNA2 ISA), but joint_matrix only exposed fp16/bf16/int8/fp64.
  • Enable the missing fp32 (float in, float out) combinations, shapes 16x16x4 and 32x32x2, mirroring existing gfx942 support: ungate the fp32 mad path, add the static query + runtime matrix_combinations entries, and update the docs table.

Stacked on

  • Based on the gfx942 PR (base branch amd-matrix-gfx942). Retarget to sycl once that merges.

Test plan

  • New matrix-hip-float-float-test.cpp (check_device_code) — FileCheck for mfma.f32.16x16x4f32 / mfma.f32.32x32x2f32.
  • Extended E2E joint_matrix_hip_gfx90a.cpp, runtime_query_hip_gfx90a.cpp, and compile-query-hip-gfx90a.cpp.
  • Verified on AMD Instinct MI210 (gfx90a): E2E + runtime-query tests pass, including numerical correctness of the fp32 MFMA results.

CDNA2 (gfx90a / MI2xx) supports the one-block F32 MFMA instructions
V_MFMA_F32_16X16X4F32 and V_MFMA_F32_32X32X2F32 (Table 25 of the MI200
CDNA2 ISA), but joint_matrix only exposed fp16/bf16/int8/fp64. Enable the
missing fp32 (float in, float out) combinations, shapes 16x16x4 and
32x32x2, mirroring the existing gfx942 support:

- matrix-hip.hpp: drop the inner gfx94x-only guard so the fp32 mad path
  also compiles for gfx90a (the builtins exist on all supported CDNA parts).
- static-query-use.hpp: add float/float to the gfx90a type and combination
  checks.
- device_impl.hpp: add the two fp32 combinations to the gfx90a runtime
  matrix_combinations list.
- Update the AMD gfx90a supported-combinations doc table.
- Add/extend tests: check_device_code (matrix-hip-float-float-test.cpp),
  E2E joint_matrix_hip_gfx90a.cpp, runtime_query_hip_gfx90a.cpp and
  compile-query-hip-gfx90a.cpp.

Verified on AMD Instinct MI210 (gfx90a): the E2E and runtime-query tests
pass, including numerical correctness of the fp32 MFMA results.

Co-authored-by: Cursor <cursoragent@cursor.com>
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.

1 participant