Skip to content

CK Tile Group GEMM gfx1250#576

Open
aris134 wants to merge 4 commits into
gfx1250from
amartin/ck-group-gemm-gfx1250-clean
Open

CK Tile Group GEMM gfx1250#576
aris134 wants to merge 4 commits into
gfx1250from
amartin/ck-group-gemm-gfx1250-clean

Conversation

@aris134
Copy link
Copy Markdown
Contributor

@aris134 aris134 commented May 6, 2026

Description

Extend the present CK tile grouped GEMM (F16/F8) implementation for compatibility with gfx1250. Replaces 3rdparty/aiter with 3rdparty/rocm-libraries for the gfx1250 changes from CK.

Fixes #16490

Type of change

  • Documentation change (change only to the documentation, either a fix or a new content)
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Infra/Build change
  • Code refactoring

Changes

Please list the changes introduced in this PR:

  • Change A
  • Change B

Checklist:

  • I have read and followed the contributing guidelines
  • The functionality is complete
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

@aris134 aris134 requested a review from wenchenvincent as a code owner May 6, 2026 17:54
@aris134 aris134 added the ci-level 1 CI test level 1 label May 6, 2026
@aris134 aris134 requested review from ipanfilo and wangye805 as code owners May 6, 2026 17:54
@aris134 aris134 assigned aris134 and unassigned matthiasdiener and aris134 May 6, 2026
@aris134 aris134 requested a review from matthiasdiener May 6, 2026 17:55
@aris134 aris134 changed the title CK Tile Group GEMM GFX1250 CK Tile Group GEMM gfx1250 May 6, 2026
// Currently only support cutlass group gemm on Hopper Arch
if (!(is_hopper && use_cutlass)) {
//if (!(is_hopper && use_cutlass)) {
if (!use_cutlass) {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

It is CUDA path

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Reverted in 752e0d3

using type = TileCfg_256x256x64_WMMA;
};

template <GPUArch Arch>
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Why does it need template over reguler if-else or switch-case?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The template is needed because the arch selection affects CK kernel template instantiation, not just runtime control flow. GPUArch must be a compile-time value so if constexpr can prune unsupported tile/kernel combinations for a given architecture. In this case, it prevents the MFMA configs from being instantiated for gfx1250.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I didn't compile it with gfx1250 arch only but I was still puzzled about this templated dispatch. In line 298, you still rely on runtime detect_gpu_arch() to branch to specific ck_tile_grouped_gemm_fp16_dispatch_arch<arch_id>'s. So I presume all three arches verions will still be instantiated? And I didn't see any compile time guarding?

@aris134 aris134 requested a review from ipanfilo May 11, 2026 13:04
Comment on lines +90 to +92
if (arch == 125 || arch == 1250) {
return GPUArch::GFX1250;
}
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Why do we want to host two possible arch ids for gfx1250? Is it because in some docker image, it shows 125 but in other docker images it shows 1250?

Comment on lines +57 to +63
static constexpr ck_tile::index_t M_Warp_Tile = 16;
static constexpr ck_tile::index_t N_Warp_Tile = 16;
static constexpr ck_tile::index_t K_Warp_Tile = 32;

static constexpr bool kPadM = true;
static constexpr bool kPadN = true;
static constexpr bool kPadK = true;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

so the difference btw TileCfg_256x256x64_MFMA and TileCfg_256x256x64_WMMA is inside M, N, K warp tile and kPads?

using type = TileCfg_256x256x64_WMMA;
};

template <GPUArch Arch>
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I didn't compile it with gfx1250 arch only but I was still puzzled about this templated dispatch. In line 298, you still rely on runtime detect_gpu_arch() to branch to specific ck_tile_grouped_gemm_fp16_dispatch_arch<arch_id>'s. So I presume all three arches verions will still be instantiated? And I didn't see any compile time guarding?

COMPILE_OPTIONS "-g0;-dopt=on")
else()
set(CK_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/../../3rdparty/aiter/3rdparty/composable_kernel)
set(CK_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/../../3rdparty/rocm_libraries/projects/composablekernel)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

nit: Will the whole rocm_libraries too big? Do we have a way to have sparse check out for this ck subdir?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci-level 1 CI test level 1

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants