Skip to content

Resolve the torch nightly sync issue #20393

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 17 commits into
base: main
Choose a base branch
from

Conversation

yangw-dev
Copy link
Collaborator

@yangw-dev yangw-dev commented Jul 2, 2025

Add manual txt to give flexibility to solve the dependency issues we have in vllm x torch nightly.
Add readme to guide how to solve incompability issue

yangw-dev added 3 commits July 2, 2025 10:45
Signed-off-by: Yang Wang <[email protected]>
Signed-off-by: Yang Wang <[email protected]>
Signed-off-by: Yang Wang <[email protected]>
Copy link

github-actions bot commented Jul 2, 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 can run other CI tests on top of those by going to your fastcheck build on Buildkite UI (linked in the PR checks section) and unblock them. If you do not have permission to unblock, ping simon-mo or khluu to add you in our Buildkite org.

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.

🚀

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.

Summary of Changes

Hello @yangw-dev, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request enhances the dependency management system for PyTorch nightly builds by introducing a new mechanism for handling specific, potentially problematic, Python packages. It establishes a dedicated file for manually specified dependencies, integrating its installation into both the Docker build process for nightly images and the existing dependency validation script. This change aims to provide greater flexibility and control over the build environment, particularly for packages that require special handling outside of the automated nightly dependency resolution.

Highlights

  • New Manual Dependency File: I've introduced requirements/nightly_torch_test_manual.txt to provide a dedicated location for specifying dependencies that might not be compatible with direct PyTorch nightly pip install or could cause test failures, allowing for more controlled dependency management.
  • Docker Build Integration: I've updated docker/Dockerfile.nightly_torch to copy and install dependencies from the new requirements/nightly_torch_test_manual.txt file, ensuring these manually specified packages are included in the nightly Torch Docker images.
  • Dependency Test Script Update: I've modified tests/standalone_tests/pytorch_nightly_dependency.sh to also install dependencies from requirements/nightly_torch_test_manual.txt and updated the warning message to guide users on utilizing this new manual dependency file.
  • Dependency Whitelist Adjustment: I've adjusted tools/generate_nightly_torch_test.py by removing mamba_ssm from the white_list and updated the accompanying comments to clarify that such specific dependencies should now be placed in torch_nightly_test_manual.txt if a compatible version is found.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in issue comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist is currently in preview and may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments to provide feedback.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@mergify mergify bot added the ci/build label Jul 2, 2025
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 introduces a manual requirements file (nightly_torch_test_manual.txt) to provide more flexibility for nightly PyTorch dependency management. The changes update the Dockerfile and test scripts to use this new file. My review focuses on improving the implementation by suggesting combining installation steps for better efficiency and smaller Docker image size, and enhancing clarity in user-facing messages and code comments.

yangw-dev added 2 commits July 2, 2025 11:04
Signed-off-by: Yang Wang <[email protected]>
Signed-off-by: Yang Wang <[email protected]>
@mergify mergify bot added the documentation Improvements or additions to documentation label Jul 2, 2025
yangw-dev added 3 commits July 2, 2025 11:16
Signed-off-by: Yang Wang <[email protected]>
Signed-off-by: Yang Wang <[email protected]>
Signed-off-by: Yang Wang <[email protected]>
@yangw-dev yangw-dev changed the title Autosyncdisable Resolve the torch nightly sync issue Jul 2, 2025
@yangw-dev yangw-dev requested a review from zou3519 July 2, 2025 18:19
yangw-dev added 2 commits July 2, 2025 11:31
Signed-off-by: Yang Wang <[email protected]>
Signed-off-by: Yang Wang <[email protected]>
@yangw-dev yangw-dev marked this pull request as ready for review July 2, 2025 18:45
@yangw-dev yangw-dev requested a review from hmellor as a code owner July 2, 2025 18:45
@yangw-dev yangw-dev added the ready ONLY add when PR is ready to merge/full CI is needed label Jul 2, 2025
Comment on lines +18 to +19
1. Add the problematic dependency to the `white_list` in `tools/generate_nightly_torch_test.py`
2. This allows the dependency to coexist with PyTorch nightly
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do we need to manually run tools/generate_nightly_torch_test.py or does that get run automatically somehow? If automatic, where does it happen?

Copy link
Collaborator Author

@yangw-dev yangw-dev Jul 2, 2025

Choose a reason for hiding this comment

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

the precomit automation happens locally.

@zou3519

precommit workflow

the workflow precommit triggered for each commit

if things does not match, the pre-commit job here will fail, user normally need to run precomit and fix it locally
example failure precommit
Example error and guidance:

pre-commit hook(s) made changes.
If you are seeing this message in CI, reproduce locally with: `pre-commit run --all-files`.
To run `pre-commit` as part of git workflow, use `pre-commit install`.
All changes made by hooks:
diff --git a/requirements/nightly_torch_test.txt b/requirements/nightly_torch_test.txt
index 304eb34..aff893d 100644
--- a/requirements/nightly_torch_test.txt
+++ b/requirements/nightly_torch_test.txt
@@ -21,6 +21,7 @@ sentence-transformers # required for embedding tests
 soundfile # required for audio tests
 jiwer # required for audio tests
 timm # required for internvl test.
+
 transformers_stream_generator # required for qwen-vl test
 mamba_ssm # required for plamo2 test
 matplotlib # required for qwen-vl test
@@ -29,6 +30,7 @@ num2words # required for smolvlm test
 opencv-python-headless >= 4.11.0 # required for video test
 datamodel_code_generator # required for minicpm3 test
 lm-eval[api]==0.4.8 # required for model evaluation test
+mteb[bm25s]>=1.38.11, <2 # required for mteb test
 transformers==4.52.4
 tokenizers==0.21.1
 huggingface-hub[hf_xet]>=0.33.0  # Required for Xet downloads.

auto-generate locally

vllm has a precommit setup locally, what does it mean is, it's a local tool that will run everytime you do git commit, they use that to auto generate requirements/test.txt, you can try it

At root of repo vllm, install precommit then run

pre-commit install --config .pre-commit-config.yaml 

when user do git commit it will trigger the precommit-config.yaml file in vllm/ which includes generate_nightly_torch_test.

@yangw-dev yangw-dev requested a review from zou3519 July 2, 2025 19:38
yangw-dev added 7 commits July 2, 2025 12:50
Signed-off-by: Yang Wang <[email protected]>
Signed-off-by: Yang Wang <[email protected]>
Signed-off-by: Yang Wang <[email protected]>
Signed-off-by: Yang Wang <[email protected]>
Signed-off-by: Yang Wang <[email protected]>
Signed-off-by: Yang Wang <[email protected]>
Signed-off-by: Yang Wang <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci/build documentation Improvements or additions to documentation ready ONLY add when PR is ready to merge/full CI is needed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants