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.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()
@@ -1769,6 +1773,11 @@ class SchedulerDisaggregationDecodeMixin:
# 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:
@@ -1779,8 +1788,8 @@ class SchedulerDisaggregationDecodeMixin:
# 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()