Repository navigation
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/188114
Note: Links to docs will display an error until the docs builds have been completed. ❌ 2 New Failures, 7 Unrelated FailuresAs of commit 468911e with merge base c20fc58 ( NEW FAILURES - The following jobs have failed:
FLAKY - The following jobs failed but were likely due to flakiness present on trunk:
BROKEN TRUNK - The following job failed but were present on the merge base:👉 Rebase onto the `viable/strict` branch to avoid these failures
UNSTABLE - The following job is marked as unstable, possibly due to flakiness on trunk:
CRCR (non-blocking) - The following CRCR downstream CI jobs failed but are non-blocking:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
|
|
|
@pytorchbot label "topic: not user facing" |
|
@pytorchbot label "module: rocm" |
341ea45 to
99df5c7
Compare
@poad42 No, thanks for checking. we are probably Okay. @jeffdaily Can we land this? enables opt-in support for CK SDPA on gfx1200/1201. Does not bump CK so won't cause the usual headache. |
ATen/ROCmCKSDPAConfig.h is produced by a CMake configure_file, but Context.cpp is also compiled by builds that do not run CMake: buckbuild.bzl lists it in lean_runtime_with_tensor, and build_variables.bzl carries it in the shared aten source list. Those builds can define USE_ROCM while having no generated header, so an unguarded include fails at preprocessing. ATen/Config.h, included unguarded a few lines above, only works there because it was explicitly wired into Buck via the generate_aten_config genrule; nothing equivalent exists for this new header. Probe for the header with __has_include, matching the form already used in aten/src/ATen/native/transformers/cuda/sdp_utils.cpp and native/cudnn/MHA.cpp, and fall back to an empty arch list when it is absent. Empty is the correct value for those builds because they never compile CK SDPA, and ckSDPASupported() already short-circuits on an empty list, so the runtime check simply reports unsupported. Test Plan: Verified the preprocessor logic in all four build configurations, checking both the resulting macro value and that each configuration compiles: ``` g++ -E -P -DUSE_ROCM -I. probe.cpp # -> "gfx942,gfx950" g++ -E -P -DUSE_ROCM -I/nonexistent probe.cpp # -> "" g++ -E -P -I. probe.cpp # -> "" g++ -E -P -I/nonexistent probe.cpp # -> "" g++ -std=c++17 -fsyntax-only <each of the above> probe.cpp ``` Lint: ``` lintrunner --paths-cmd 'git diff --name-only HEAD' -a ``` Authored with assistance from Claude.
|
Yes, once CI comes back. I pushed two commits to the branch first. The one blocker was that The fix probes with I also merged viable/strict, which pulls in #194794, so this now runs against ROCm 10.0 rather than the image the branch was pinned to. That is 449 commits plus a ROCm major bump, so any new red is worth attributing to the environment before poad42's change. @poad42 nothing of yours was modified; both commits sit on top of your head. The rest holds up under review: consolidating the codegen Reply drafted with AI assistance. |
|
@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 |
|
@pytorchbot revert -m="Diff reverted internally" -c="ghfirst" This Pull Request has been reverted by a revert inside Meta. To re-land this change, please open another pull request, assign the same reviewers, fix the CI failures that caused the revert and make sure that the failing CI runs on the PR by applying the proper ciflow label (e.g., ciflow/trunk).) |
|
@pytorchbot successfully started a revert job. Check the current status here. |
…#188114)" This reverts commit 610fee8. Reverted #188114 on behalf of https://github.com/meta-codesync due to Diff reverted internally ([comment](#188114 (comment)))
|
@poad42 your PR has been successfully reverted. |
|
@jeffdaily @alugorey did I miss something so it got reverted? I didn't see any CI failures |
|
@poad42 I've requested insight from @jeanschmidt |
The header guard added in 5ac98b1 fell back to an empty AT_ROCM_CK_SDPA_ARCHS when ATen/ROCmCKSDPAConfig.h is absent, on the assumption that non-CMake builds never compile CK SDPA. That assumption is wrong for Meta's internal Buck build: it compiles CK SDPA as its only ROCm flash attention backend and replaces AOTriton with a stub that throws at runtime. With the empty fallback, ckSDPASupported() returned false on MI300, getROCmFAPreferredBackend() silently rewrote the CK preference to AOTriton, and mha_fwd dispatched into the stub ("AOTriton is not supported in the internal stack"), which is why the first land of this PR was reverted. The fix keeps the header authoritative when it exists (all CMake builds, including the new gfx12 opt-in) and changes only the absent-header fallback to "gfx942,gfx950", the exact list ckSDPASupported() hard-coded before this PR. Non-CMake builds therefore get their previous runtime behavior back. The alternative of wiring the generated header into Buck was rejected because it requires an internal-only change we cannot make or test from here; the static fallback matches the status quo those builds have always relied on. Test Plan: Compiled the real aten/src/ATen/Context.cpp with the exact torch_cpu compile flags recorded in build/compile_commands.json (which include -DUSE_ROCM) in three include configurations, checking both that -fsyntax-only passes and what string literal reaches the supported_archs initializer: ``` no ROCmCKSDPAConfig.h on the include path (Buck-like) -> "gfx942,gfx950" compile OK -I<dir> with header defining "" (CMake, CK off) -> "" compile OK -I<dir> with header defining "gfx942" (CMake, CK on) -> "gfx942" compile OK ``` Extracted the supported_archs parsing lambda verbatim from Context.cpp into a standalone program and executed it against representative macro values: ``` g++ -std=c++17 -DAT_ROCM_CK_SDPA_ARCHS='"gfx942,gfx950"' parse_test.cpp -o parse_test && ./parse_test ``` yields [gfx942] [gfx950]; "" yields an empty list, "gfx942,gfx1200,gfx1201" yields all three entries. Lint: ``` lintrunner --paths-cmd 'git diff --name-only HEAD' -a ``` The only report is a pre-existing misc-use-internal-linkage finding on get_reduction_option, present on main and untouched by this change. Authored with assistance from Claude.
|
@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: 2 mandatory check(s) failed. The first few are:
Dig deeper by viewing the failures on hud |
|
@pytorchbot merge -i Infra issue blocking merge. Meta revert reason should be resolved now. |
Merge startedYour change will be merged while ignoring the following 6 checks: pull / linux-jammy-py3.10-clang21-asan / test (default, 1, 18, mt-l-x86iavx512-16-128), pull / linux-jammy-py3.10-clang21-asan / test (default, 10, 18, mt-l-x86iavx512-16-128), inductor-rocm-mi300 / linux-noble-rocm-py3.12-mi300 / test (inductor, 2, 2, linux.rocm.gpu.mi300.1), inductor-rocm-mi300 / linux-noble-rocm-py3.12-mi300 / test (inductor, 1, 2, linux.rocm.gpu.mi300.1), inductor-pallas / pallas-tpu-py3.12-inductor / test (inductor-pallas-tpu, 1, 1, linux.google.tpuv7x.1, unstable), torchtitan-test / torchtitan-x-pytorch-test / test (torchtitan_models_integration, 1, 1, mt-l-x86aavx2-189-704-a10g-8) 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:
launch_kernel_pt.hpp: kentry_pt kernel entry stubs added in PR [ROCm] CK SDPA - Move arch check to CK patch #144777 ([ROCm] CK SDPA - Move arch check to CK patch) had a hard-coded whitelist of gfx90a/gfx942/gfx950 (updated for gfx950 in PR SDPA support gfx950 #155103). gfx1200/gfx1201 were never added despite the CK Tile FMHA generator supporting them.
Context.cpp: ckSDPASupported() split from ckSupported() in PR [ROCm] Split CK SDPA vs CK GEMM arch gating #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
cc @jeffdaily @sunway513 @jithunnair-amd @pruthvistony @ROCmSupport @jataylo @hongxiayang @naromero77amd @pragupta @jerrymannil @xinyazhang @jgong5 @mingfeima @XiaobingSuper @sanchitintel @ashokei @jingxu10 @aditew01 @mcarilli @ptrblck @leslie-fang-intel