Skip to content

Skip os.makedirs for GCS profile paths in TPU worker#2982

Open
subhamsoni-google wants to merge 4 commits into
vllm-project:mainfrom
subhamsoni-google:subhamsoni/gcs-profile-dir-support
Open

Skip os.makedirs for GCS profile paths in TPU worker#2982
subhamsoni-google wants to merge 4 commits into
vllm-project:mainfrom
subhamsoni-google:subhamsoni/gcs-profile-dir-support

Conversation

@subhamsoni-google

Copy link
Copy Markdown

The C++ profiler backend (tsl::Env) natively supports gs:// paths via RetryingGcsFileSystem, handling directory creation internally. Guard the os.makedirs call to only run for local filesystem paths, preventing it from creating a spurious local directory named "gs:/bucket/..." when a GCS URI is passed as torch_profiler_dir.

Add tests verifying:

  • GCS paths skip os.makedirs on rank 0 (single PP)
  • GCS paths skip os.makedirs in pipeline-parallel mode
  • Local paths still call os.makedirs in pipeline-parallel mode
  • GCS paths are passed directly to jax.profiler.start_trace

Description

Start with a short description of what the PR does and how this is a change from
the past.

The rest of the description includes relevant details and context, examples:

  • why is this change being made,
  • the problem being solved and any relevant context,
  • why this is a good solution,
  • some information about the specific implementation,
  • shortcomings of the solution and possible future improvements.

If the change fixes a Github issue, please include a link, e.g.,:
FIXES: #123456

Tests

Please describe how you tested this change, and include any instructions and/or
commands to reproduce.

Checklist

Before submitting this PR, please make sure:

  • I have performed a self-review of my code.
  • I have necessary comments in my code, particularly in hard-to-understand areas.
  • I have made or will make corresponding changes to any relevant documentation.

The C++ profiler backend (tsl::Env) natively supports gs:// paths
via RetryingGcsFileSystem, handling directory creation internally.
Guard the os.makedirs call to only run for local filesystem paths,
preventing it from creating a spurious local directory named
"gs:/bucket/..." when a GCS URI is passed as torch_profiler_dir.

Add tests verifying:
- GCS paths skip os.makedirs on rank 0 (single PP)
- GCS paths skip os.makedirs in pipeline-parallel mode
- Local paths still call os.makedirs in pipeline-parallel mode
- GCS paths are passed directly to jax.profiler.start_trace
@subhamsoni-google

Copy link
Copy Markdown
Author

I have verified over GKE env, that the vllm via the logdir is working perfectly fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant