[Misc] Rework process titles (#21780)

Signed-off-by: Nick Hill <nhill@redhat.com>
This commit is contained in:
Nick Hill
2025-07-29 05:14:47 +00:00
committed by GitHub
parent f1e2c095ec
commit 7234fe2685
7 changed files with 48 additions and 26 deletions
+12 -4
View File
@@ -3282,14 +3282,22 @@ def has_deep_gemm() -> bool:
return _has_module("deep_gemm")
def bind_process_name(name: str, suffix: str = "") -> None:
"""Bind the process name to a specific name with an optional suffix.
def set_process_title(name: str,
suffix: str = "",
append: bool = False) -> None:
"""
Set the current process title to a specific name with an
optional suffix.
Args:
name: The base name to bind the process to.
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.
"""
name = f"{envs.VLLM_PROCESS_NAME_PREFIX}::{name}"
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)