Skip to content

Commit 0f872b7

Browse files
authored
[Log] update shm wait time msg (#28255)
1 parent 4b1ff13 commit 0f872b7

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

vllm/distributed/device_communicators/shm_broadcast.py

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,16 @@ def to_bytes_big(value: int, size: int) -> bytes:
4949
logger = init_logger(__name__)
5050

5151

52+
def long_wait_time_msg(threshold: int) -> str:
53+
return (
54+
"No available shared memory broadcast block found "
55+
f"in {threshold} seconds. This typically happens "
56+
"when some processes are hanging or doing some "
57+
"time-consuming work (e.g. compilation, "
58+
"weight/kv cache quantization)."
59+
)
60+
61+
5262
class SpinTimer:
5363
def record_activity(self):
5464
pass
@@ -422,11 +432,7 @@ def acquire_write(self, timeout: float | None = None):
422432
# if we wait for a long time, log a message
423433
if elapsed > VLLM_RINGBUFFER_WARNING_INTERVAL * n_warning:
424434
logger.info(
425-
"No available shared memory broadcast block found"
426-
" in %s seconds. This typically happens when some"
427-
" processes are hanging or doing some"
428-
" time-consuming work (e.g. compilation)",
429-
VLLM_RINGBUFFER_WARNING_INTERVAL,
435+
long_wait_time_msg(VLLM_RINGBUFFER_WARNING_INTERVAL)
430436
)
431437
n_warning += 1
432438

@@ -493,11 +499,7 @@ def acquire_read(
493499
elapsed > VLLM_RINGBUFFER_WARNING_INTERVAL * n_warning
494500
):
495501
logger.info(
496-
"No available shared memory broadcast block found"
497-
" in %s seconds. This typically happens when some"
498-
" processes are hanging or doing some"
499-
" time-consuming work (e.g. compilation).",
500-
VLLM_RINGBUFFER_WARNING_INTERVAL,
502+
long_wait_time_msg(VLLM_RINGBUFFER_WARNING_INTERVAL)
501503
)
502504
n_warning += 1
503505

0 commit comments

Comments
 (0)