Skip to content
Merged
Show file tree
Hide file tree
Changes from 21 commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
7339a26
removed support_mm_prefix(cls): return True from rocm_attn.py and roc…
GodRishUniverse Jun 16, 2026
5a6890c
[ROCm] Fix prefix-LM attention backend selection and add unit tests
GodRishUniverse Jun 18, 2026
00eea7a
removed a note comment added
GodRishUniverse Jun 25, 2026
2fccb12
Merge branch 'main' into rocm_backend_prefix_lm_fix
GodRishUniverse Jun 25, 2026
5fdc48e
Merge branch 'main' into rocm_backend_prefix_lm_fix
GodRishUniverse Jun 25, 2026
8557f3a
Merge branch 'main' into rocm_backend_prefix_lm_fix
GodRishUniverse Jun 29, 2026
2f80d04
Merge branch 'main' into rocm_backend_prefix_lm_fix
GodRishUniverse Jun 30, 2026
e3b4101
removed strong 'must' and also added file wide skip for
GodRishUniverse Jul 6, 2026
ec6761a
Merge branch 'main' into rocm_backend_prefix_lm_fix
GodRishUniverse Jul 6, 2026
4c5078a
Merge branch 'main' into rocm_backend_prefix_lm_fix
GodRishUniverse Jul 9, 2026
937b726
refactored assertion messaged to include the issues created
GodRishUniverse Jul 10, 2026
2f22a0c
Merge branch 'main' into rocm_backend_prefix_lm_fix
GodRishUniverse Jul 10, 2026
3fb2704
Merge branch 'main' into rocm_backend_prefix_lm_fix
GodRishUniverse Jul 14, 2026
b9ae3d5
Merge branch 'main' into rocm_backend_prefix_lm_fix
GodRishUniverse Jul 20, 2026
60c7ba8
Merge branch 'main' into rocm_backend_prefix_lm_fix
GodRishUniverse Aug 16, 2026
0e1a7cc
Merge branch 'main' into rocm_backend_prefix_lm_fix
GodRishUniverse Sep 1, 2026
8863f7a
Merge branch 'main' into rocm_backend_prefix_lm_fix
GodRishUniverse Sep 14, 2026
8da9445
resolve ROCm mm_prefix conflicts, move regression test, fix E501, dro…
GodRishUniverse Sep 29, 2026
18dd42c
We fixed ROCm mm_prefix first: 7339a26805 (2026-06-16), 3.5 months be…
GodRishUniverse Sep 29, 2026
89666c0
Merge branch 'main' into rocm_backend_prefix_lm_fix
GodRishUniverse Sep 29, 2026
7b48b2b
Merge branch 'main' into rocm_backend_prefix_lm_fix
GodRishUniverse Sep 30, 2026
abd86f8
Merge branch 'main' into rocm_backend_prefix_lm_fix
GodRishUniverse Oct 6, 2026
8dabe4a
Merge branch 'main' into rocm_backend_prefix_lm_fix
GodRishUniverse Oct 6, 2026
d53b2e6
Fix ruff format
GodRishUniverse Oct 6, 2026
f0bcb79
Merge branch 'main' into rocm_backend_prefix_lm_fix
GodRishUniverse Oct 6, 2026
80b483d
Merge branch 'main' into rocm_backend_prefix_lm_fix
GodRishUniverse Oct 6, 2026
90eac93
Merge branch 'main' into rocm_backend_prefix_lm_fix
GodRishUniverse Oct 7, 2026
60aae20
Merge branch 'main' into rocm_backend_prefix_lm_fix
GodRishUniverse Oct 7, 2026
2db54d4
Merge branch 'main' into rocm_backend_prefix_lm_fix
GodRishUniverse Oct 8, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions tests/v1/attention/test_rocm_attention_backends_selection.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,31 @@ def test_aiter_unified_attention_uses_dedicated_metadata_builder():
)


def test_rocm_backends_do_not_support_mm_prefix():
"""Regression test: ROCm backends must not claim mm_prefix support.

If they do, prefix-LM multimodal models that attend vision tokens
bidirectionally (e.g. Gemma3 4B) will use bidirectional attention
via the ROCm backend instead of falling back to Triton, producing
incorrect results. Remove this test only if support is properly added.
"""
from vllm.v1.attention.backends.rocm_aiter_unified_attn import (
RocmAiterUnifiedAttentionBackend,
)
from vllm.v1.attention.backends.rocm_attn import RocmAttentionBackend

assert not RocmAttentionBackend.supports_mm_prefix(), (
"RocmAttentionBackend does not support mm_prefix — "
"defer to Triton unified attention instead for now"
"See https://github.com/vllm-project/vllm/issues/48172"
)
assert not RocmAiterUnifiedAttentionBackend.supports_mm_prefix(), (
"RocmAiterUnifiedAttentionBackend does not support mm_prefix — "
"defer to Triton unified attention instead for now"
"See https://github.com/ROCm/aiter/issues/4168"
)


def test_aiter_unified_attention_capture_preserves_query_start_locations():
from vllm.v1.attention.backends.rocm_aiter_unified_attn import (
RocmAiterUnifiedAttentionMetadataBuilder,
Expand Down
4 changes: 4 additions & 0 deletions vllm/model_executor/models/gemma3_mm.py
Original file line number Diff line number Diff line change
Expand Up @@ -557,6 +557,10 @@ def __init__(self, *, vllm_config: VllmConfig, prefix: str = ""):
)
self.multi_modal_projector = Gemma3MultiModalProjector(config)

# https://huggingface.co/blog/gemma3, (image tokens attend to each other)
# explicit mention here as text side in gemma3 standalone does not need
# prefix_lm but multimodal does
config.text_config.is_mm_prefix_lm = True
with self._mark_language_model(vllm_config):
self.language_model = init_vllm_registered_model(
vllm_config=vllm_config,
Expand Down
Loading