From 0fd44ff342bb1e1ed7a110b5164034a288cc67a0 Mon Sep 17 00:00:00 2001 From: Alison Shao <54658187+alisonshao@users.noreply.github.com> Date: Wed, 25 Feb 2026 20:14:33 -0800 Subject: [PATCH] Fix NSA CP positions mismatch in eagle NextN model (#19367) --- python/sglang/srt/models/deepseek_nextn.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/python/sglang/srt/models/deepseek_nextn.py b/python/sglang/srt/models/deepseek_nextn.py index cb13a7c67..d62111471 100644 --- a/python/sglang/srt/models/deepseek_nextn.py +++ b/python/sglang/srt/models/deepseek_nextn.py @@ -29,6 +29,7 @@ from sglang.srt.layers.attention.nsa.utils import ( can_cp_split, cp_all_gather_rerange_output, cp_split_and_rebuild_data, + cp_split_and_rebuild_position, is_nsa_enable_prefill_cp, nsa_use_prefill_cp, prepare_input_dp_with_cp_dsa, @@ -160,6 +161,7 @@ class DeepseekModelNextN(nn.Module): if nsa_use_prefill_cp(forward_batch, self.nsa_enable_prefill_cp): hidden_states = cp_split_and_rebuild_data(forward_batch, hidden_states) + positions = cp_split_and_rebuild_position(forward_batch, positions) residual = None with get_global_expert_distribution_recorder().disable_this_region(): hidden_states, residual = self.decoder(