[Misc] Improve Worker process title and logging prefix (#22205)

Signed-off-by: 22quinn <33176974+22quinn@users.noreply.github.com>
This commit is contained in:
22quinn
2025-09-08 21:43:48 -07:00
committed by GitHub
parent 948dd3443b
commit 0cdd213641
4 changed files with 37 additions and 23 deletions
+3 -7
View File
@@ -3359,7 +3359,7 @@ def has_triton_kernels() -> bool:
def set_process_title(name: str,
suffix: str = "",
append: bool = False) -> None:
prefix: str = envs.VLLM_PROCESS_NAME_PREFIX) -> None:
"""
Set the current process title to a specific name with an
optional suffix.
@@ -3367,15 +3367,11 @@ def set_process_title(name: str,
Args:
name: The title to assign to the current process.
suffix: An optional suffix to append to the base name.
append: Whether to append to the existing process title.
prefix: A prefix to prepend to the front separated by `::`.
"""
if suffix:
name = f"{name}_{suffix}"
if append:
name = f"{setproctitle.getproctitle()}_{name}"
else:
name = f"{envs.VLLM_PROCESS_NAME_PREFIX}::{name}"
setproctitle.setproctitle(name)
setproctitle.setproctitle(f"{prefix}::{name}")
def _add_prefix(file: TextIO, worker_name: str, pid: int) -> None: