Repository navigation
fix(vllm): default attention backend to TRITON_ATTN on ROCm - #507
Merged
Merged
Conversation
create_async_llm defaults attention_config.backend to FLASH_ATTN when the caller passes none. On ROCm that backend relies on the CUDA-only vllm_flash_attn package: get_flash_attn_version() returns None there, so every engine fails during profile_run with "AssertionError: FlashAttention version not detected." Keep FLASH_ATTN on other platforms and use TRITON_ATTN on ROCm. An explicit attention_config from the caller still takes precedence. Co-authored-by: Cursor <cursoragent@cursor.com>
amd-fuweiy
marked this pull request as ready for review
October 14, 2026 03:47
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.
What
create_async_llm(roll/third_party/vllm/__init__.py) defaultsattention_config.backendtoFLASH_ATTNwhen the caller does not pass one. This PR keeps that default on every non-ROCm platform and usesTRITON_ATTNon ROCm.Why
On ROCm the
FLASH_ATTNbackend depends on the CUDA-onlyvllm_flash_attnpackage. vLLM's ROCm path returnsNonefromget_flash_attn_version()on purpose (vllm/v1/attention/backends/fa_utils.py, "ROCm doesn't use vllm_flash_attn").FlashAttentionImpl.forwardthen asserts that value is notNone, so every rollout engine fails duringprofile_run, before the first training step:TRITON_ATTNis the Triton FlashAttention implementation vLLM ships as its ROCm default.Behavior
FLASH_ATTN.TRITON_ATTN.attention_configfrom the caller still takes precedence, because the existing"attention_config" not in kwargsguard is untouched.Without this change, ROCm users have to set
actor_infer.strategy_args.strategy_config.attention_config.backend: TRITON_ATTNin every pipeline config.Testing
rocm/primus:v26.7(torch 2.12.0+rocm10.0.0), vLLM v0.31.0.