[CI] Main2main upgrade to 0324 #7787
Conversation
|
👋 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 focuses on improving compatibility between vLLM Ascend and upstream vLLM changes. It introduces several abstraction layers to handle differences in buffer management and API usage, ensuring that the Ascend backend remains functional across different versions of the core vLLM library. The changes primarily affect model runners, attention mechanisms, and configuration handling. Highlights
🧠 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. Ignored Files
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 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 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. Footnotes
|
There was a problem hiding this comment.
Code Review
Suggested PR Title:
[Attention][Ops][Worker][Misc] Enhance compatibility with upstream vLLM v0.18.0 and refactor buffer managementSuggested PR Summary:
### What this PR does / why we need it?
This PR updates the codebase to maintain compatibility with recent upstream vLLM refactoring, particularly version 0.18.0. It introduces compatibility wrappers in `NPUModelRunner` to handle the transition from `CpuGpuBuffer` to plain `Tensor` objects and provides a local implementation of `vllm_is_batch_invariant`. Additionally, it updates `kv_cache` indexing for multi-engine support and fixes potential aliasing bugs in position buffer management.
### Does this PR introduce _any_ user-facing change?
No.
### How was this patch tested?
CI passed with existing tests.I have no feedback to provide.
|
ClaudeCode fix summary: Detail fix process: |
|
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
453b20c to
dfc18b8
Compare
8264094 to
14a1449
Compare
Signed-off-by: leo-pony <nengjunma@outlook.com>
4b69841 to
dce84b9
Compare
…np'/'cpu'/'gpu') 和 hasattr(self.positions, 'np'/'copy_to_gpu') 的分支判断都是多余的 — 永远走 else 分支。已全部简化为直接使用 plain tensor API。 同理,input_ids 和 is_token_ids 始终是 CpuGpuBuffer,hasattr(..., 'cpu') and isinstance(...) 的判断也是多余的 — 永远走 .cpu 属性分支。已简化为直接 .cpu 访问。 Signed-off-by: leo-pony <nengjunma@outlook.com>
这些 buffer 始终是 plain GPU tensor,永远不会是 CpuGpuBuffer: · 删除所有 hasattr(self.seq_lens, 'np'/'cpu'/'gpu') 分支判断,直接使用 tensor API · 删除所有 hasattr(self.positions, 'np'/'copy_to_gpu') 分支判断,直接使用 _positions_np_buf + copy_ · 删除 _safe_copy_to_gpu(self.seq_lens) 无效调用(plain tensor 无 copy_to_gpu 方法,是 no-op) · _build_attention_metadata 中 seq_lens_cpu/seq_lens_gpu 直接用 .cpu()/直接引用 2. query_start_loc、gdn_query_start_loc — CpuGpuBuffer,去除冗余 else 分支 始终是 CpuGpuBuffer,直接使用 .np/.cpu/.gpu/.copy_to_gpu() API: · 5 处 hasattr(..., 'np') → 直接 .np[...] = ... · 2 处 hasattr(..., 'gpu') → 直接 .gpu[...] · 2 处 hasattr(..., 'cpu') and isinstance(...) → 直接 .cpu 3. input_ids、is_token_ids、inputs_embeds — CpuGpuBuffer,去除冗余 else 分支 始终是 CpuGpuBuffer,直接用 .cpu 属性访问。 4. discard_request_indices、num_accepted_tokens、num_decode_draft_tokens、mrope_positions、xdrope_positions — CpuGpuBuffer,同上 Signed-off-by: leo-pony <nengjunma@outlook.com>
Signed-off-by: Your Name <you@example.com>
Signed-off-by: wangbj127 <wangbj1207@126.com>
Signed-off-by: leo-pony <nengjunma@outlook.com>
…eam, see vllm pr:35007 Signed-off-by: leo-pony <nengjunma@outlook.com>
a0dffc1 to
7fef40e
Compare
… PR:32951 Signed-off-by: leo-pony <nengjunma@outlook.com>
8c6ccbe to
43ee1a3
Compare
Signed-off-by: leo-pony <nengjunma@outlook.com>
fa3cd4d to
2c6d795
Compare
| discard_requests_mask = original_seq_lens_np < num_tokens_np | ||
| else: | ||
| discard_requests_mask = self.seq_lens.np[:num_reqs] < num_tokens_np | ||
| discard_requests_mask = self.seq_lens.cpu().numpy()[:num_reqs] < num_tokens_np |
There was a problem hiding this comment.
plz use optimistic_seq_lens_cpu instead
Signed-off-by: leo-pony <nengjunma@outlook.com>
This reverts commit 811271d.
What this PR does / why we need it?
main2main upgrade to vllm 0324.
fix breaks:
PR #37487 [V0 Deprecation] Refactor kv cache from list to element (c59a132f9) — self.kv_cache from list[tensor](per virtual engine)changed to tensor
PR #37874 [KV Offload] Refactor CPU offloading: pluggable CachePolicy, remove Backend abstraction, restructure into cpu/ package (e3c6c10ca) — LRUOffloadingManager + CPUBackend been refactor to CPUOffloadingManager
PR #32951 [Async][Spec Decoding] Zero-bubble async scheduling + spec decoding (fafe76b4a) — a) changes self.positions and self.seq_lens from CpuGpuBuffer to plain GPU tensor; b) change _get_cumsum_and_arange output paramter. Another _prepare_input_ids add num_reqs.
PR #35007[Bugfix] Register VLLM_BATCH_INVARIANT in envs.py to fix spurious unknown env var warning (dc6908ac6) — delete vllm_is_batch_invariant() and const variable VLLM_BATCH_INVARIANT,replace with vllm.envs
Know issues:
1.310p Qwen3.5 test failed for qwen3.5 patch failure, see issue: #7976 @YangShuai52 is fixing.
Does this PR introduce any user-facing change?
How was this patch tested?
CI
Co-Authored-By: zhaomingyu zhaomingyu13@h-partners.com
wangbj127 wangbj1207@126.com
SidaoY 1024863041@qq.com
22dimensions waitingwind@foxmail.com