Skip to content

[Main2Main] Upgrade vLLM to 0305#7099

Closed
menogrey wants to merge 17 commits intovllm-project:mainfrom
menogrey:main2main
Closed

[Main2Main] Upgrade vLLM to 0305#7099
menogrey wants to merge 17 commits intovllm-project:mainfrom
menogrey:main2main

Conversation

@menogrey
Copy link
Copy Markdown
Collaborator

@menogrey menogrey commented Mar 10, 2026

@github-actions github-actions bot added documentation Improvements or additions to documentation ci/build labels Mar 10, 2026
@github-actions
Copy link
Copy Markdown
Contributor

👋 Hi! Thank you for contributing to the vLLM Ascend project. The following points will speed up your PR merge:‌‌

  • A PR should do only one thing, smaller PRs enable faster reviews.
  • Every PR should include unit tests and end-to-end tests ‌to ensure it works and is not broken by other future PRs.
  • Write the commit message by fulfilling the PR description to help reviewer and future developers understand.

If CI fails, you can run linting and testing checks locally according Contributing and Testing.

@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, 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 focuses on upgrading the vLLM dependency to version 0.3.5 and adapting the Ascend-specific components to maintain compatibility. Key changes involve refining memory management for NPU devices by introducing a dedicated empty_cache patch and an NPU-aware memory profiling context manager. Additionally, the profiling process was optimized to avoid compilation issues specific to Ascend, ensuring more accurate memory estimations during model setup.

Highlights

  • vLLM Upgrade: The project has been upgraded to vLLM version 0.3.5, with the corresponding commit hash updated in the versioning policy documentation.
  • NPU-Specific Memory Management: A new patch was introduced to redirect torch.accelerator.empty_cache calls to torch.npu.empty_cache, ensuring proper memory handling on Ascend devices.
  • Profiling Optimization: Compilation and CUDAGraph modes are now temporarily disabled during profiling runs in ModelRunnerV1 to prevent FakeTensorMode mismatches and improve memory estimation accuracy on Ascend.
  • Dedicated NPU Memory Profiling: A new npu_memory_profiling context manager was added to NPUWorker to provide NPU-safe memory profiling, replacing the generic memory_profiling for Ascend-specific operations.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • docs/source/community/versioning_policy.md
    • Updated the vLLM commit hash reference to reflect the upgrade to 0.3.5.
  • vllm_ascend/patch/platform/init.py
    • Imported the newly added patch_torch_accelerator module.
  • vllm_ascend/patch/platform/patch_torch_accelerator.py
    • Added a new file to patch torch.accelerator.empty_cache to use torch.npu.empty_cache.
  • vllm_ascend/worker/model_runner_v1.py
    • Modified the _model_forward call to include a skip_compiled flag for profiling.
    • Temporarily disabled CompilationMode and CUDAGraphMode during profile_run to prevent FakeTensorMode mismatches on Ascend.
  • vllm_ascend/worker/worker.py
    • Imported contextlib and Generator for the new context manager.
    • Updated the import for memory_profiling to MemoryProfilingResult.
    • Added a new npu_memory_profiling context manager for NPU-specific memory profiling.
    • Switched the determine_available_memory method to use the new npu_memory_profiling context manager.
Ignored Files
  • Ignored by pattern: .github/workflows/** (6)
    • .github/workflows/bot_pr_create.yaml
    • .github/workflows/dockerfiles/Dockerfile.lint
    • .github/workflows/pr_test_full.yaml
    • .github/workflows/pr_test_light.yaml
    • .github/workflows/schedule_codecov_refresh.yaml
    • .github/workflows/schedule_update_estimated_time.yaml
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 by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

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 pull request 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 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. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

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.

@menogrey menogrey added ready read for review ready-for-test start test by label for PR and removed documentation Improvements or additions to documentation ci/build labels Mar 10, 2026
Copy link
Copy Markdown
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 upgrades the vLLM dependency and adapts the codebase to the changes. The main adaptations involve providing NPU-specific workarounds for memory profiling and disabling compilation during profiling runs to prevent errors on Ascend. The changes appear correct and robust.

I have provided suggestions for the pull request title and summary to align with the repository's style guide. Please see below.

Suggested PR Title:

[Main2Main][Core][Misc] Upgrade vLLM to commit 5b3ba94

Suggested PR Summary:

### What this PR does / why we need it?

This PR upgrades the vLLM dependency to commit `5b3ba94ab4bd9da739bcc27cdd05505467fa499e` to keep up with the latest upstream changes.

This upgrade introduces changes that require adaptation for the Ascend backend. Specifically:
- Upstream vLLM now uses `torch.accelerator.empty_cache()`, which is not supported on `torch-npu`. This PR introduces a patch to redirect this call to `torch.npu.empty_cache()` and also provides an NPU-specific memory profiling utility to avoid issues during memory profiling.
- Changes in upstream profiling logic could lead to `FakeTensorMode` mismatches on Ascend. This PR disables compilation and graph modes during profiling runs to prevent this.

### Does this PR introduce _any_ user-facing change?

No.

### How was this patch tested?

CI passed with existing tests.

@github-actions
Copy link
Copy Markdown
Contributor

This pull request has conflicts, please resolve those before we can evaluate the pull request.

@github-actions
Copy link
Copy Markdown
Contributor

This pull request has conflicts, please resolve those before we can evaluate the pull request.

@github-actions
Copy link
Copy Markdown
Contributor

This pull request has conflicts, please resolve those before we can evaluate the pull request.

menogrey and others added 5 commits March 16, 2026 10:01
Signed-off-by: MrZ20 <2609716663@qq.com>
Signed-off-by: menogrey <1299267905@qq.com>
Signed-off-by: MrZ20 <2609716663@qq.com>
Signed-off-by: menogrey <1299267905@qq.com>
Signed-off-by: menogrey <1299267905@qq.com>
Signed-off-by: menogrey <1299267905@qq.com>
menogrey added 10 commits March 16, 2026 10:02
Signed-off-by: menogrey <1299267905@qq.com>
Signed-off-by: menogrey <1299267905@qq.com>
Signed-off-by: menogrey <1299267905@qq.com>
Signed-off-by: menogrey <1299267905@qq.com>
Signed-off-by: menogrey <1299267905@qq.com>
Signed-off-by: menogrey <1299267905@qq.com>
Signed-off-by: menogrey <1299267905@qq.com>
Signed-off-by: menogrey <1299267905@qq.com>
Signed-off-by: menogrey <1299267905@qq.com>
Signed-off-by: menogrey <1299267905@qq.com>
Signed-off-by: menogrey <1299267905@qq.com>
Signed-off-by: menogrey <1299267905@qq.com>
@github-actions
Copy link
Copy Markdown
Contributor

This pull request has conflicts, please resolve those before we can evaluate the pull request.

@menogrey
Copy link
Copy Markdown
Collaborator Author

out-of-dated, close

@menogrey menogrey closed this Apr 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-conflicts ready read for review ready-for-test start test by label for PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants