From ca6e0ff2c8fbff7060a2f63009539aa8067922bc Mon Sep 17 00:00:00 2001 From: JiaruiChang5268 Date: Wed, 29 Jul 2026 20:13:31 +0800 Subject: [PATCH] [NPU] fix dsv4 mtp condition on NPU graph (#32711) --- .../npu/graph_runner/eagle_draft_extend_npu_graph_runner.py | 2 +- .../npu/graph_runner/eagle_draft_npu_graph_runner.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/python/sglang/srt/hardware_backend/npu/graph_runner/eagle_draft_extend_npu_graph_runner.py b/python/sglang/srt/hardware_backend/npu/graph_runner/eagle_draft_extend_npu_graph_runner.py index fd230be5b..6d4077d4d 100644 --- a/python/sglang/srt/hardware_backend/npu/graph_runner/eagle_draft_extend_npu_graph_runner.py +++ b/python/sglang/srt/hardware_backend/npu/graph_runner/eagle_draft_extend_npu_graph_runner.py @@ -36,7 +36,7 @@ class EAGLEDraftExtendNpuGraphRunner(EAGLEDraftExtendCudaGraphRunner): def _replay_graph(self, shape_key, forward_batch): hf_config = self.model_runner.model_config.hf_config - if not (is_deepseek_dsa(hf_config) and is_deepseek_v4(hf_config)): + if not (is_deepseek_dsa(hf_config) or is_deepseek_v4(hf_config)): seq_lens = forward_batch.seq_lens_cpu.tolist() + [0] * ( self.bs - self.raw_bs ) diff --git a/python/sglang/srt/hardware_backend/npu/graph_runner/eagle_draft_npu_graph_runner.py b/python/sglang/srt/hardware_backend/npu/graph_runner/eagle_draft_npu_graph_runner.py index 006f46ee6..113eed0f5 100644 --- a/python/sglang/srt/hardware_backend/npu/graph_runner/eagle_draft_npu_graph_runner.py +++ b/python/sglang/srt/hardware_backend/npu/graph_runner/eagle_draft_npu_graph_runner.py @@ -88,7 +88,7 @@ class EAGLEDraftNpuGraphRunner(EAGLEDraftCudaGraphRunner): def _replay_graph(self, shape_key, forward_batch): hf_config = self.model_runner.model_config.hf_config - if not (is_deepseek_dsa(hf_config) and is_deepseek_v4(hf_config)): + if not (is_deepseek_dsa(hf_config) or is_deepseek_v4(hf_config)): seq_lens_for_each_draft_step = [] for speculative_step_id in range(self.speculative_num_steps - 1): seq_lens_cpu = (