Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Faster overlap mode scheduler #1738

Merged
merged 4 commits into from
Oct 21, 2024
Merged
Changes from 1 commit
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
Prev Previous commit
Fix
  • Loading branch information
merrymercy committed Oct 21, 2024
commit 53a6acb20780cd356d07d7d15cc8b407d7fed63e
6 changes: 3 additions & 3 deletions python/sglang/srt/managers/tp_worker_overlap_thread.py
Original file line number Diff line number Diff line change
@@ -92,9 +92,9 @@ def forward_thread_func(self):
@torch.inference_mode()
def forward_thread_func_(self):
while True:
self.has_batch = False
self.has_inflight_batch = False
model_worker_batch, future_token_ids_ct = self.input_queue.get()
self.has_batch = True
self.has_inflight_batch = True
self.launch_event = threading.Event()

# Resolve future tokens in the input
@@ -137,7 +137,7 @@ def copy_thread_func(self):

def resulve_batch_result(self, bid: int):
logits_output, next_token_ids = self.output_queue.get()
if self.has_batch:
if self.has_inflight_batch:
# Wait until the batch is launched
self.launch_event.wait()
return logits_output, next_token_ids
Loading