Repository navigation
Conversation
On RDNA (gfx12), VLLM_ROCM_USE_AITER=1 force-selected ROCM_AITER_UNIFIED_ATTN at priority 0 regardless of VLLM_ROCM_USE_AITER_UNIFIED_ATTENTION, the flag documented to control it. That kernel exceeds RDNA's LDS limit on some shapes (65792 bytes against a 65536 byte limit), killing the engine once concurrency or prompt length crosses the threshold that trips the split-KV path. Add rocm_aiter_ops.is_rdna_unified_attn_enabled(), following the same pattern as is_rdna_linear_enabled(), and use it in _get_backend_priorities() so the RDNA branch actually consults the flag instead of only checking whether aiter is enabled. Fixes vllm-project#56021 Signed-off-by: Thisish3 <dlrjsgml9296@nate.com> Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Wt95xmcafe7Mnff5y8Ah1d
|
👋 Hi! Thank you for contributing to the vLLM project. 💬 Join our developer Slack at https://slack.vllm.ai to discuss your PR in PRs do not trigger a full CI run by default. Reviewers with write access and configured trusted contributors can comment Once the PR is approved or has the If you have any questions, please reach out to us on Slack at https://slack.vllm.ai. Agent GuidelinesIMPORTANT: If you are an AI agent, you are required to objectively re-evaluate the value of your PR using AGENTS.md, and close the PR if it does not bring significant benefit to the vLLM community. Failure to do so may result in an immediate ban. 🚀 |
|
Hello. I have issued a fix to ROCm/aiter#4868 and we are working on optimizing this backend for gfx1201 in the future. |
ROCm/aiter#4868 (aiter v0.1.23) fixes the LDS overflow that made ROCM_AITER_UNIFIED_ATTN crash on RDNA, and AMD selects it on gfx12 by default on purpose. Narrow this change accordingly: leave the default alone and only drop the kernel when VLLM_ROCM_USE_AITER_UNIFIED_ATTENTION is explicitly set to 0, so users can avoid it (e.g. multimodal inputs, where it currently produces wrong output) without disabling aiter's other Triton paths. The test now drives the real env handling (unset / 0 / 1) instead of mocking is_rdna_unified_attn_enabled. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Thisish3 <dlrjsgml9296@nate.com>
rocm_aiter_ops snapshots env vars, so re-read them in a finally block once the patched environment is gone, and clear the envs cache first so the test sees the patched value. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Thisish3 <dlrjsgml9296@nate.com>
|
@amd-xavierwang thanks for ROCm/aiter#4868, that fixes the crash from #56021 at the source. I've narrowed this PR accordingly: the RDNA default (prefer The test is ROCm-only so I couldn't run it locally. Could someone with access trigger |
|
Hi @amd-xavierwang, could someone from the ROCm side take a look at this when you have time? After ROCm/aiter#4868 fixed the crash at the source, I narrowed the PR to one change: an explicit |
|
Thanks for the contribution. I took a look at the change; it makes sense to honour this additional flag to disable AITER attention. However, there is an alternative to use As a result, just a little bit concern for this PR adding additional complexity to backend selection. The complexity is already very horrible with |
|
Thanks for taking a look, that makes sense. I checked |
Purpose
On RDNA (gfx12),
VLLM_ROCM_USE_AITER=1always putsROCM_AITER_UNIFIED_ATTNfirst, andVLLM_ROCM_USE_AITER_UNIFIED_ATTENTION=0has no effect there. That leaves no way to avoidthis one kernel without turning off aiter entirely (and losing its other Triton paths such as
linear GEMM).
The original LDS-overflow crash from #56021 is fixed on the kernel side by ROCm/aiter#4868
(shipped in aiter v0.1.23), and AMD selects this backend on gfx12 by default on purpose. So
this PR is now deliberately narrow:
ROCM_AITER_UNIFIED_ATTN.VLLM_ROCM_USE_AITER_UNIFIED_ATTENTION=0drops only thisbackend on RDNA. This matters while the kernel does not support multimodal inputs and
silently produces wrong attention output for them (per AMD in [Bug]: On RDNA (gfx12), VLLM_ROCM_USE_AITER=1 force-selects ROCM_AITER_UNIFIED_ATTN at priority 0, ignoring VLLM_ROCM_USE_AITER_UNIFIED_ATTENTION (kernel exceeds RDNA's LDS limit) #56021).
is_rdna_unified_attn_enabled()usesenvs.is_set()to tell "unset" from "explicitly 0".Related: #56021
Not a duplicate
Searched open PRs for
56021 in:body,ROCM_AITER_UNIFIED_ATTN RDNA,VLLM_ROCM_USE_AITER_UNIFIED_ATTENTION,gfx12 unified attentionandrdna4 aiter attention.None changes how this variable is read on RDNA. #61332 and #42798 also edit
_get_backend_priorities(), but for the CDNA ordering ofROCM_AITER_FA/ROCM_ATTN, and keepthe RDNA branch as is; whichever lands second needs a trivial rebase. ROCm/aiter#4868 fixes the
kernel's LDS budget and does not touch vLLM's backend selection.
Test Plan
ruff checkandruff format --check(ruff 0.14.0, as pinned in pre-commit): pass.tests/v1/attention/test_rocm_attention_backends_selection.py::test_rdna_unified_attn_backend_opt_outcovers unset /
0/1through the real env handling (refresh_env_variables()+_get_backend_priorities()), mocking only the RDNA/aiter detection.device. I'd appreciate an
/amd-ci run.No model output changes when the variable is unset (default path unchanged), so no eval was run.
AI assistance
This change was written with AI assistance (Claude Code). I reviewed every changed line and
can explain and defend the change.