Skip to content
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

[Core] Fix memory profiling #11120

Closed
wants to merge 13 commits into from
Closed

Conversation

joerunde
Copy link
Collaborator

@joerunde joerunde commented Dec 12, 2024

Because why not add another PR?

This PR takes @tjohnson31415's very clean profiling method from #10498 and the context manager from @youkaichao from #10511 and joins them together with a unit test to ensure that everything is working as expected.

Example output:

INFO 12-11 23:12:57 worker.py:217] Memory profiling results:
INFO 12-11 23:12:57 worker.py:217] duration               0.44 seconds
INFO 12-11 23:12:57 worker.py:217] total_gpu_memory       79.33GiB
INFO 12-11 23:12:57 worker.py:217] gpu_memory_utilization 0.25
INFO 12-11 23:12:57 worker.py:217] target_allocation      19.83GiB
INFO 12-11 23:12:57 worker.py:217] baseline_memory        4.71GiB
INFO 12-11 23:12:57 worker.py:217] max_inference_spike    2.35GiB
INFO 12-11 23:12:57 worker.py:217] kv_cache_size          12.77GiB

FIX #10451 (link existing issues this PR will resolve)

youkaichao and others added 7 commits November 20, 2024 18:06
Signed-off-by: youkaichao <[email protected]>
Signed-off-by: youkaichao <[email protected]>
Signed-off-by: youkaichao <[email protected]>
Signed-off-by: youkaichao <[email protected]>
Signed-off-by: Joe Runde <[email protected]>
Co-Authored-By: Travis Johnson <[email protected]>
Signed-off-by: Joe Runde <[email protected]>
Copy link

👋 Hi! Thank you for contributing to the vLLM project.
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 do one of these:

  • Add ready label to the PR
  • Enable auto-merge.

🚀

Copy link

mergify bot commented Dec 12, 2024

This pull request has merge conflicts that must be resolved before it can be
merged. Please rebase the PR, @joerunde.

https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/syncing-a-fork

@mergify mergify bot added the needs-rebase label Dec 12, 2024
@joerunde
Copy link
Collaborator Author

Uh oh...
The profiling seems to give the same numbers as before, but now tests are failing because only ~83% of the gpu ram is available and the tests that want the default 90% aren't happy. If some test artifact isn't being cleaned up then this would be expected now that we properly measure the memory usage starting from before the model is loaded.

@joerunde
Copy link
Collaborator Author

Fixed in #10511

@joerunde joerunde closed this Dec 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Breaking Change in gpu_memory_utilization Behavior in vLLM 0.6.4
2 participants