A GPU task manager for Windows, Linux, and WSL: per-process VRAM, GPU activity, and LLM model/KV-cache insights (Windows AMD and NVIDIA).
Python
Cover upstream default vLLM worker titles and layouts
Scott Hanselmanffe06793b89d
diff --git a/README.md b/README.mdindex d36b8b7..12d2db8 100644--- a/README.md+++ b/README.md@@ -765,13 +765,17 @@ cloud-hosted. The GPU counters belong to whichever process holds/uses the GPU reParent-PID lookup currently helps find Ollama/LM Studio and local vLLM APIs; it is not a general cross-processownership graph for shared Windows services.-For vLLM, `vllm serve`, `python -m vllm.entrypoints.openai.api_server`, `VLLM::EngineCore`-and `VLLM::Worker_TP<n>` are detection hints, not loading evidence. An inherited launch command+For vLLM, `vllm serve`, `python -m vllm.entrypoints.openai.api_server`, `VLLM::EngineCore`,+`VLLM::Worker` and `VLLM::Worker_TP<n>` are detection hints, not loading evidence. An inherited launch commandalso works without process titles. Worker discovery checks at most two live ancestors, theircreation times and their signatures. Only one exclusively owned listening port on one recognizedserver is accepted; shared/multiple listeners, unrelated or inaccessible ancestry and explicitdistributed/data-parallel options give no association. There is no port scanning or matching bymodel name. Processes outside the visible PID namespace are not linked to local servers.+Source-grounded fixtures follow upstream vLLM commit+[`499a3d1`](https://github.com/vllm-project/vllm/tree/499a3d1e1e338e3e866c0719cfe1f429e2b0b762):+the default single-API launcher keeps its command line, starts EngineCore, and EngineCore starts+TP workers. `VLLM::APIServer_<index>` belongs to the separate multi-API path and is not supported.The table, inspector and text label these identifiers as API-reported, with **parent process**when applicable. JSON has `llm.server_source` (`"process"`, `"parent"`, or `null`) alongsidediff --git a/src/gputaskman/procinfo.py b/src/gputaskman/procinfo.pyindex 3d83fba..b0d0dc4 100644--- a/src/gputaskman/procinfo.py+++ b/src/gputaskman/procinfo.py@@ -69,7 +69,7 @@ MODEL_KINDS = {"LLM": "LLM", "decision model": "decision", "embedding model": "e"reranker": "embedding", "speech model": "speech"}AI_KINDS = {"LLM", "decision", "decision?", "embedding", "speech", "diffusion", "AI"}_DECISION_NAME = re.compile(r"(?<![a-z0-9])(?:openjev|laya|julia-1|lev|kev)(?![a-z0-9])", re.I)-_VLLM_WORKER = re.compile(r"VLLM::(?:EngineCore|Worker_TP[0-9]+)")+_VLLM_WORKER = re.compile(r"VLLM::(?:EngineCore|Worker(?:_TP[0-9]+)?)")MiB = 1 << 20INSTALLED_TTL = 300.0_SKIP_DIRS = {"ebwebview", "cache", "code cache", "gpucache", "node_modules", "logs", "crashpad", "locales", "__pycache__"}diff --git a/tests/test_vllm.py b/tests/test_vllm.pyindex 4fa075f..7fb6588 100644--- a/tests/test_vllm.py+++ b/tests/test_vllm.py@@ -24,6 +24,9 @@ from gputaskman.report import to_dict, to_textMiB = 1 << 20LAUNCH = ["vllm", "serve", "org/model"]+# Title/layout fixtures follow vllm-project/vllm at 499a3d1e1e338e3e866c0719cfe1f429e2b0b762:+# utils/system_utils.py:set_process_title, v1/executor/multiproc_executor.py:setup_proc_title_and_log_prefix,+# entrypoints/cli/serve.py:cmd, and entrypoints/launchers/api_server/entry.py:run_server.@contextlib.contextmanager@@ -94,6 +97,7 @@ class VllmTests(unittest.TestCase):("python3", ["/env/bin/python3", "/env/bin/vllm", "serve", "org/model"], "server"),("python", ["python", "-u", "-m", "vllm.entrypoints.openai.api_server", "--model", "org/model"], "server"),("VLLM::EngineCore", [], "worker"),+ ("VLLM::Worker", [], "worker"),("VLLM::Worker_TP12", [], "worker"),("python", ["VLLM::Worker_TP0"], "worker"),("python", LAUNCH, "server"), # inherited command line when setproctitle is absent@@ -102,6 +106,9 @@ class VllmTests(unittest.TestCase):("echo", ["echo", "-m", "vllm.entrypoints.openai.api_server"], ""),("VLLM::Worker_TP0-extra", [], ""),("VLLM::EngineCore_DP0", [], ""),+ ("VLLM::Worker_DP0_TP0", [], ""),+ ("VLLM::Worker_PP0_TP0", [], ""),+ ("VLLM::APIServer_0", [], ""),("vllm-helper", [], ""),]for name, cmd, role in cases:@@ -187,6 +194,21 @@ class VllmTests(unittest.TestCase):self.assertIn("API-reported model ID: org/model", text)self.assertIn("do not prove this process's model residency", text)+ def test_upstream_default_single_gpu_and_tp_layouts(self):+ # Default CLI calls run_server in the launcher process (no set_process_title there).+ # APIServer_<index> titles belong to APIServerProcessManager's multi-API worker path.+ with listener() as (port, seen):+ for name in ("VLLM::EngineCore", "VLLM::Worker", "VLLM::Worker_TP0", "VLLM::Worker_TP1"):+ with self.subTest(name=name):+ details = {10: ProcDetail(10, name, create_time=3),+ 20: ProcDetail(20, "VLLM::EngineCore", create_time=2),+ 30: ProcDetail(30, "python", cmdline=LAUNCH, create_time=1)}+ parents = {10: 30} if name == "VLLM::EngineCore" else {10: 20, 20: 30}+ _, snap = self.sample(details, {30: [port]}, parents)+ self.assertEqual(snap.procs[0].llm.server_source, "parent")+ self.assertEqual(snap.procs[0].llm.server.models[0]["name"], "org/model")+ self.assertEqual(seen, [("/v1/models", None)] * 4)+def test_unclear_ancestry_or_listeners_never_probe(self):for reason in ("two servers", "shared port", "two ports", "unrelated parent","newer parent", "reused parent", "reused worker", "unknown start", "cycle",