Conversation
Signed-off-by: psakhamo <psakhamo@amd.com>
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.
[Bugfix] vLLM profiling run (_dummy_run) calls forward_impl without an
output buffer — it only needs shape info, not values. Allocate a zero
buffer when output is None instead of asserting.
Validated: GLM-5.1-FP8 on 8x MI300X (gfx942), TP=8 — server startup PASS
Purpose
Fixes a hard
AssertionErrorcrash during vLLM server startup on modelsusing
MLAAttention.The vLLM profiling warmup pass (
_dummy_run, called fromdetermine_num_available_blocks) invokesMLAAttention.forward()withoutproviding an output tensor buffer — it only needs to measure GPU memory
consumption and warm up code paths; it does not need computed values.
forward_implcontains this assertion on theoutputargument:This fires unconditionally during the profiling pass because
forward()atline 573 allocates an
outputbuffer, but the profiling pass path does notcall
forward()— it callsforward_impldirectly without one, causing:AssertionError: Output tensor must be provided.
The fix replaces the hard assert with a conditional allocation: if
outputis
None, a correctly shaped zero tensor is allocated. During real inference,callers always provide a pre-allocated buffer, so this branch is never taken
outside of startup profiling.
Affected: all models using
MLAAttentionunder vLLM v0.17.1 on any hardwarewhere the profiling pass reaches
forward_implwithout a pre-allocated output(observed on AMD MI300X TP=8, reproducible at startup before KV cache init).
Test Plan
Test Result
Tested on: GLM-5.1-FP8 (
GlmMoeDsaForCausalLM, 744B MoE) on 8× AMD InstinctMI300X (gfx942), TP=8, vLLM v0.17.1 ROCm build.
Before fix:
AssertionError: Output tensor must be provided.
File ".../vllm/model_executor/layers/attention/mla_attention.py", line 618
assert output is not None, "Output tensor must be provided."
Server exits during
determine_num_available_blocksbefore KV cache isallocated. GPU memory profiling never completes.
After fix:
"What is 2+2?"): ✅ PASS — correct response returnedEssential Elements of an Effective PR Description Checklist
BEFORE SUBMITTING, PLEASE READ https://docs.vllm.ai/en/latest/contributing