Repository navigation
[Core] Keep attention backends eligible for text-only serving of prefix-LM models - #48796
Conversation
|
π 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. Once the PR is approved and ready to go, your PR reviewer(s) can run CI to test the changes comprehensively before merging. To run CI, PR reviewers can either: Add 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. π |
a55359b to
97c4a55
Compare
Use the registry's deployment-level multimodal eligibility in architecture conversion so regenerated text subconfigs preserve the correct attention mode. Signed-off-by: qtris123 <voquangtri2021@gmail.com>
|
Hi @qtris123, the pre-commit checks have failed. Please run: uv pip install pre-commit>=4.5.1
pre-commit install
pre-commit run --all-filesThen, commit the changes and push to your branch. For future commits, |
Document that the cached decision is required for correctness on the with_hf_config regeneration path, not merely to avoid repeated registry lookups. Signed-off-by: qtris123 <voquangtri2021@gmail.com>
|
Hi @qtris123, the pre-commit checks have failed. Please run: uv pip install pre-commit>=4.5.1
pre-commit install
pre-commit run --all-filesThen, commit the changes and push to your branch. For future commits, |
Signed-off-by: qtris123 <voquangtri2021@gmail.com>
DarkLight1337
left a comment
There was a problem hiding this comment.
Please fix the test failures
Architecture inspection helpers call get_model_arch_config on a duck-typed DummyConfig class; expose the new support probe so they keep the default multimodal conversion path. Signed-off-by: qtris123 <voquangtri2021@gmail.com>
Bring in CI timeout bumps and latest main without changing the mm_prefix gate.
Pick up pytorch-compilation-unit-tests timeout bump (vllm-project#49450) to re-run CI.
Pick up topk_softplus_sqrt CUDA fix (vllm-project#49452) and re-trigger CI.
|
Hi @DarkLight1337, most of the ci tests pass, including multimodal / mm_prefix-related suites. The remaining failed cases don't seem to relate to this PR. Should we proceed with this, or would you prefer a CI retry first? |
|
Rebasing |
|
Hi @DarkLight1337 β gentle ping. Auto-merge has been blocked for ~2 days on Buildkite #79597. Most of the reds is either "permission denied error" or the kernel moe tess. I donβt have Buildkite SSO to retry. Maybe could you retry the failed jobs (or kick a fresh CI run) to unblock these test cases? |
|
I see the updates, thanks for the support @DarkLight1337 π«‘ |
Purpose
Prefix-LM multimodal models set
is_mm_prefix_lm=Truefrom static model configuration (e.g. Gemma 4, Gemma 3, Molmo2). This flag is evaluated at server startup and tells backend selection that some multimodal tokens may need bidirectional (prefix) attention, so backends withoutsupports_mm_prefix()are rejected.That constraint is correct while vision inputs can still appear. The problem is that it is applied unconditionally β even when the deployment is configured so that vision inputs can never occur. In that case the gate rejects otherwise-valid attention backends for no reason:
TRITON_ATTNeligible.--attention-backend FLASHINFERfails validation with "partial multimodal token full attention not supported", so the operator cannot opt into a backend that is actually usable for a text-only deployment.This PR does not force any backend or claim a particular backend is always faster. It simply stops disabling backends that are valid once vision cannot occur, by clearing
is_mm_prefix_lmwhen:--language-model-onlyis set, or--limit-mm-per-promptsets limit0for every supported vision modality (image/video).The check reads
allowed_mm_limitsandsupported_mm_limitsfromMULTIMODAL_REGISTRY.get_processing_info():image=0image=0andvideo=0Logic lives in
ModelConfig._apply_mm_prefix_lm_limits(). Selection stays startup/config-based, not per-request.Example: Gemma 4 text-only serving
vllm serve nvidia/Gemma-4-31B-IT-NVFP4 \ --quantization modelopt \ --limit-mm-per-prompt '{"image": 0, "video": 0}'Example: Gemma 3 text-only serving
vllm serve google/gemma-3-4b-it \ --limit-mm-per-prompt '{"image": 0}'Test Plan
tests/config/test_multimodal_config.py--language-model-onlydisables mm_prefixTest Results
Unit tests
Backend eligibility on B200
The change restores backend candidates only when vision is disabled. The normal selector still chooses among those candidates.
Vision disabled β eligibility restored
image=0,video=0TRITON_ATTNFLASHINFER,TRITON_ATTNFLASHINFER+ TRT-LLMimage=0,video=0FLASH_ATTN,TRITON_ATTN,FLEX_ATTENTIONFLASHINFER,FLASH_ATTN,TRITON_ATTN,FLEX_ATTENTIONFLASHINFER+ TRT-LLMimage=0TRITON_ATTN,FLEX_ATTENTIONFLASHINFER,FLASH_ATTN,TRITON_ATTN,FLEX_ATTENTIONFLASHINFER--language-model-onlyfollows the same restored-eligibility path because no vision inputs can occur.Vision remains possible β eligibility unchanged
image=0but video enabledTRITON_ATTNTRITON_ATTNTRITON_ATTNimage=0but video enabledFLASH_ATTN,TRITON_ATTN,FLEX_ATTENTIONFLASH_ATTN,TRITON_ATTN,FLEX_ATTENTIONFLASH_ATTNTRITON_ATTN,FLEX_ATTENTIONTRITON_ATTN,FLEX_ATTENTIONTRITON_ATTNDisabled-path startup log:
Throughput
For Gemma 4 NVFP4 on a long-context text-only workload, restoring backend eligibility (Triton β FlashInfer + TRT-LLM) gives a large aggregate-throughput improvement and substantially lower TTFT. For the other models, short-request smoke checks show neutral-to-modest differences; this PR does not claim a universal backend speedup β it removes an eligibility restriction so the normal selector can pick the best available backend.
Notes for Reviewers