Skip to content

[Misc][310p] Fix CPU binding and NPU memory usage issues during server start - #9599

Open
Tflowers-0129 wants to merge 1 commit into
vllm-project:mainfrom
Tflowers-0129:525-cpu-binding-310p
Open

Tflowers-0129 wants to merge 1 commit into
vllm-project:mainfrom
Tflowers-0129:525-cpu-binding-310p

Conversation

@Tflowers-0129

@Tflowers-0129 Tflowers-0129 commented May 26, 2026 •

Copy link
Copy Markdown
Collaborator

What this PR does / why we need it?

Does this PR introduce any user-facing change?

How was this patch tested?

…ce startup

Signed-off-by: Tflowers-0129 <2906339855@qq.com>
@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 addresses critical startup issues on 310P hardware by implementing a memory reservation strategy for ACL graph capture and refining the CPU binding and topology affinity logic. These changes ensure stable resource management and improved compatibility with the 310P NPU architecture, preventing potential memory conflicts and binding failures during server initialization.

Highlights

  • Memory Reservation: Introduced a memory reservation mechanism for 310P ACL graph capture to prevent memory allocation overlaps with the KV cache.
  • CPU Binding Enhancements: Improved CPU affinity parsing and NPU mapping logic to correctly support the 310P architecture, ensuring proper resource distribution.
  • Board Information Retrieval: Refined the board information querying process to better support IRQ binding on 310P devices.
  • Robustness and Debugging: Added comprehensive error handling and enhanced debug logging for NPU binding and topology affinity parsing to simplify troubleshooting.
New Features

🧠 You can now enable Memory (public preview) 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.

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 the 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 counterproductive. 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.

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. ↩

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

Suggested PR Title:

[vllm-ascend][Feature] Support ACL graph memory reservation and improve CPU binding for 310P

Suggested PR Summary:

### What this PR does / why we need it?
This PR introduces a memory reservation mechanism for 310P ACL graph capture to prevent overlapping allocations with the graph-pool, safely reducing the available KV cache budget. Additionally, it refactors CPU topology affinity parsing and board info retrieval to correctly map logical NPU IDs to physical NPUs on 310P systems.

Feedback: A potential `AttributeError` was identified in `_get_310p_aclgraph_memory_reserve` where `vllm_config.model_config` might be `None` in some testing environments. A guard has been suggested to safely retrieve `max_model_len`.

### Does this PR introduce _any_ user-facing change?
No, these are internal memory management and CPU binding optimizations for Ascend 310P.

### How was this patch tested?
Not explicitly specified in the diff, but should be verified with unit tests and NPU-smi topology configurations.

Comment on lines +72 to +74
max_model_len = vllm_config.model_config.max_model_len
if max_model_len <= 0:
return GiB_bytes

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

high

In some testing or dummy initialization scenarios, vllm_config.model_config can be None. Accessing vllm_config.model_config.max_model_len directly without a guard can lead to an AttributeError. We should safely retrieve model_config first and default max_model_len to 0 if it is not present.

Suggested change
max_model_len = vllm_config.model_config.max_model_len
if max_model_len <= 0:
return GiB_bytes
model_config = getattr(vllm_config, "model_config", None)
max_model_len = model_config.max_model_len if model_config else 0
if max_model_len <= 0:
return GiB_bytes

@github-actions

github-actions Bot commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant