A high-throughput and memory-efficient inference and serving engine for LLMs
Mirrored from https://github.com/tduncan-lum/Nvidia-Optimization-Stack---VLLM.git
Synced Nov 14, 05:30 UTC
[Misc] Don't log shm dequeue delay warning on worker side (#25720)
Signed-off-by: Nick Hill <nhill@redhat.com>
Nick Hill committed
Sep 25, 2025 at 18:08 UTC
8b77328ffe0451f4b809de573e71b1c100c8ed67
2 files changed
+31
-31
vllm/distributed/device_communicators/shm_broadcast.py
+30
-30
@@ -387,23 +387,21 @@ class MessageQueue:
387
# Release the processor to other threads
388
sched_yield()
389
390
+ # if we time out, raise an exception
391
+ elapsed = time.monotonic() - start_time
392
+ if timeout is not None and elapsed > timeout:
393
+ raise TimeoutError
394
+
395
# if we wait for a long time, log a message
391
- if (time.monotonic() - start_time
392
- > VLLM_RINGBUFFER_WARNING_INTERVAL * n_warning):
396
+ if elapsed > VLLM_RINGBUFFER_WARNING_INTERVAL * n_warning:
397
logger.info(
394
- ("No available shared memory broadcast block found"
395
- " in %s seconds. This typically happens when some"
396
- " processes are hanging, doing some time-consuming"
397
- " work (e.g. compilation), or sitting idle."),
398
- VLLM_RINGBUFFER_WARNING_INTERVAL,
399
- )
398
+ "No available shared memory broadcast block found"
399
+ " in %s seconds. This typically happens when some"
400
+ " processes are hanging or doing some"
401
+ " time-consuming work (e.g. compilation)",
402
+ VLLM_RINGBUFFER_WARNING_INTERVAL)
403
n_warning += 1
404
402
- # if we time out, raise an exception
403
- if (timeout is not None
404
- and time.monotonic() - start_time > timeout):
405
- raise TimeoutError
406
-
405
continue
406
# found a block that is either
407
# (1) not written
@@ -432,7 +430,8 @@ class MessageQueue:
430
@contextmanager
431
def acquire_read(self,
432
timeout: Optional[float] = None,
435
- cancel: Optional[Event] = None):
433
+ cancel: Optional[Event] = None,
434
+ indefinite: bool = False):
435
assert self._is_local_reader, "Only readers can acquire read"
436
start_time = time.monotonic()
437
n_warning = 1
@@ -452,26 +451,26 @@ class MessageQueue:
451
# Release the processor to other threads
452
self._read_spin_timer.spin()
453
455
- # if we wait for a long time, log a message
456
- if (time.monotonic() - start_time
457
- > VLLM_RINGBUFFER_WARNING_INTERVAL * n_warning):
458
- logger.info(
459
- ("No available shared memory broadcast block found"
460
- " in %s seconds. This typically happens when some"
461
- " processes are hanging, doing some time-consuming"
462
- " work (e.g. compilation), or sitting idle."),
463
- VLLM_RINGBUFFER_WARNING_INTERVAL,
464
- )
465
- n_warning += 1
466
-
454
if cancel is not None and cancel.is_set():
455
raise RuntimeError("cancelled")
456
457
# if we time out, raise an exception
471
- if (timeout is not None
472
- and time.monotonic() - start_time > timeout):
458
+ elapsed = time.monotonic() - start_time
459
+ if timeout is not None and elapsed > timeout:
460
raise TimeoutError
461
462
+ # if we wait for a long time, log a message
463
+ if not indefinite and (elapsed
464
+ > VLLM_RINGBUFFER_WARNING_INTERVAL *
465
+ n_warning):
466
+ logger.info(
467
+ "No available shared memory broadcast block found"
468
+ " in %s seconds. This typically happens when some"
469
+ " processes are hanging or doing some"
470
+ " time-consuming work (e.g. compilation).",
471
+ VLLM_RINGBUFFER_WARNING_INTERVAL)
472
+ n_warning += 1
473
+
474
continue
475
# found a block that is not read by this reader
476
# let caller read from the buffer
@@ -505,10 +504,11 @@ class MessageQueue:
504
505
def dequeue(self,
506
timeout: Optional[float] = None,
508
- cancel: Optional[Event] = None):
507
+ cancel: Optional[Event] = None,
508
+ indefinite: bool = False):
509
""" Read from message queue with optional timeout (in seconds) """
510
if self._is_local_reader:
511
- with self.acquire_read(timeout, cancel) as buf:
511
+ with self.acquire_read(timeout, cancel, indefinite) as buf:
512
overflow = buf[0] == 1
513
if not overflow:
514
# no need to know the size of serialized object
vllm/v1/executor/multiproc_executor.py
+1
-1
@@ -653,7 +653,7 @@ class WorkerProc:
653
"""Main busy loop for Multiprocessing Workers"""
654
while True:
655
method, args, kwargs, output_rank = self.rpc_broadcast_mq.dequeue(
656
- cancel=cancel)
656
+ cancel=cancel, indefinite=True)
657
try:
658
if isinstance(method, str):
659
func = getattr(self.worker, method)