From 67fca6b297bf0202941bde7b608c6da14f6a8776 Mon Sep 17 00:00:00 2001 From: Binyao Jiang Date: Wed, 19 Nov 2025 16:09:12 -0800 Subject: [PATCH] [GDN] Remove unnecessary conv state clone (#13603) --- .../srt/layers/attention/hybrid_linear_attn_backend.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/python/sglang/srt/layers/attention/hybrid_linear_attn_backend.py b/python/sglang/srt/layers/attention/hybrid_linear_attn_backend.py index c121e663a..fe436e95b 100644 --- a/python/sglang/srt/layers/attention/hybrid_linear_attn_backend.py +++ b/python/sglang/srt/layers/attention/hybrid_linear_attn_backend.py @@ -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,