Skip to content

[BugFix] Fix memory spike in workspace allocation#30744

Merged
vllm-bot merged 3 commits intomainfrom
lwilkinson/fix-memory-spike
Dec 16, 2025
Merged

[BugFix] Fix memory spike in workspace allocation#30744
vllm-bot merged 3 commits intomainfrom
lwilkinson/fix-memory-spike

Conversation

@LucasWilkinson
Copy link
Copy Markdown
Collaborator

Signed-off-by: Lucas Wilkinson <lwilkins@redhat.com>
@chatgpt-codex-connector
Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.

@mergify mergify bot added the v1 label Dec 16, 2025
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request addresses a memory spike issue during workspace allocation by replacing torch.Tensor.resize_ with a manual deallocation and reallocation process. The change correctly identifies that resize_ can temporarily double memory usage and cause out-of-memory errors. The implementation correctly de-references the old tensor to allow for garbage collection before allocating a new, larger tensor. This is a good fix that should effectively mitigate the memory spikes. The logic is sound and the implementation is correct.

Signed-off-by: Lucas Wilkinson <lwilkins@redhat.com>
@mergify mergify bot added the ci/build label Dec 16, 2025
@LucasWilkinson LucasWilkinson added the ready ONLY add when PR is ready to merge/full CI is needed label Dec 16, 2025
# FIXIT: find out which code initialize cuda before running the test
# before the fix, we need to use spawn to test it
- export VLLM_WORKER_MULTIPROC_METHOD=spawn
# Alot of these tests are on the edge of OOMing
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

NIT

Suggested change
# Alot of these tests are on the edge of OOMing
# A lot of these tests are on the edge of OOMing

Copy link
Copy Markdown
Collaborator

@jeejeelee jeejeelee left a comment

Choose a reason for hiding this comment

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

Thank you for fixing

@DarkLight1337 DarkLight1337 enabled auto-merge (squash) December 16, 2025 11:58
@vllm-bot vllm-bot merged commit 00a8d76 into main Dec 16, 2025
48 of 51 checks passed
@vllm-bot vllm-bot deleted the lwilkinson/fix-memory-spike branch December 16, 2025 14:46
@DarkLight1337
Copy link
Copy Markdown
Member

Will open a separate fix for the failing fusion tests, it is related to the recent deprecation #30396.

@DarkLight1337
Copy link
Copy Markdown
Member

Fixed by #30787

khluu pushed a commit that referenced this pull request Dec 17, 2025
Signed-off-by: Lucas Wilkinson <lwilkins@redhat.com>
Co-authored-by: Cyrus Leung <tlleungac@connect.ust.hk>
(cherry picked from commit 00a8d76)
Majid-Taheri pushed a commit to Majid-Taheri/vllm that referenced this pull request Dec 23, 2025
Signed-off-by: Lucas Wilkinson <lwilkins@redhat.com>
Co-authored-by: Cyrus Leung <tlleungac@connect.ust.hk>
Signed-off-by: Ubuntu <mjtaheri68@gmail.com>
fort726 pushed a commit to fort726/vllm that referenced this pull request Jan 6, 2026
Signed-off-by: Lucas Wilkinson <lwilkins@redhat.com>
Co-authored-by: Cyrus Leung <tlleungac@connect.ust.hk>
dsuhinin pushed a commit to dsuhinin/vllm that referenced this pull request Jan 21, 2026
Signed-off-by: Lucas Wilkinson <lwilkins@redhat.com>
Co-authored-by: Cyrus Leung <tlleungac@connect.ust.hk>
Signed-off-by: dsuhinin <suhinin.dmitriy@gmail.com>
ItzDEXX pushed a commit to ItzDEXX/vllm that referenced this pull request Feb 19, 2026
Signed-off-by: Lucas Wilkinson <lwilkins@redhat.com>
Co-authored-by: Cyrus Leung <tlleungac@connect.ust.hk>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants