diff --git a/vllm_ascend/spec_decode/eagle_proposer.py b/vllm_ascend/spec_decode/eagle_proposer.py index 403d52a2..72ee9d9c 100644 --- a/vllm_ascend/spec_decode/eagle_proposer.py +++ b/vllm_ascend/spec_decode/eagle_proposer.py @@ -570,6 +570,12 @@ class SpecDecodeBaseProposer(EagleProposer): # Copy the old attn_metadata and update attn_metadata_i = per_layer_attn_metadata[self.attn_layer_names[0]] + + # Clone the data so that when calculating the data at position 2 and position 3 + # in the merged graph, it does not affect position 1 + # FIXME(lilinsiman) + common_attn_metadata.block_table_tensor = common_attn_metadata.block_table_tensor.clone() + if self.pcp_size * self.dcp_size > 1: if self.num_speculative_tokens > 1 and not attn_metadata_i.num_prefills: # For pcp/dcp, tokens are split across different cp ranks, @@ -1136,9 +1142,16 @@ class SpecDecodeBaseProposer(EagleProposer): common_attn_metadata.num_input_tokens = input_batch_size # The loop part - used_update_positions += 1 + # Clone the data so that when calculating the data at position 2 and position 3 + # in the merged graph, it does not affect position 1 + # FIXME(lilinsiman) + common_attn_metadata.seq_lens = common_attn_metadata.seq_lens.clone() + common_attn_metadata.seq_lens_cpu = common_attn_metadata.seq_lens_cpu.clone() + common_attn_metadata.num_computed_tokens_cpu = common_attn_metadata.num_computed_tokens_cpu.clone() + common_attn_metadata.positions = common_attn_metadata.positions.clone() + # NOTE(woosuk): We should handle the case where the draft model # generates tokens beyond the max model length. Since it is complex # to remove such requests from the batch, we keep them in the batch