-
-
Notifications
You must be signed in to change notification settings - Fork 8.5k
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
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Yang Wang <[email protected]>
Signed-off-by: Yang Wang <[email protected]>
Signed-off-by: Yang Wang <[email protected]>
👋 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 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 🚀 |
There was a problem hiding this 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 nightlypip 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 newrequirements/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 fromrequirements/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 removingmamba_ssm
from thewhite_list
and updated the accompanying comments to clarify that such specific dependencies should now be placed intorch_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
-
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. ↩
There was a problem hiding this 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.
Signed-off-by: Yang Wang <[email protected]>
Signed-off-by: Yang Wang <[email protected]>
cb37d50
to
bc49c76
Compare
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]>
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 |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
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.
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]>
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