[TPU] Support GCS path in VLLM_TORCH_PROFILER_DIR (#28487)

Signed-off-by: Qiliang Cui <derrhein@gmail.com>
This commit is contained in:
QiliangCui 2025-11-12 14:31:14 -08:00 committed by GitHub
parent d8140b9833
commit 3eb0c2673e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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