Repository navigation
[ROCm] Split CK SDPA vs CK GEMM arch gating - #187267
jagadish-amd wants to merge 3 commits into
Conversation
Gate preferred_blas_library CK on ckGemmSupported (includes gfx90a) and keep SDPA/ROCm FA on ckSPDASupported. Update _is_ck_sdpa_available accordingly. Skip test_ck_blas_library_mm bfloat16 on MI200 (gfx90a). Signed-off-by: Jagadish Krishnamoorthy <[email protected]>
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/187267
Note: Links to docs will display an error until the docs builds have been completed. ❌ 1 New Failure, 1 Unrelated Failure, 3 Unclassified FailuresAs of commit f4e6785 with merge base 40e21dc ( NEW FAILURE - The following job has failed:
UNCLASSIFIED FAILURES - DrCI could not classify the following jobs because the workflow did not run on the merge base. The failures may be pre-existing on trunk or introduced by this PR:
FLAKY - The following job failed but was likely due to flakiness present on trunk:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
Signed-off-by: Jagadish Krishnamoorthy <[email protected]>
alugorey
left a comment
There was a problem hiding this comment.
LGTM except lint error is real. After that's fixed should be good
|
|
|
@pytorchbot merge |
Merge startedYour change will be merged once all checks pass (ETA 0-4 Hours). Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
Merge failedReason: 1 mandatory check(s) failed. The first few are: Dig deeper by viewing the failures on hud |
|
@claude Analyze CI failures |
|
Claude finished @jeffdaily's task in 1m 34s —— View job CI Failure Analysis
Conclusion: none of the failures are related to this PR's changes. The merge was blocked solely by an infrastructure error in an aarch64 build job. 1. Merge-blocking failure (infra, not code)
This is a runner/container provisioning failure that occurs before any build or test runs — it has nothing to do with the CK gating changes. This is the check that caused 2. ROCm MI200 test failures (pre-existing numerical-tolerance failures, unrelated)All three failing shards failed on numerical
These are accuracy/tolerance failures on MI200 and are independent of the gating logic this PR touches. Dr. CI also flagged them as unclassified because the workflow didn't run on the merge base (so it couldn't auto-confirm them as pre-existing), but the failure signatures are clearly unrelated to CK. Notably, the CK BLAS test that this PR modifies ( 3. trunk / MI350 distributed (flaky)
RecommendationThe PR changes are sound and approved by two reviewers. The merge failure is purely the transient aarch64 container-init infra error. Suggested next step: to ignore the unrelated/infra failures, or simply re-trigger and re-merge once the aarch64 runner issue clears. No code changes are needed in this PR to address these failures. |
|
@pytorchbot merge -f "claude said it was okay" |
Merge startedYour change will be merged immediately since you used the force (-f) flag, bypassing any CI checks (ETA: 1-5 minutes). Please use Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
The CK Tile FMHA generator already compiles working kernels for gfx12 (--targets=gfx1201 passes through to the kernel template), but two guards prevented them from being used on RDNA4 hardware: 1. launch_kernel_pt.hpp: kentry_pt kernel entry stubs added in PR pytorch#144777 ([ROCm] CK SDPA - Move arch check to CK patch) had a hard-coded whitelist of gfx90a/gfx942/gfx950 (updated for gfx950 in PR pytorch#155103). gfx1200/gfx1201 were never added despite the CK Tile FMHA generator supporting them. 2. Context.cpp: ckSDPASupported() split from ckSupported() in PR pytorch#187267 ([ROCm] Split CK SDPA vs CK GEMM arch gating) only listed gfx942/gfx950. Added gfx1200/gfx1201. Tested on gfx1201 (RX 9070): WITHOUT patch the kernel ASSERTs, WITH patch the kernel executes correctly.
The CK Tile FMHA generator already compiles working kernels for gfx12 (--targets=gfx1201 passes through to the kernel template), but two guards prevented them from being used on RDNA4 hardware: 1. launch_kernel_pt.hpp: kentry_pt kernel entry stubs added in PR pytorch#144777 ([ROCm] CK SDPA - Move arch check to CK patch) had a hard-coded whitelist of gfx90a/gfx942/gfx950 (updated for gfx950 in PR pytorch#155103). gfx1200/gfx1201 were never added despite the CK Tile FMHA generator supporting them. 2. Context.cpp: ckSDPASupported() split from ckSupported() in PR pytorch#187267 ([ROCm] Split CK SDPA vs CK GEMM arch gating) only listed gfx942/gfx950. Added gfx1200/gfx1201. Tested on gfx1201 (RX 9070): WITHOUT patch the kernel ASSERTs, WITH patch the kernel executes correctly.
The CK Tile FMHA generator already compiles working kernels for gfx12 (--targets=gfx1201 passes through to the kernel template), but two guards prevented them from being used on RDNA4 hardware: 1. launch_kernel_pt.hpp: kentry_pt kernel entry stubs added in PR pytorch#144777 ([ROCm] CK SDPA - Move arch check to CK patch) had a hard-coded whitelist of gfx90a/gfx942/gfx950 (updated for gfx950 in PR pytorch#155103). gfx1200/gfx1201 were never added despite the CK Tile FMHA generator supporting them. 2. Context.cpp: ckSDPASupported() split from ckSupported() in PR pytorch#187267 ([ROCm] Split CK SDPA vs CK GEMM arch gating) only listed gfx942/gfx950. Added gfx1200/gfx1201. Tested on gfx1201 (RX 9070): WITHOUT patch the kernel ASSERTs, WITH patch the kernel executes correctly. Fixes pytorch#188113
Gate preferred_blas_library CK on ckGemmSupported (includes gfx90a) and keep SDPA/ROCm FA on ckSPDASupported. Update _is_ck_sdpa_available accordingly. Skip test_ck_blas_library_mm bfloat16 on MI200 (gfx90a). Pull Request resolved: pytorch#187267 Approved by: https://github.com/alugorey, https://github.com/jeffdaily Co-authored-by: Jeff Daily <[email protected]>
Gate preferred_blas_library CK on ckGemmSupported (includes gfx90a) and keep SDPA/ROCm FA on ckSPDASupported. Update _is_ck_sdpa_available accordingly. Skip test_ck_blas_library_mm bfloat16 on MI200 (gfx90a). Pull Request resolved: pytorch#187267 Approved by: https://github.com/alugorey, https://github.com/jeffdaily Co-authored-by: Jeff Daily <[email protected]>
The CK Tile FMHA generator already compiles working kernels for gfx12 (--targets=gfx1201 passes through to the kernel template), but two guards prevented them from being used on RDNA4 hardware: 1. launch_kernel_pt.hpp: kentry_pt kernel entry stubs added in PR #144777 ([ROCm] CK SDPA - Move arch check to CK patch) had a hard-coded whitelist of gfx90a/gfx942/gfx950 (updated for gfx950 in PR #155103). gfx1200/gfx1201 were never added despite the CK Tile FMHA generator supporting them. 2. Context.cpp: ckSDPASupported() split from ckSupported() in PR #187267 ([ROCm] Split CK SDPA vs CK GEMM arch gating) only listed gfx942/gfx950. Added gfx1200/gfx1201. Tested on gfx1201 (RX 9070): WITHOUT patch the kernel ASSERTs, WITH patch the kernel executes correctly. Fixes #188113 Pull Request resolved: #188114 Approved by: https://github.com/eellison, https://github.com/alugorey, https://github.com/jeffdaily Co-authored-by: doplxyz <[email protected]> Co-authored-by: Claude Opus 5 <[email protected]> Co-authored-by: Jeff Daily <[email protected]>
…h#188114) The CK Tile FMHA generator already compiles working kernels for gfx12 (--targets=gfx1201 passes through to the kernel template), but two guards prevented them from being used on RDNA4 hardware: 1. launch_kernel_pt.hpp: kentry_pt kernel entry stubs added in PR pytorch#144777 ([ROCm] CK SDPA - Move arch check to CK patch) had a hard-coded whitelist of gfx90a/gfx942/gfx950 (updated for gfx950 in PR pytorch#155103). gfx1200/gfx1201 were never added despite the CK Tile FMHA generator supporting them. 2. Context.cpp: ckSDPASupported() split from ckSupported() in PR pytorch#187267 ([ROCm] Split CK SDPA vs CK GEMM arch gating) only listed gfx942/gfx950. Added gfx1200/gfx1201. Tested on gfx1201 (RX 9070): WITHOUT patch the kernel ASSERTs, WITH patch the kernel executes correctly. Fixes pytorch#188113 Pull Request resolved: pytorch#188114 Approved by: https://github.com/eellison, https://github.com/alugorey, https://github.com/jeffdaily Co-authored-by: doplxyz <[email protected]> Co-authored-by: Claude Opus 5 <[email protected]> Co-authored-by: Jeff Daily <[email protected]>
The CK Tile FMHA generator already compiles working kernels for gfx12 (--targets=gfx1201 passes through to the kernel template), but two guards prevented them from being used on RDNA4 hardware: 1. launch_kernel_pt.hpp: kentry_pt kernel entry stubs added in PR #144777 ([ROCm] CK SDPA - Move arch check to CK patch) had a hard-coded whitelist of gfx90a/gfx942/gfx950 (updated for gfx950 in PR #155103). gfx1200/gfx1201 were never added despite the CK Tile FMHA generator supporting them. 2. Context.cpp: ckSDPASupported() split from ckSupported() in PR #187267 ([ROCm] Split CK SDPA vs CK GEMM arch gating) only listed gfx942/gfx950. Added gfx1200/gfx1201. Tested on gfx1201 (RX 9070): WITHOUT patch the kernel ASSERTs, WITH patch the kernel executes correctly. Fixes #188113 Pull Request resolved: #188114 Approved by: https://github.com/jeffdaily Co-authored-by: doplxyz <[email protected]> Co-authored-by: Claude Opus 5 <[email protected]> Co-authored-by: Jeff Daily <[email protected]>
…h#188114) The CK Tile FMHA generator already compiles working kernels for gfx12 (--targets=gfx1201 passes through to the kernel template), but two guards prevented them from being used on RDNA4 hardware: 1. launch_kernel_pt.hpp: kentry_pt kernel entry stubs added in PR pytorch#144777 ([ROCm] CK SDPA - Move arch check to CK patch) had a hard-coded whitelist of gfx90a/gfx942/gfx950 (updated for gfx950 in PR pytorch#155103). gfx1200/gfx1201 were never added despite the CK Tile FMHA generator supporting them. 2. Context.cpp: ckSDPASupported() split from ckSupported() in PR pytorch#187267 ([ROCm] Split CK SDPA vs CK GEMM arch gating) only listed gfx942/gfx950. Added gfx1200/gfx1201. Tested on gfx1201 (RX 9070): WITHOUT patch the kernel ASSERTs, WITH patch the kernel executes correctly. Fixes pytorch#188113 Pull Request resolved: pytorch#188114 Approved by: https://github.com/eellison, https://github.com/alugorey, https://github.com/jeffdaily Co-authored-by: doplxyz <[email protected]> Co-authored-by: Claude Opus 5 <[email protected]> Co-authored-by: Jeff Daily <[email protected]>
…h#188114) The CK Tile FMHA generator already compiles working kernels for gfx12 (--targets=gfx1201 passes through to the kernel template), but two guards prevented them from being used on RDNA4 hardware: 1. launch_kernel_pt.hpp: kentry_pt kernel entry stubs added in PR pytorch#144777 ([ROCm] CK SDPA - Move arch check to CK patch) had a hard-coded whitelist of gfx90a/gfx942/gfx950 (updated for gfx950 in PR pytorch#155103). gfx1200/gfx1201 were never added despite the CK Tile FMHA generator supporting them. 2. Context.cpp: ckSDPASupported() split from ckSupported() in PR pytorch#187267 ([ROCm] Split CK SDPA vs CK GEMM arch gating) only listed gfx942/gfx950. Added gfx1200/gfx1201. Tested on gfx1201 (RX 9070): WITHOUT patch the kernel ASSERTs, WITH patch the kernel executes correctly. Fixes pytorch#188113 Pull Request resolved: pytorch#188114 Approved by: https://github.com/jeffdaily Co-authored-by: doplxyz <[email protected]> Co-authored-by: Claude Opus 5 <[email protected]> Co-authored-by: Jeff Daily <[email protected]>
…llow-list (#3979) 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 Co-authored-by: Claude Opus 4.8 <[email protected]>
Gate preferred_blas_library CK on ckGemmSupported (includes gfx90a) and keep SDPA/ROCm FA on ckSPDASupported. Update _is_ck_sdpa_available accordingly.
Skip test_ck_blas_library_mm bfloat16 on MI200 (gfx90a).
cc @jeffdaily @sunway513 @jithunnair-amd @pruthvistony @ROCmSupport @jataylo @hongxiayang @naromero77amd @pragupta @jerrymannil @xinyazhang