[Chore] Cleanup mem_utils.py#31793
Merged
DarkLight1337 merged 3 commits intovllm-project:mainfrom Jan 6, 2026
Merged
Conversation
Signed-off-by: DarkLight1337 <tlleungac@connect.ust.hk>
Contributor
There was a problem hiding this comment.
Code Review
This pull request aims to clean up mem_utils.py by ensuring memory snapshots use a consistent device and removing unnecessary noqa comments. While the intention to enforce device consistency is good, the implementation is flawed. The MemorySnapshot class stores the actual device in a private device_ attribute, but the changes incorrectly attempt to use the public device attribute, which can be None. This could lead to incorrect device selection in a multi-device environment. I've provided two high-severity comments with suggestions to use the device_ attribute to fix this correctness issue. The other changes, such as refactoring and removing noqa comments, are good improvements.
Isotr0py
approved these changes
Jan 6, 2026
LucasWilkinson
pushed a commit
to neuralmagic/vllm
that referenced
this pull request
Jan 6, 2026
Signed-off-by: DarkLight1337 <tlleungac@connect.ust.hk>
yugong333
pushed a commit
to yugong333/vllm
that referenced
this pull request
Jan 9, 2026
Signed-off-by: DarkLight1337 <tlleungac@connect.ust.hk>
akh64bit
pushed a commit
to akh64bit/vllm
that referenced
this pull request
Jan 16, 2026
Signed-off-by: DarkLight1337 <tlleungac@connect.ust.hk>
dsuhinin
pushed a commit
to dsuhinin/vllm
that referenced
this pull request
Jan 21, 2026
Signed-off-by: DarkLight1337 <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: DarkLight1337 <tlleungac@connect.ust.hk>
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.
Purpose
MemoryProfilingResultsnapshots all have the same devicenoqasSome of the changes are taken from #22070
Test Plan
Test Result
Essential Elements of an Effective PR Description Checklist
supported_models.mdandexamplesfor a new model.