mirror of
https://git.datalinker.icu/vllm-project/vllm.git
synced 2026-07-08 16:07:27 +08:00
[BugFix] Add sleep to fix tight loop and release GIL (#29476)
Signed-off-by: alec-flowers <aflowers@nvidia.com> Signed-off-by: Alec <35311602+alec-flowers@users.noreply.github.com> Co-authored-by: Nick Hill <nhill@redhat.com>
This commit is contained in:
parent
500f26e6d3
commit
62be3670cb
@ -923,6 +923,13 @@ class EngineCoreProc(EngineCore):
|
|||||||
# Post-step hook.
|
# Post-step hook.
|
||||||
self.post_step(model_executed)
|
self.post_step(model_executed)
|
||||||
|
|
||||||
|
# If no model execution happened but there are waiting requests
|
||||||
|
# (e.g., WAITING_FOR_REMOTE_KVS), yield the GIL briefly to allow
|
||||||
|
# background threads (like NIXL handshake) to make progress.
|
||||||
|
# Without this, the tight polling loop can starve background threads.
|
||||||
|
if not model_executed and self.scheduler.has_unfinished_requests():
|
||||||
|
time.sleep(0.001)
|
||||||
|
|
||||||
return model_executed
|
return model_executed
|
||||||
|
|
||||||
def _handle_client_request(
|
def _handle_client_request(
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user