-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
[V1] AsyncLLMEngine
#9826
Draft
robertgshaw2-neuralmagic
wants to merge
65
commits into
vllm-project:main
Choose a base branch
from
neuralmagic:rework-rs-proto
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+991
−680
Draft
[V1] AsyncLLMEngine
#9826
Changes from 55 commits
Commits
Show all changes
65 commits
Select commit
Hold shift + click to select a range
8f8662e
prototype
robertgshaw2-neuralmagic 01c4ca8
revert spurious 2.5 changes
robertgshaw2-neuralmagic 1ad8a48
stash
robertgshaw2-neuralmagic f9084f6
cleanup
robertgshaw2-neuralmagic 72bccd9
add MQLLMEnginev1
robertgshaw2-neuralmagic a6cab52
work with MQLLMEngine
robertgshaw2-neuralmagic 885ed16
format
robertgshaw2-neuralmagic 3ed66cf
cleanup formatting
robertgshaw2-neuralmagic 8ae8ce9
revert exmple change
robertgshaw2-neuralmagic 5c72515
update comment
robertgshaw2-neuralmagic f9b33fa
formatting
robertgshaw2-neuralmagic 82539b9
updated
robertgshaw2-neuralmagic d42a54e
stash
robertgshaw2-neuralmagic 3a2d02a
format
robertgshaw2-neuralmagic 6028ee1
Merge branch 'main' into rs-prototype-2
robertgshaw2-neuralmagic 6bd37c1
update
robertgshaw2-neuralmagic 196d822
revert bind/connect
robertgshaw2-neuralmagic a089cd1
revert comment
robertgshaw2-neuralmagic 974aa06
formatting
robertgshaw2-neuralmagic fe1e1b4
formatting tweaks
robertgshaw2-neuralmagic 9c27fbb
move detokenizer into engine
robertgshaw2-neuralmagic 95b5af1
format
robertgshaw2-neuralmagic 3999279
stash
robertgshaw2-neuralmagic b4dd571
revert bad import
robertgshaw2-neuralmagic f01f992
format
robertgshaw2-neuralmagic be333fa
format
robertgshaw2-neuralmagic aefb498
add files
robertgshaw2-neuralmagic 6d7f473
stash
robertgshaw2-neuralmagic f431f8a
update
robertgshaw2-neuralmagic be431e4
update
robertgshaw2-neuralmagic 36b7fa5
fix api client example to work with v1
robertgshaw2-neuralmagic 3a5ce74
formatting
robertgshaw2-neuralmagic 0d0251e
updated
robertgshaw2-neuralmagic 046d78f
update
robertgshaw2-neuralmagic 34c0665
update
robertgshaw2-neuralmagic 52b790f
stash
robertgshaw2-neuralmagic 4f9a86e
Stash
robertgshaw2-neuralmagic 697b98f
stash
robertgshaw2-neuralmagic fa5c01d
LLMEngineWorking
robertgshaw2-neuralmagic 0ca42d8
format
robertgshaw2-neuralmagic b6497d5
updated
robertgshaw2-neuralmagic ae88c73
updated
robertgshaw2-neuralmagic 2161152
update
robertgshaw2-neuralmagic 6a57297
aded processor
robertgshaw2-neuralmagic 3665602
udpated
robertgshaw2-neuralmagic ed567ca
updated
robertgshaw2-neuralmagic f4005da
updated formats
robertgshaw2-neuralmagic 67a53ed
revert
robertgshaw2-neuralmagic 458b54f
finished
robertgshaw2-neuralmagic 75ff707
updated
robertgshaw2-neuralmagic 669648f
split core process into separate class
njhill 127f09c
stash
robertgshaw2-neuralmagic 99f683e
Merge pull request #22 from njhill/rework-splitcore
robertgshaw2-neuralmagic dc6163c
updated
robertgshaw2-neuralmagic d21cb8f
updated
robertgshaw2-neuralmagic 565ffa6
working again
robertgshaw2-neuralmagic 2960fbc
format
robertgshaw2-neuralmagic 5d23709
updated
robertgshaw2-neuralmagic f2f2e40
updated
robertgshaw2-neuralmagic c10c9d8
better interface
robertgshaw2-neuralmagic b8767a9
formatting
robertgshaw2-neuralmagic ab783e1
format
robertgshaw2-neuralmagic 423f47d
update
robertgshaw2-neuralmagic 7c977d3
updated
robertgshaw2-neuralmagic 3c14bdf
format
robertgshaw2-neuralmagic 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 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 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 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 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,62 @@ | ||
import asyncio | ||
from dataclasses import dataclass | ||
from typing import List, Optional, Union | ||
|
||
import msgspec | ||
|
||
from vllm.lora.request import LoRARequest | ||
from vllm.outputs import RequestOutput | ||
from vllm.sampling_params import RequestOutputKind, SamplingParams | ||
|
||
LLM_ENGINE_CORE_READY_STR = "READY" | ||
POLLING_TIMEOUT_MS = 5000 | ||
|
||
|
||
@dataclass | ||
class DetokenizerRequest: | ||
|
||
request_id: str | ||
prompt: Optional[str] | ||
prompt_token_ids: List[int] | ||
skip_special_tokens: bool | ||
spaces_between_special_tokens: bool | ||
output_kind: RequestOutputKind | ||
|
||
# Queue for streaming outputs to clients. | ||
output_queue: Optional[asyncio.Queue[RequestOutput]] = None | ||
|
||
|
||
class EngineCoreRequest(msgspec.Struct): | ||
|
||
# NOTE: prompt and prompt_token_ids should be DecoderOnlyInput, | ||
# but this object is currently not playing well with msgspec | ||
# due to circular imports and typing we have in data.py | ||
|
||
request_id: str | ||
#NOTE(Nick): I don't think we need to pass prompt here since it should | ||
# always be tokenized? | ||
# prompt: Optional[str] | ||
prompt_token_ids: List[int] | ||
sampling_params: SamplingParams | ||
eos_token_id: Optional[int] | ||
arrival_time: float | ||
lora_request: Optional[LoRARequest] | ||
|
||
|
||
@dataclass | ||
class EngineCoreOutput: | ||
|
||
request_id: str | ||
new_token_ids: List[int] | ||
finished: bool | ||
finish_reason: Optional[str] = None | ||
stop_reason: Union[int, str, None] = None | ||
|
||
|
||
class EngineCoreOutputs(msgspec.Struct): | ||
|
||
#NOTE(Nick): We could consider ways to make this more compact, | ||
# e.g. columnwise layout and using an int enum for finish/stop reason | ||
|
||
# [num_reqs] | ||
outputs: List[EngineCoreOutput] |
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.
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.
Im not sure it makes sense for this method to be in
scheduler.py
The only item related to setting the scheduler here is updating which
self.running