fix(pd): disable overlap for spec+grammar in disagg decode loop (#28039)

This commit is contained in:
ybyang
2026-06-12 14:08:36 -07:00
committed by GitHub
parent cb9140ee61
commit 1e71c1a859
2 changed files with 14 additions and 4 deletions
+11 -2
View File
@@ -1754,6 +1754,10 @@ class SchedulerDisaggregationDecodeMixin:
self.result_queue = deque() self.result_queue = deque()
self.last_batch: Optional[ScheduleBatch] = None 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: while True:
# Receive requests # Receive requests
recv_reqs = self.request_receiver.recv_requests() recv_reqs = self.request_receiver.recv_requests()
@@ -1769,6 +1773,11 @@ class SchedulerDisaggregationDecodeMixin:
# Get the next batch to run # Get the next batch to run
batch = self.get_next_disagg_decode_batch_to_run() batch = self.get_next_disagg_decode_batch_to_run()
self.cur_batch = batch 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 # Launch the current batch
if batch: if batch:
@@ -1779,8 +1788,8 @@ class SchedulerDisaggregationDecodeMixin:
# Process the last batch # Process the last batch
if self.last_batch: if self.last_batch:
tmp_batch, tmp_result = self.result_queue.popleft() if not disable_overlap_for_batch:
self.process_batch_result(tmp_batch, tmp_result) pop_and_process()
elif batch is None: elif batch is None:
self.on_idle() self.on_idle()
@@ -10,6 +10,7 @@ import requests
from transformers import AutoTokenizer from transformers import AutoTokenizer
from sglang.test.ci.ci_register import register_cuda_ci 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.kits.pause_generation_kit import PauseResumeInPlaceMixin
from sglang.test.run_eval import run_eval from sglang.test.run_eval import run_eval
from sglang.test.server_fixtures.disaggregation_fixture import ( from sglang.test.server_fixtures.disaggregation_fixture import (
@@ -21,7 +22,7 @@ from sglang.test.test_utils import (
DEFAULT_TARGET_MODEL_EAGLE3, 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): class TestDisaggregationAccuracy(PauseResumeInPlaceMixin, PDDisaggregationServerBase):
@@ -215,7 +216,7 @@ class TestDisaggregationMooncakeFailure(PDDisaggregationServerBase):
raise e from health_check_error raise e from health_check_error
class TestDisaggregationMooncakeSpec(PDDisaggregationServerBase): class TestDisaggregationMooncakeSpec(JSONConstrainedMixin, PDDisaggregationServerBase):
@classmethod @classmethod
def setUpClass(cls): def setUpClass(cls):
super().setUpClass() super().setUpClass()