Skip to content

Conversation

lionelvillard
Copy link
Contributor

@lionelvillard lionelvillard commented Mar 20, 2025

Clear PyTorch cache right after putting the instance to sleep.

For ibm-granite/granite-20b-code-instruct-8k, memory use before this fix is:

INFO 03-20 19:40:47 [gpu_worker.py:81] Sleep mode freed 37.55 GiB memory, 3.29 GiB memory is still in use.

And with this fix:

INFO 03-20 19:45:25 [gpu_worker.py:81] Sleep mode freed 39.48 GiB memory, 1.36 GiB memory is still in use.

Copy link

👋 Hi! Thank you for contributing to the vLLM project.

💬 Join our developer Slack at https://slack.vllm.ai to discuss your PR in #pr-reviews, coordinate on features in #feat- channels, or join special interest groups in #sig- channels.

Just a reminder: PRs would not trigger full CI run by default. Instead, it would only run fastcheck CI which starts running only a small and essential subset of CI tests to quickly catch errors. You can run other CI tests on top of those by going to your fastcheck build on Buildkite UI (linked in the PR checks section) and unblock them. If you do not have permission to unblock, ping simon-mo or khluu to add you in our Buildkite org.

Once the PR is approved and ready to go, your PR reviewer(s) can run CI to test the changes comprehensively before merging.

To run CI, PR reviewers can either: Add ready label to the PR or enable auto-merge.

🚀

Signed-off-by: Lionel Villard <villard@us.ibm.com>

Signed-off-by:  <villard@us.ibm.com>
@njhill njhill requested a review from youkaichao March 20, 2025 20:56
Copy link
Contributor

@maxdebayser maxdebayser left a comment

Choose a reason for hiding this comment

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

Intuitively this makes total sense. But I don't know if there could be any side effects.

@njhill
Copy link
Member

njhill commented Mar 21, 2025

Also LGTM but would also be good to get a nod from @youkaichao.

@youkaichao
Copy link
Member

i think you are clearing some buffers for sampling logits. it works, but people have to be careful, because when you wake up the engine, and serve the requests, samplers will allocate that part of memory again.

Copy link
Member

@youkaichao youkaichao left a comment

Choose a reason for hiding this comment

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

LGTM if you want to reclaim as much memory as possible when sleeping.

@lionelvillard
Copy link
Contributor Author

Can we merge this PR?

@njhill njhill added the ready ONLY add when PR is ready to merge/full CI is needed label Mar 31, 2025
@njhill njhill enabled auto-merge (squash) March 31, 2025 18:29
@vllm-bot vllm-bot merged commit 4a9ce17 into vllm-project:main Apr 1, 2025
38 of 40 checks passed
Alex4210987 pushed a commit to LeiWang1999/vllm-bitblas that referenced this pull request Apr 5, 2025
Signed-off-by: <villard@us.ibm.com>
Signed-off-by: xinyuxiao <xinyuxiao2024@gmail.com>
lulmer pushed a commit to lulmer/vllm that referenced this pull request Apr 7, 2025
Signed-off-by: <villard@us.ibm.com>
Signed-off-by: Louis Ulmer <ulmerlouis@gmail.com>
lk-chen pushed a commit to lk-chen/vllm that referenced this pull request Apr 29, 2025
shreyankg pushed a commit to shreyankg/vllm that referenced this pull request May 3, 2025
RichardoMrMu pushed a commit to RichardoMrMu/vllm that referenced this pull request May 12, 2025
Signed-off-by: <villard@us.ibm.com>
Signed-off-by: Mu Huai <tianbowen.tbw@antgroup.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready ONLY add when PR is ready to merge/full CI is needed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants