Skip to content

Conversation

@jiangwu300
Copy link

@jiangwu300 jiangwu300 commented Dec 5, 2025

Purpose

This PR makes it so that when a model is a s3 (or other cloud storage location) and we have runai_streamer turned on, we do not overwrite the self.model with a local directory which leads to failure of engine initialization since the local dir will not have the safe tensors.

Test Plan

Run a simple ray job with ray data llm, passing in a s3 model path with runai_streamer turned on.

Test Result

Runs as expected, no more failure.


Essential Elements of an Effective PR Description Checklist
  • The purpose of the PR, such as "Fix some issue (link existing issues this PR will resolve)".
  • The test plan, such as providing test command.
  • The test results, such as pasting the results comparison before and after, or e2e results
  • (Optional) The necessary documentation update, such as updating supported_models.md and examples for a new model.
  • (Optional) Release notes update. If your change is user facing, please update the release notes draft in the Google Doc.

@github-actions
Copy link

github-actions bot commented Dec 5, 2025

👋 Hi! Thank you for contributing to the vLLM project.

💬 Join our developer Slack at https://slack.vllm.ai to discuss your PR in #pr-reviews, coordinate on features in #feat- channels, or join special interest groups in #sig- channels.

Just a reminder: PRs would not trigger full CI run by default. Instead, it would only run fastcheck CI which starts running only a small and essential subset of CI tests to quickly catch errors.

You ask your reviewers to trigger select CI tests on top of fastcheck CI.

Once the PR is approved and ready to go, your PR reviewer(s) can run CI to test the changes comprehensively before merging.

To run CI, PR reviewers can either: Add ready label to the PR or enable auto-merge.

If you have any questions, please reach out to us on Slack at https://slack.vllm.ai.

🚀

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request addresses a bug where the model path is incorrectly overwritten when using runai_streamer with models from cloud storage. The fix prevents this overwrite, ensuring the engine initializes correctly. My review identifies an oversight where the fix doesn't account for the runai_streamer_sharded load format, which would lead to the same bug. I've suggested a more robust condition to cover all runai_streamer variants.

model_config = self.create_model_config()
self.model = model_config.model
# if streaming from cloud storage, do not overwrite self.model with local dir
if not (is_cloud_storage(self.model) and self.load_format=="runai_streamer"):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The condition to prevent overwriting self.model only checks for load_format=="runai_streamer". This is incomplete as it misses other runai_streamer variants like runai_streamer_sharded. If a user specifies load_format="runai_streamer_sharded" with a cloud storage model path, self.model will be incorrectly overwritten with a local directory, leading to the same failure this PR aims to fix. Using startswith("runai_streamer") would be more robust and cover all related formats.

Suggested change
if not (is_cloud_storage(self.model) and self.load_format=="runai_streamer"):
if not (is_cloud_storage(self.model) and self.load_format.startswith("runai_streamer")):

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are there other modes we need to consider as well like tokenizer? I'm not sure which load_formats actually skip tensors being downloaded and use streaming

@mergify
Copy link

mergify bot commented Dec 5, 2025

Hi @jiangwu300, the pre-commit checks have failed. Please run:

uv pip install pre-commit
pre-commit install
pre-commit run --all-files

Then, commit the changes and push to your branch.

For future commits, pre-commit will run automatically on changed files before each commit.

@Isotr0py
Copy link
Member

Isotr0py commented Dec 6, 2025

After a second eye, I think it's better to fix this inside ModelConfig where redirected model, WDYT?

vllm/vllm/config/model.py

Lines 769 to 787 in 02a4169

def maybe_pull_model_tokenizer_for_runai(self, model: str, tokenizer: str) -> None:
"""Pull model/tokenizer from Object Storage to temporary
directory when needed.
Args:
model: Model name or path
tokenizer: Tokenizer name or path
"""
if not (is_runai_obj_uri(model) or is_runai_obj_uri(tokenizer)):
return
if is_runai_obj_uri(model):
object_storage_model = ObjectStorageModel(url=model)
object_storage_model.pull_files(
model, allow_pattern=["*.model", "*.py", "*.json"]
)
self.model_weights = model
self.model = object_storage_model.dir

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.

2 participants