[bugfix] add hasattr check for drafter in _build_attention_metadata with PP

Signed-off-by: Rei <1477174254@qq.com>
This commit is contained in:
Rei 2025-12-23 23:53:27 -08:00
parent 1c74150bca
commit 1c13c28087

View File

@ -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