Skip to content

[release/2.13] [ROCm] Add initial support for gfx1250 + disable CK GEMM when gfx1250-only - #3507

Draft
ethanwee1 wants to merge 2 commits into
release/2.13from
ethanwee/enable-gfx1250-2.13
Draft

[release/2.13] [ROCm] Add initial support for gfx1250 + disable CK GEMM when gfx1250-only#3507
ethanwee1 wants to merge 2 commits into
release/2.13from
ethanwee/enable-gfx1250-2.13

Conversation

@ethanwee1

Copy link
Copy Markdown

Summary

Enable initial gfx1250 (CDNA5) support on release/2.13, matching what
release/2.12 already has. release/2.13 did not previously contain the
gfx1250 enablement (it lacks upstream pytorch#188597 / #3421), so
this brings it in line and additionally adds the single-arch CK-GEMM guard.

Changes

  1. Cherry-pick of [release/2.12] [ROCm] Add initial support for gfx1250 (#188597) #3421 ("[release/2.12] [ROCm] Add initial
    support for gfx1250 ([ROCm] Add initial support for gfx1250 pytorch/pytorch#188597)") onto release/2.13:

    • hipBLASLt / hipSparseLt gfx1250 arch gating (ROCm 7.14+)
    • scaled GEMM / MX-format (Float8_e8m0fnu, mxfp8, mxfp4) paths for gfx1250
    • gfx1250 320 KB shared-memory limit
    • CDNA2/CDNA3/CDNA5 "or later" arch helpers + FP8/MX test gating
    • CK GEMM built as a separate ck_gemm library with gfx1250 filtered out of
      HIP_ARCHITECTURES (so multi-arch builds that include gfx1250 keep CK GEMM
      for the other archs instead of failing to compile for gfx1250)
    • int4 mm / CK SDPA / FP8 grouped GEMM left unsupported on gfx1250 (skipped)
  2. Single-arch CK-GEMM guard (cmake/Dependencies.cmake): when gfx1250 is
    the only arch, disable USE_ROCM_CK_GEMM before the -DUSE_ROCM_CK_GEMM
    flag is added, so both the CK GEMM sources and their call sites compile out
    consistently and single-arch gfx1250 builds link cleanly. This ports the
    fix from [release/2.12] Disable CK GEMM/SDPA when gfx1250 is the only arch #3458 (release/2.12) and [ROCm] Disable CK GEMM/SDPA when gfx1250 is the only arch pytorch/pytorch#190683 (upstream main).

Companion PRs

Validation

TheRock dev builds for gfx1250 (single-arch + multi-arch) to be linked here.

rraminen and others added 2 commits July 27, 2026 21:21
#3421)

## Summary

Validation theRock Run:
https://github.com/ROCm/TheRock/actions/runs/29045360944

Cherry-pick of upstream
[pytorch#188597](pytorch#188597)
onto `release/2.12` to add initial ROCm support for **gfx1250 (CDNA5)**.

Co-authored-by: @glen-amd

### What this PR enables
- Gates gfx1250-specific behavior on ROCm 7.14+ (the support floor),
applied consistently across CUDABlas.cpp, ScaledBlas.cpp, CUDAHooks.cpp,
and the test helpers.
- Adds gfx1250 to the hipBLASLt preferred/supported arch lists and the
hipSparseLt support check (ROCm 7.14+).
- Extends the scaled GEMM / MX-format paths (block-wise Float8_e8m0fnu,
mxfp8, mxfp4) to gfx1250.
- Sets the gfx1250 shared-memory limit to 320 KB (vs 160 KB on gfx950),
matching on the suffix-stripped arch name.
- Adds CDNA2/CDNA3/CDNA5 "or later" arch helpers and updates FP8 / MX
GEMM test gating in common_cuda.py.
- Builds Composable Kernel (CK) GEMM as a separate ck_gemm library with
gfx1250 filtered out of HIP_ARCHITECTURES, so a multi-arch build that
includes gfx1250 keeps CK GEMM for the other archs instead of failing to
compile for gfx1250 (composable_kernel has no gfx1250 support yet). The
filter is removed once CK supports gfx1250.
- Extends the gfx942 nontemporal vectorized-load path in
MemoryAccess.cuh to gfx1250.
- Refactors duplicated arch-check logic in CUDABlas.cpp, ScaledBlas.cpp,
and cuSPARSELtOps.cpp per review feedback.
- Writes the CublasHandlePool workspace archs in full
(gfx942/gfx950/gfx1250).

Enabled via the main merge:
- Flash attention and memory-efficient attention on gfx1250 via AOTriton
0.12.1b (from pytorch#188242), which this branch merges in.

What is not enabled yet:
- CK SDPA on gfx1250: composable_kernel has no gfx1250 support; the CK
SDPA target auto-filters to gfx942/gfx950.
- CK GEMM on gfx1250: filtered out (see above) until composable_kernel
supports it.
- FP8 grouped GEMM on gfx1250: MSLK builds only gfx942/gfx950.
- int4 mm on gfx1250: the tinygemm MFMA kernel needs a WMMA port; the
ops return a clear "not supported yet" error and the int4 unit tests
skip gfx1250.

CI note:
- gfx1250 is not added to the ROCm 7.2 (rocm-n) docker image, whose HIP
compiler cannot target gfx1250. gfx1250 CI belongs on the nightly ROCm
image and is added in a follow-up.

Co-authored-by: @glen-amd

## References

- Upstream PR: pytorch#188597
- Related AOTriton bump: pytorch#188242

---------

Co-authored-by: Prachi Gupta <prachi.gupta@amd.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-authored-by: Jeff Daily <jeff.daily@amd.com>
composable_kernel has no gfx1250 support yet. When gfx1250 is the only
arch in PYTORCH_ROCM_ARCH, disable USE_ROCM_CK_GEMM before the
-DUSE_ROCM_CK_GEMM flag is added in cmake/Dependencies.cmake, so both the
CK GEMM sources and their call sites are compiled out consistently and
single-arch gfx1250 builds link cleanly. Multi-arch builds are unaffected
(ck_gemm is still built as a separate library with gfx1250 filtered out).

Ports the release/2.12 fix (#3458 / pytorch#190683) to
release/2.13.
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