-
-
Notifications
You must be signed in to change notification settings - Fork 11.2k
[core] add sleep and wake up endpoint and v1 support #12987
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
24 commits
Select commit
Hold shift + click to select a range
3a7ecb4
add sleep and wake up endpoint
youkaichao 4fbb39e
add tests
youkaichao e74dd9a
add ack
youkaichao 79ec652
add status code check
youkaichao 13f4bdf
fix socket
youkaichao fa86994
use send_request_and_get_response
youkaichao ef145d9
fix
youkaichao 042c959
fix output
youkaichao dbf1756
Merge branch 'main' of https://github.com/vllm-project/vllm into slee…
cennn 4010671
support VLLM_USE_V1 && fix typo WAKE_UP
cennn 1f808d5
Merge branch 'main' into sleep_apiserver
youkaichao 283507d
add comments
youkaichao e6d618d
minimize diff
youkaichao 7511795
minimize diff
youkaichao aa23022
add v1 test
youkaichao f7bcffa
add timing
youkaichao aaba2f4
add v1 test
youkaichao 4b8bd93
add v1 test
youkaichao b48f686
add v1 test
youkaichao e23031f
Merge branch 'main' of https://github.com/vllm-project/vllm into slee…
cennn 83813d8
rm time.sleep(30)
cennn c795115
improve tests
youkaichao 1657de0
improve tests
youkaichao e8416d9
update comments
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
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,32 @@ | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| import requests | ||
|
|
||
| from ...utils import RemoteOpenAIServer | ||
|
|
||
| MODEL_NAME = "meta-llama/Llama-3.2-1B" | ||
|
|
||
|
|
||
| def test_sleep_mode(): | ||
| # dtype, max-len etc set so that this can run in CI | ||
| args = [ | ||
| "--dtype", | ||
| "bfloat16", | ||
| "--max-model-len", | ||
| "8192", | ||
| "--max-num-seqs", | ||
| "128", | ||
| "--enable-sleep-mode", | ||
| ] | ||
|
|
||
| with RemoteOpenAIServer(MODEL_NAME, | ||
| args, | ||
| env_dict={ | ||
| "VLLM_SERVER_DEV_MODE": "1", | ||
| "CUDA_VISIBLE_DEVICES": "0" | ||
| }) as remote_server: | ||
| response = requests.post(remote_server.url_for("/sleep"), | ||
| data={"level": "1"}) | ||
| assert response.status_code == 200 | ||
| response = requests.post(remote_server.url_for("/wake_up")) | ||
| assert response.status_code == 200 | ||
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
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 |
|---|---|---|
|
|
@@ -295,6 +295,7 @@ async def create_transcription( | |
| # TODO(rob): figure out a way to pipe streaming in. | ||
| # Non-streaming response. | ||
| try: | ||
| assert result_generator is not None | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this is to pass the linter. |
||
| async for op in result_generator: | ||
| result = op | ||
| return TranscriptionResponse(text=result.outputs[0].text) | ||
|
|
||
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
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.