diff --git a/python/sglang/srt/models/deepseek_common/attention_forward_methods/forward_mha.py b/python/sglang/srt/models/deepseek_common/attention_forward_methods/forward_mha.py index 5c33248f7..62d407387 100644 --- a/python/sglang/srt/models/deepseek_common/attention_forward_methods/forward_mha.py +++ b/python/sglang/srt/models/deepseek_common/attention_forward_methods/forward_mha.py @@ -656,9 +656,14 @@ class DeepseekMHAForwardMixin: # reads cached prefix KV crashes with "576 != 656". kv_indices = filter_dcp_local_kv_indices(kv_indices=kv_indices) # Read door: the pool never translates, so the production site does. - kv_indices = get_attn_backend().kv_index_translator.translate_dcp_read_ids( - kv_indices - ) + # Only the FlashAttention/FlashInfer backends bind a translator; the + # base class documents its None default as "no translate", and the DSA + # backend the EAGLE draft model runs on keeps that default. With no + # translator the ids never went VIRTUAL, so there is nothing to + # collapse. + translator = get_attn_backend().kv_index_translator + if translator is not None: + kv_indices = translator.translate_dcp_read_ids(kv_indices) kv_a, k_pe = get_token_to_kv_pool().get_mla_kv_buffer( self.attn_mha, kv_indices, torch.bfloat16 )