-
-
Notifications
You must be signed in to change notification settings - Fork 8.8k
[WIP] backed_Size_oblivious + pytorch 2.8 #20719
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: Huy Do <[email protected]>
Signed-off-by: Huy Do <[email protected]>
Signed-off-by: Huy Do <[email protected]>
Signed-off-by: Huy Do <[email protected]>
Signed-off-by: Huy Do <[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 @laithsakka, 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 primarily focuses on upgrading the project's core PyTorch dependency to version 2.8.0, along with its associated libraries like torchvision and torchaudio. It also introduces a specific optimization for torch.compile
using backed_size_oblivious
mode, and includes necessary adjustments to build processes and dependencies to ensure compatibility with the new PyTorch version, including temporary workarounds for unreleased components.
Highlights
- PyTorch Version Update: I've updated the project's PyTorch dependency from version 2.7.0 to 2.8.0 across all relevant configuration files, including
CMakeLists.txt
,pyproject.toml
, and variousrequirements/*.txt
files (build, CPU, CUDA, ROCm, test). - PyTorch Test/RC Index Integration: To support the PyTorch 2.8.0 update, I've configured
pip-compile
and Docker builds to use the PyTorch test/release candidate (RC) index (https://download.pytorch.org/whl/test/
) for dependencies liketorch
,torchaudio
,torchvision
, andflashinfer
. This is reflected in.pre-commit-config.yaml
,docker/Dockerfile
, andrequirements/test.in
. - XFormers Compatibility Workaround: Since
xformers
0.0.30 is not yet officially released for PyTorch 2.8.0, I've added a temporary workaround indocker/Dockerfile
to installxformers
directly from its GitHub repository. Therequirements/cuda.txt
file also reflects this temporary change by commenting out the direct version dependency. - Torch.compile Enhancement: I've modified
vllm/worker/model_runner.py
to wrap thetorch.compile
call withtorch.fx.experimental._config.patch(backed_size_oblivious=True)
. This change likely aims to leverage a new feature in PyTorch 2.8 for improved memory management or performance during model compilation. - Dependency Updates: Beyond PyTorch, I've updated
torchvision
to 0.23.0,torchaudio
to 2.8.0, andtriton
to 3.4.0. Additionally, variousnvidia-cuda
related packages inrequirements/test.txt
have been updated to newer versions compatible with PyTorch 2.8. - Documentation and Test Script Updates: I've updated the
docs/contributing/ci/update_pytorch_version.md
to include instructions for using PyTorch RC in tests, and applied this change directly totests/standalone_tests/python_only_compile.sh
for immediate testing.
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 updates the project to use PyTorch 2.8 and introduces the backed_size_oblivious
feature. The changes across various configuration files and dependency lists are largely consistent with this goal. My review focuses on ensuring dependency management is consistent across all installation methods and removing temporary debugging code before merging. I've identified a critical issue in requirements/cuda.txt
where a necessary dependency is commented out, and a few minor cleanup items in the Dockerfile and a test script.
# TODO (huydhn): Re-enable this once xformers is released for 2.8.0 | ||
# https://github.com/facebookresearch/xformers/releases/tag/v0.0.30 | ||
xformers==0.0.30; platform_system == 'Linux' and platform_machine == 'x86_64' # Requires PyTorch >= 2.7 | ||
# git+https://github.com/facebookresearch/xformers@v0.0.30; platform_system == 'Linux' and platform_machine == 'x86_64' # Requires PyTorch >= 2.7 |
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 xformers
dependency is commented out, which will likely cause installation issues for users who rely on this requirements file. To ensure consistency with the Dockerfile, which installs xformers
from git, this line should be uncommented. I've also updated the comment to reflect the new PyTorch version.
# TODO (huydhn): Re-enable this once xformers is released for 2.8.0
# https://github.com/facebookresearch/xformers/releases/tag/v0.0.30
git+https://github.com/facebookresearch/[email protected]; platform_system == 'Linux' and platform_machine == 'x86_64' # Requires PyTorch >= 2.8
# DEBUG | ||
python3 -m xformers.info |
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.
@@ -18,7 +18,9 @@ apt autoremove -y | |||
|
|||
echo 'import os; os.system("touch /tmp/changed.file")' >> vllm/__init__.py | |||
|
|||
VLLM_TEST_USE_PRECOMPILED_NIGHTLY_WHEEL=1 VLLM_USE_PRECOMPILED=1 pip3 install -vvv -e . | |||
# TESTING, TO BE REMOVED |
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.
self.model, | ||
fullgraph=envs.VLLM_TEST_DYNAMO_FULLGRAPH_CAPTURE, | ||
backend=backend) | ||
with torch.fx.experimental._config.patch(backed_size_oblivious=True): |
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.
how can we localize this to lora?
This pull request has merge conflicts that must be resolved before it can be |
Essential Elements of an Effective PR Description Checklist
supported_models.md
andexamples
for a new model.Purpose
Test Plan
Test Result
(Optional) Documentation Update