[GDN] Remove unnecessary conv state clone (#13603)
This commit is contained in:
@@ -641,10 +641,8 @@ class GDNAttnBackend(MambaAttnBackendBase):
|
|||||||
dtype=torch.bool,
|
dtype=torch.bool,
|
||||||
device=forward_batch.input_ids.device,
|
device=forward_batch.input_ids.device,
|
||||||
)
|
)
|
||||||
conv_states_to_use = conv_states.clone()
|
|
||||||
else:
|
else:
|
||||||
has_initial_states = forward_batch.extend_prefix_lens > 0
|
has_initial_states = forward_batch.extend_prefix_lens > 0
|
||||||
conv_states_to_use = conv_states
|
|
||||||
|
|
||||||
if is_target_verify:
|
if is_target_verify:
|
||||||
batch_size = seq_len // forward_batch.spec_info.draft_token_num
|
batch_size = seq_len // forward_batch.spec_info.draft_token_num
|
||||||
@@ -654,7 +652,7 @@ class GDNAttnBackend(MambaAttnBackendBase):
|
|||||||
).transpose(1, 2)
|
).transpose(1, 2)
|
||||||
mixed_qkv_processed = causal_conv1d_update(
|
mixed_qkv_processed = causal_conv1d_update(
|
||||||
mixed_qkv_reshaped,
|
mixed_qkv_reshaped,
|
||||||
conv_states_to_use,
|
conv_states,
|
||||||
conv_weights,
|
conv_weights,
|
||||||
bias,
|
bias,
|
||||||
activation,
|
activation,
|
||||||
@@ -671,7 +669,7 @@ class GDNAttnBackend(MambaAttnBackendBase):
|
|||||||
conv_weights,
|
conv_weights,
|
||||||
bias,
|
bias,
|
||||||
activation=activation,
|
activation=activation,
|
||||||
conv_states=conv_states_to_use,
|
conv_states=conv_states,
|
||||||
has_initial_state=has_initial_states,
|
has_initial_state=has_initial_states,
|
||||||
cache_indices=cache_indices,
|
cache_indices=cache_indices,
|
||||||
query_start_loc=query_start_loc,
|
query_start_loc=query_start_loc,
|
||||||
|
|||||||
Reference in New Issue
Block a user