[Misc] Rework process titles (#21780)
Signed-off-by: Nick Hill <nhill@redhat.com>
This commit is contained in:
+12
-4
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user