From 1c13c28087de72432b092836fa28694f0efbe801 Mon Sep 17 00:00:00 2001 From: Rei <1477174254@qq.com> Date: Tue, 23 Dec 2025 23:53:27 -0800 Subject: [PATCH] [bugfix] add hasattr check for drafter in _build_attention_metadata with PP Signed-off-by: Rei <1477174254@qq.com> --- vllm/v1/worker/gpu_model_runner.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/vllm/v1/worker/gpu_model_runner.py b/vllm/v1/worker/gpu_model_runner.py index 16fc9fd7cb4d8..9e4d3b476b675 100644 --- a/vllm/v1/worker/gpu_model_runner.py +++ b/vllm/v1/worker/gpu_model_runner.py @@ -1710,7 +1710,11 @@ class GPUModelRunner( _get_block_table_and_slot_mapping(kv_cache_gid) ) - if self.speculative_config and spec_decode_common_attn_metadata is None: + if ( + self.speculative_config + and spec_decode_common_attn_metadata is None + and hasattr(self, "drafter") + ): if isinstance(self.drafter, EagleProposer): if self.drafter.attn_layer_names[0] in kv_cache_group.layer_names: spec_decode_common_attn_metadata = cm