[Misc][310p] Fix CPU binding and NPU memory usage issues during server start - #9599
Tflowers-0129 wants to merge 1 commit into
Conversation
…ce startup Signed-off-by: Tflowers-0129 <2906339855@qq.com>
|
👋 Hi! Thank you for contributing to the vLLM Ascend project. The following points will speed up your PR merge:
If CI fails, you can run linting and testing checks locally according Contributing and Testing. |
Summary of ChangesHello, 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
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 AssistThe 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
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 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
|
There was a problem hiding this comment.
Code Review
Suggested PR Title:
[vllm-ascend][Feature] Support ACL graph memory reservation and improve CPU binding for 310PSuggested 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.| max_model_len = vllm_config.model_config.max_model_len | ||
| if max_model_len <= 0: | ||
| return GiB_bytes |
There was a problem hiding this comment.
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.
| 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 |
|
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
What this PR does / why we need it?
Does this PR introduce any user-facing change?
How was this patch tested?