Add sleep mode feature for Ascend NPU#513
Merged
wangxiyuan merged 1 commit intovllm-project:mainfrom Apr 18, 2025
antonlisq:sleepmode
Merged
Add sleep mode feature for Ascend NPU#513wangxiyuan merged 1 commit intovllm-project:mainfrom antonlisq:sleepmode
wangxiyuan merged 1 commit intovllm-project:mainfrom
antonlisq:sleepmode
Conversation
Signed-off-by: Shuqiao Li <celestialli@outlook.com>
Collaborator
|
LGTM. sleep mode feature is mainly reviewed via 0.7.3 branch. let's merge this quickly first. |
wangxiyuan
approved these changes
Apr 18, 2025
ttanzhiqiang
pushed a commit
to ttanzhiqiang/vllm-ascend
that referenced
this pull request
Apr 27, 2025
### What this PR does / why we need it? This PR adds sleep mode feature for vllm-ascend, when sleeps, we do mainly two things: - offload model weights - discard kv cache RLHF tools(such as https://github.com/volcengine/verl and https://github.com/OpenRLHF/OpenRLHF) have a strong need of sleep mode to accelerate the training process. This PR may solve vllm-project#375 and vllm-project#320 . ### Does this PR introduce _any_ user-facing change? No existing user interfaces changed. Users will have two new methods(`sleep()` and `wake_up()`) to use. ### How was this patch tested? This PR is tested with Qwen/Qwen2.5-0.5B-Instruct. At first, we have free NPU memory M1. After `llm = LLM("Qwen/Qwen2.5-0.5B-Instruct", enable_sleep_mode=True)` executed, we have free NPU memory M2. M2 < M1. Then we call `llm.sleep(level=1)`, we have free NPU memory M3. We have M3 > M2, M3 is very close to M1. Plus, we have the same output tokens before sleep and after wake up, with the config of `SamplingParams(temperature=0, max_tokens=10)` and with the same input tokens of course. This PR is utilizing the CMake procedure of vllm-project#371 , thanks a lot. Signed-off-by: Shuqiao Li <celestialli@outlook.com>
Angazenn
pushed a commit
to Angazenn/vllm-ascend
that referenced
this pull request
Oct 21, 2025
### What this PR does / why we need it? This PR adds sleep mode feature for vllm-ascend, when sleeps, we do mainly two things: - offload model weights - discard kv cache RLHF tools(such as https://github.com/volcengine/verl and https://github.com/OpenRLHF/OpenRLHF) have a strong need of sleep mode to accelerate the training process. This PR may solve vllm-project#375 and vllm-project#320 . ### Does this PR introduce _any_ user-facing change? No existing user interfaces changed. Users will have two new methods(`sleep()` and `wake_up()`) to use. ### How was this patch tested? This PR is tested with Qwen/Qwen2.5-0.5B-Instruct. At first, we have free NPU memory M1. After `llm = LLM("Qwen/Qwen2.5-0.5B-Instruct", enable_sleep_mode=True)` executed, we have free NPU memory M2. M2 < M1. Then we call `llm.sleep(level=1)`, we have free NPU memory M3. We have M3 > M2, M3 is very close to M1. Plus, we have the same output tokens before sleep and after wake up, with the config of `SamplingParams(temperature=0, max_tokens=10)` and with the same input tokens of course. This PR is utilizing the CMake procedure of vllm-project#371 , thanks a lot. Signed-off-by: Shuqiao Li <celestialli@outlook.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this PR does / why we need it?
This PR adds sleep mode feature for vllm-ascend, when sleeps, we do mainly two things:
RLHF tools(such as https://github.com/volcengine/verl and https://github.com/OpenRLHF/OpenRLHF) have a strong need of sleep mode to accelerate the training process.
This PR may solve #375 and #320 .
Does this PR introduce any user-facing change?
No existing user interfaces changed.
Users will have two new methods(
sleep()andwake_up()) to use.How was this patch tested?
This PR is tested with Qwen/Qwen2.5-0.5B-Instruct.
At first, we have free NPU memory M1.
After
llm = LLM("Qwen/Qwen2.5-0.5B-Instruct", enable_sleep_mode=True)executed, we have free NPU memory M2. M2 < M1.Then we call
llm.sleep(level=1), we have free NPU memory M3.We have M3 > M2, M3 is very close to M1.
Plus, we have the same output tokens before sleep and after wake up, with the config of
SamplingParams(temperature=0, max_tokens=10)and with the same input tokens of course.This PR is utilizing the CMake procedure of #371 , thanks a lot.
Related: vllm-project/vllm#16562