diff --git a/vllm/model_executor/layers/attention/mla_attention.py b/vllm/model_executor/layers/attention/mla_attention.py index 140e071c7465..696f133a20d6 100644 --- a/vllm/model_executor/layers/attention/mla_attention.py +++ b/vllm/model_executor/layers/attention/mla_attention.py @@ -615,7 +615,16 @@ def forward_impl( quant_col_major: bool | None = None, quant_tma_aligned: bool | None = None, ) -> torch.Tensor: - assert output is not None, "Output tensor must be provided." + # [Bugfix] vLLM profiling run (_dummy_run) calls forward_impl + # without an output buffer — it only needs shape info, not values. + # The assertion is too strict for this case. Allocate a zero buffer + # when output is None. During real inference, callers always provide + # a buffer so this path is never taken outside of startup profiling. + if output is None: + output = torch.zeros( + (q.shape[0], self.num_heads, self.v_head_dim), + dtype=q.dtype, + device=q.device,) quant_key = _detect_output_quant_key( output, output_scale, output_block_scale, self.num_heads * self.v_head_dim