[Feature] Support ARC eviction policy for NPU offloader#7125
[Feature] Support ARC eviction policy for NPU offloader#7125ZhongsJie wants to merge 3 commits intovllm-project:mainfrom
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 enhances the NPU offloader by integrating the Adaptive Replacement Cache (ARC) eviction policy, aligning its functionality with recent upstream vLLM developments for CPU offloaders. This change provides greater flexibility in managing KV cache offloading, potentially improving performance and efficiency for NPU-based systems by offering a more sophisticated cache replacement algorithm. 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. Changelog
Activity
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. 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
|
There was a problem hiding this comment.
Code Review
This pull request introduces support for the ARC eviction policy for the NPU offloader. While the implementation seems correct, there are several high-severity issues that must be addressed before merging:
-
Lack of Testing: The new ARC eviction policy is introduced without any tests. It is critical to add tests to validate its functionality and prevent future regressions. You could, for example, extend
tests/e2e/singlecard/test_cpu_offloading.pyto cover thearcpolicy. -
Incomplete Pull Request Description: The PR description is missing key information. The sections 'Does this PR introduce any user-facing change?' and 'How was this patch tested?' must be filled out. Note that adding the
eviction_policyoption is a user-facing change. -
Style Guide Violation: The PR title and description do not follow the repository's style guide. As requested by the guide, here are suggestions to align with the required format:
Suggested PR Title:
[NPU][Feature] Support ARC eviction policy for NPU offloader
Suggested PR Summary:
### What this PR does / why we need it?
The upstream vLLM project has already added support for the ARC cache eviction policy in the CPU offloader. This PR adapts the same functionality for the NPU, allowing users to select 'arc' as the `eviction_policy` in `kv_connector_extra_config`.
Fixes #
### Does this PR introduce _any_ user-facing change?
Yes. This PR introduces a new `eviction_policy` option in `kv_connector_extra_config` for the NPU offloader. It can be set to `lru` (default) or `arc`.
### How was this patch tested?
<!--
CI passed with new added/existing test.
If it was tested in a way different from regular unit tests, please clarify how you tested step by step, ideally copy and paste-able, so that other reviewers can test and check, and descendants can verify in the future.
If tests were not added, please describe why they were not added and/or why it was difficult to add.
-->|
@nalinaly @MengqingCao Could you spare some time to help review it? |
|
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
e3967f2 to
0272b11
Compare
|
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
Signed-off-by: ZhongsJie <zhongsjie@gmail.com>
67d3b82 to
b23759d
Compare
What this PR does / why we need it?
The upstream vLLM project has already added support for the ARC cache eviction policy in the CPU offloader (see vllm-project/vllm#27039). This PR adapts the same functionality for the NPU.
Does this PR introduce any user-facing change?
How was this patch tested?