From 2d7e01bb65bb80de79ba105c1f324629e135473c Mon Sep 17 00:00:00 2001 From: ybyang Date: Fri, 12 Jun 2026 17:22:53 +0800 Subject: [PATCH 1/2] fix(pd): disable overlap for spec+grammar in disagg decode loop event_loop_overlap_disagg_decode never applied the overlap+spec+grammar guard that event_loop_overlap has. With EAGLE now on spec V2, a grammar abort desyncs one DP rank under overlap and the whole DP group deadlocks in the per-iteration request broadcast. Apply is_disable_overlap_for_batch so all DP ranks make the same overlap decision. --- python/sglang/srt/disaggregation/decode.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/python/sglang/srt/disaggregation/decode.py b/python/sglang/srt/disaggregation/decode.py index 0af05cd01318..7b86d4aa7c4e 100644 --- a/python/sglang/srt/disaggregation/decode.py +++ b/python/sglang/srt/disaggregation/decode.py @@ -1750,6 +1750,10 @@ def event_loop_overlap_disagg_decode(self: Scheduler): self.result_queue = deque() self.last_batch: Optional[ScheduleBatch] = None + def pop_and_process(): + tmp_batch, tmp_result = self.result_queue.popleft() + self.process_batch_result(tmp_batch, tmp_result) + while True: # Receive requests recv_reqs = self.request_receiver.recv_requests() @@ -1765,6 +1769,11 @@ def event_loop_overlap_disagg_decode(self: Scheduler): # Get the next batch to run batch = self.get_next_disagg_decode_batch_to_run() self.cur_batch = batch + # overlap + spec + grammar is unsupported (would desync DP ranks). + disable_overlap_for_batch = self.is_disable_overlap_for_batch(batch) + + if disable_overlap_for_batch and self.last_batch: + pop_and_process() # Launch the current batch if batch: @@ -1775,8 +1784,8 @@ def event_loop_overlap_disagg_decode(self: Scheduler): # Process the last batch if self.last_batch: - tmp_batch, tmp_result = self.result_queue.popleft() - self.process_batch_result(tmp_batch, tmp_result) + if not disable_overlap_for_batch: + pop_and_process() elif batch is None: self.on_idle() From 189cc542fab7f6e839b5d74193391eb2585224d8 Mon Sep 17 00:00:00 2001 From: hnyls2002 Date: Fri, 12 Jun 2026 13:43:17 -0700 Subject: [PATCH 2/2] add json grammar kit to disagg spec test --- test/registered/disaggregation/test_disaggregation_basic.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test/registered/disaggregation/test_disaggregation_basic.py b/test/registered/disaggregation/test_disaggregation_basic.py index 50708530f9a9..048b3e014c7a 100644 --- a/test/registered/disaggregation/test_disaggregation_basic.py +++ b/test/registered/disaggregation/test_disaggregation_basic.py @@ -10,6 +10,7 @@ from transformers import AutoTokenizer from sglang.test.ci.ci_register import register_cuda_ci +from sglang.test.kits.json_constrained_kit import JSONConstrainedMixin from sglang.test.kits.pause_generation_kit import PauseResumeInPlaceMixin from sglang.test.run_eval import run_eval from sglang.test.server_fixtures.disaggregation_fixture import ( @@ -21,7 +22,7 @@ DEFAULT_TARGET_MODEL_EAGLE3, ) -register_cuda_ci(est_time=509, stage="base-b", runner_config="2-gpu-large") +register_cuda_ci(est_time=560, stage="base-b", runner_config="2-gpu-large") class TestDisaggregationAccuracy(PauseResumeInPlaceMixin, PDDisaggregationServerBase): @@ -215,7 +216,7 @@ def test_gsm8k(self): raise e from health_check_error -class TestDisaggregationMooncakeSpec(PDDisaggregationServerBase): +class TestDisaggregationMooncakeSpec(JSONConstrainedMixin, PDDisaggregationServerBase): @classmethod def setUpClass(cls): super().setUpClass()