From d0e974f40bda1c959827dfd1a205d7559f3e491d Mon Sep 17 00:00:00 2001 From: Peng Xingchen <112612131+stellaxcpeng@users.noreply.github.com> Date: Wed, 17 Jun 2026 15:47:12 +0800 Subject: [PATCH] [NPU] Use use_dsa to dispatch Ascend DSA attention (#28436) --- .../srt/models/deepseek_common/attention_backend_handler.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python/sglang/srt/models/deepseek_common/attention_backend_handler.py b/python/sglang/srt/models/deepseek_common/attention_backend_handler.py index 796a450ab..79c7c7fd2 100644 --- a/python/sglang/srt/models/deepseek_common/attention_backend_handler.py +++ b/python/sglang/srt/models/deepseek_common/attention_backend_handler.py @@ -45,12 +45,12 @@ def handle_attention_ascend(attn, forward_batch): and not forward_batch.forward_mode.is_target_verify() and not forward_batch.forward_mode.is_draft_extend_v2() ): - if hasattr(attn, "indexer"): + if hasattr(attn, "use_dsa") and attn.use_dsa: return AttnForwardMethod.DSA_NPU else: return AttnForwardMethod.MHA_NPU else: - if hasattr(attn, "indexer"): + if hasattr(attn, "use_dsa") and attn.use_dsa: return AttnForwardMethod.DSA_NPU else: return AttnForwardMethod.MLA_NPU