From 3eb0c2673e128714073f7e3fd105cf962a4c8c16 Mon Sep 17 00:00:00 2001 From: QiliangCui Date: Wed, 12 Nov 2025 14:31:14 -0800 Subject: [PATCH] [TPU] Support GCS path in VLLM_TORCH_PROFILER_DIR (#28487) Signed-off-by: Qiliang Cui --- vllm/envs.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/vllm/envs.py b/vllm/envs.py index b99e2524318fd..8e2f872c069c7 100755 --- a/vllm/envs.py +++ b/vllm/envs.py @@ -824,9 +824,11 @@ environment_variables: dict[str, Callable[[], Any]] = { # Note that it must be an absolute path. "VLLM_TORCH_PROFILER_DIR": lambda: ( None - if os.getenv("VLLM_TORCH_PROFILER_DIR", None) is None - else os.path.abspath( - os.path.expanduser(os.getenv("VLLM_TORCH_PROFILER_DIR", ".")) + if (val := os.getenv("VLLM_TORCH_PROFILER_DIR")) is None + else ( + val + if val.startswith("gs://") and val[5:] and val[5] != "/" + else os.path.abspath(os.path.expanduser(val)) ) ), # Enable torch profiler to record shapes if set