Skip to content

Commit

Permalink
optimize streaming when tp
Browse files Browse the repository at this point in the history
  • Loading branch information
hnyls2002 committed Sep 3, 2024
1 parent 8a94676 commit 66b98d5
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions python/sglang/srt/managers/tp_worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -375,6 +375,14 @@ def compute_step(self):
self.running_batch = None
self.phase_indicator = Phase.PREPARE_PREFILL
break

if (
self.serialized_memory_access
and self.out_pyobjs_queue.qsize()
and self.running_batch.has_stream()
):
self.phase_indicator = Phase.PREPARE_PREFILL
break
else:
self.new_token_ratio = global_config.init_new_token_ratio
self.phase_indicator = Phase.PREPARE_PREFILL
Expand Down

0 comments on commit 66b98d5

Please sign in to comment.