-
-
Notifications
You must be signed in to change notification settings - Fork 8.4k
[core] overhaul memory profiling and fix backward compatibility #10511
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
Merged
Merged
Changes from all commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
7ab6d00
fix
youkaichao d5f3aaf
fix tests
youkaichao 40f7b73
fix
youkaichao 2250ade
fix
youkaichao 79d064f
Merge branch 'main' into memory_profile
youkaichao fbc2eda
fix
youkaichao 53ead89
comment
youkaichao 40dd292
fix
youkaichao bacc4d7
updated doc
youkaichao fff2342
add tests
youkaichao 065eb4f
fix format
youkaichao 7a268f0
fix gc collect
youkaichao e3874a6
fix
youkaichao 132895e
format
youkaichao 352d3cf
update tests
youkaichao 8c7d512
Merge branch 'main' into memory_profile
youkaichao 7dc2f39
remove newline
youkaichao 3c17006
fix
youkaichao 081498b
fix
youkaichao 2d8243b
fix
youkaichao 340dd60
add tests
youkaichao 7e5630e
fix
youkaichao 01b1898
noqa
youkaichao File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
from vllm import LLM, SamplingParams | ||
|
||
|
||
def test_gpu_memory_utilization(): | ||
prompts = [ | ||
"Hello, my name is", | ||
"The president of the United States is", | ||
"The capital of France is", | ||
"The future of AI is", | ||
] | ||
sampling_params = SamplingParams(temperature=0.8, top_p=0.95) | ||
|
||
# makes sure gpu_memory_utilization is per-instance limit, | ||
# not a global limit | ||
llms = [ | ||
LLM(model="facebook/opt-125m", | ||
gpu_memory_utilization=0.3, | ||
enforce_eager=True) for i in range(3) | ||
] | ||
for llm in llms: | ||
outputs = llm.generate(prompts, sampling_params) | ||
for output in outputs: | ||
prompt = output.prompt | ||
generated_text = output.outputs[0].text | ||
print(f"Prompt: {prompt!r}, Generated text: {generated_text!r}") |
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
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
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.