[BugFix] Ensure worker model loop is always stopped at the right time (#5987)

This commit is contained in:
Nick Hill 2024-07-01 16:17:58 -07:00 committed by GitHub
parent c4059ea54f
commit c87ebc3ef9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -838,7 +838,7 @@ class LLMEngine:
# Tracing
self.do_tracing(scheduler_outputs)
if not request_outputs:
if not self.has_unfinished_requests():
# Stop the execute model loop in parallel workers until there are
# more requests to process. This avoids waiting indefinitely in
# torch.distributed ops which may otherwise timeout, and unblocks