Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions python/sglang/srt/disaggregation/decode.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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:
Expand All @@ -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()

Expand Down
5 changes: 3 additions & 2 deletions test/registered/disaggregation/test_disaggregation_basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand All @@ -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):
Expand Down Expand Up @@ -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()
Expand Down
Loading