[GDN] Remove unnecessary conv state clone (#13603)

This commit is contained in:
Binyao Jiang
2025-11-19 16:09:12 -08:00
committed by GitHub
parent f88b2aa6af
commit 67fca6b297

View File

@@ -641,10 +641,8 @@ class GDNAttnBackend(MambaAttnBackendBase):
dtype=torch.bool,
device=forward_batch.input_ids.device,
)
conv_states_to_use = conv_states.clone()
else:
has_initial_states = forward_batch.extend_prefix_lens > 0
conv_states_to_use = conv_states
if is_target_verify:
batch_size = seq_len // forward_batch.spec_info.draft_token_num
@@ -654,7 +652,7 @@ class GDNAttnBackend(MambaAttnBackendBase):
).transpose(1, 2)
mixed_qkv_processed = causal_conv1d_update(
mixed_qkv_reshaped,
conv_states_to_use,
conv_states,
conv_weights,
bias,
activation,
@@ -671,7 +669,7 @@ class GDNAttnBackend(MambaAttnBackendBase):
conv_weights,
bias,
activation=activation,
conv_states=conv_states_to_use,
conv_states=conv_states,
has_initial_state=has_initial_states,
cache_indices=cache_indices,
query_start_loc=query_start_loc,