From ce9fad719602a23bd0e7466ac1693456664d0615 Mon Sep 17 00:00:00 2001 From: Ryan Zzz <53418069+DaZhUUU@users.noreply.github.com> Date: Mon, 15 Jun 2026 12:11:53 +0800 Subject: [PATCH] [Bugfix][DeepSeek-V4] Fix Spec V2 Draft Input ID Dtype for DP Collectives (#28043) Co-authored-by: zhujunyu --- python/sglang/srt/speculative/base_spec_worker.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/python/sglang/srt/speculative/base_spec_worker.py b/python/sglang/srt/speculative/base_spec_worker.py index 6c5e8b19b..4a240f438 100644 --- a/python/sglang/srt/speculative/base_spec_worker.py +++ b/python/sglang/srt/speculative/base_spec_worker.py @@ -111,7 +111,9 @@ class EagleDraftWorkerBase(ABC): gpu_only = batch.seq_lens_cpu is None batch.spec_info = draft_extend_input - batch.input_ids = predict + # Normalize draft token ids before ForwardBatch construction; DeepSeekV4 DP + # gather requires input_ids to have a consistent integer dtype across ranks. + batch.input_ids = predict.to(torch.int64) maybe_detect_oob( batch.input_ids, 0,