-
-
Notifications
You must be signed in to change notification settings - Fork 7.8k
[BugFix][V1] Fix memory profiling bug #18974
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
[BugFix][V1] Fix memory profiling bug #18974
Conversation
👋 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 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 🚀 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this is too conservative?
I think it's reasonable to ask that two vLLM instances should not be initialized at the same time on the same GPU.
That makes sense but 1. we do it in tests all the time and 2. we're still double counting memory right now. If there is something on the GPU that was present before the profile run, we treat it as if it's used by the vLLM forward pass. A way around this in tests is to init the first LLM with |
Oh I didn't know this. Then, this is clearly a bug. Sorry for that 🙏 |
Oh no worries at all it took me a really long time debugging to understand why this edge case is not working right. I'll add an extra defensive check |
2ede33a
to
a509587
Compare
there's a similar PR #18296 trying to solve it by reusing the utility functions in v0, can you help take a look to see which one works better? @ProExpertProg |
This is also highly related trying to port the same v0 functionality with logging on top #17122 |
As far as I can see, the only functional difference with @calvin0327 's PR is that the torch memory usage in one is measured with |
Basically, I think
|
Signed-off-by: luka <[email protected]>
Signed-off-by: luka <[email protected]>
Head branch was pushed to by a user without write access
a509587
to
90a6e99
Compare
This fixes a bug in memory profiling where we conservatively assume all GPU memory usage is due to non-torch forward pass allocation. If 2 LLM instances are allocated in the same test case, the second one will likely think it ran out of memory.
Introduced in #10528.