Skip to content
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion vllm_ascend/spec_decode/eagle_proposer.py
Original file line number Diff line number Diff line change
Expand Up @@ -577,6 +577,11 @@ def _propose(

# 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
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,
Expand Down Expand Up @@ -1144,9 +1149,15 @@ def attn_update_stack_num_spec_norm(
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
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
Expand Down
Loading