Repository navigation
[release/2.13] [ROCm] Consolidate CK GEMM arch gating into a single allow-list - #3979
Merged
Merged
Conversation
Backport of the CK GEMM single-source allow-list to release/2.13. Replaces the gfx1250 blacklist (list(REMOVE_ITEM ... gfx1250 gfx1250-strict)) with a single CMake cache variable TORCH_CK_GEMM_ARCH_LIST (default gfx90a;gfx942;gfx950) that drives the ck_gemm build arch filter (torch_filter_ck_gemm_arches) and is surfaced to C++ via a generated ATen/ROCmCKGEMMConfig.h header. release/2.13 predates the CK SDPA/GEMM gating split (upstream pytorch#187267) and had no ckGemmSupported() -- only a combined ckSupported(). This adds Context::ckGemmSupported() (parsing TORCH_CK_GEMM_ARCH_LIST via a shared parseArchList helper) and routes the CK blas-backend gate through it, leaving the CK SDPA / flash-attention gates on ckSupported(). The ck_gemm_{half,bfloat16}.hip dispatch calls at::globalContext().ckGemmSupported() instead of an isGPUArch({"gfx9"}) prefix check. TORCH_CK_GEMM_ARCH_LIST is forwarded from the environment via cmake/EnvVarForwarding.cmake. Squashed backport of upstream pytorch/pytorch pytorch#200307 (base allow-list) and pytorch#201113 (TORCH_CK_GEMM_ARCH_LIST consolidation). Co-Authored-By: Claude Opus 4.8 <[email protected]>
pragupta
marked this pull request as ready for review
November 9, 2026 19:40
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backport of the CK GEMM single-source allow-list to release/2.13. Replaces the gfx1250 blacklist (list(REMOVE_ITEM ... gfx1250 gfx1250-strict)) with a single CMake cache variable TORCH_CK_GEMM_ARCH_LIST (default gfx90a;gfx942;gfx950) that drives the ck_gemm build arch filter (torch_filter_ck_gemm_arches) and is surfaced to C++ via a generated ATen/ROCmCKGEMMConfig.h header.
release/2.13 predates the CK SDPA/GEMM gating split (upstream pytorch#187267) and had no ckGemmSupported() -- only a combined ckSupported(). This adds Context::ckGemmSupported() (parsing TORCH_CK_GEMM_ARCH_LIST via a shared parseArchList helper) and routes the CK blas-backend gate through it, leaving the CK SDPA / flash-attention gates on ckSupported(). The ck_gemm_{half,bfloat16}.hip dispatch calls at::globalContext().ckGemmSupported() instead of an isGPUArch({"gfx9"}) prefix check. TORCH_CK_GEMM_ARCH_LIST is forwarded from the environment via cmake/EnvVarForwarding.cmake.
Squashed backport of upstream pytorch/pytorch pytorch#200307 (base allow-list) and pytorch#201113 (TORCH_CK_GEMM_ARCH_LIST consolidation).
Once these are merged need to revert ROCm/TheRock#9414