forked from vllm-project/vllm
-
Notifications
You must be signed in to change notification settings - Fork 0
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
Adding basic kv-cache transfer to vllm v1 #1
Open
mrn3088
wants to merge
3,384
commits into
main
Choose a base branch
from
ruinan-dev
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.
Conversation
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
Signed-off-by: Travis Johnson <[email protected]> Signed-off-by: Prashant Gupta <[email protected]> Co-authored-by: Prashant Gupta <[email protected]> Co-authored-by: Patrick von Platen <[email protected]>
…-project#9696) Signed-off-by: André Jonasson <[email protected]>
…oject#9889) Signed-off-by: youkaichao <[email protected]>
…9933) Signed-off-by: youkaichao <[email protected]>
Signed-off-by: Gene Su <[email protected]>
…9897) Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Kevin H. Luu <[email protected]>
…t#8346) Signed-off-by: Peter Salas <[email protected]>
) Signed-off-by: kevin <[email protected]>
Signed-off-by: youkaichao <[email protected]>
…ect#9930) Signed-off-by: Nick Hill <[email protected]> Signed-off-by: Nick Hill <[email protected]> Co-authored-by: Cyrus Leung <[email protected]>
Signed-off-by: Michael Green <[email protected]>
…roject#9938) Signed-off-by: youkaichao <[email protected]> Co-authored-by: Nick Hill <[email protected]>
Signed-off-by: youkaichao <[email protected]>
Signed-off-by: youkaichao <[email protected]>
Signed-off-by: youkaichao <[email protected]>
Signed-off-by: Nick Hill <[email protected]>
Signed-off-by: Shanshan Wang <[email protected]> Signed-off-by: Roger Wang <[email protected]> Co-authored-by: Roger Wang <[email protected]>
Signed-off-by: Jee Jee Li <[email protected]>
Signed-off-by: Gregory Shtrasberg <[email protected]>
Co-authored-by: Yang Zheng(SW)(Alex) <[email protected]>
Signed-off-by: daitran2k1 <[email protected]>
…ject#9974) Signed-off-by: MengqingCao <[email protected]>
…-project#9915) Signed-off-by: chaunceyjiang <[email protected]>
…lm-project#10349) Signed-off-by: DarkLight1337 <[email protected]>
Signed-off-by: Xin Yang <[email protected]>
Signed-off-by: Jee Jee Li <[email protected]>
…0356) Signed-off-by: youkaichao <[email protected]>
…tructured output with MistralTokenizer (vllm-project#10363) Signed-off-by: Guillaume Calmettes <[email protected]>
Signed-off-by: ElizaWszola <[email protected]>
Signed-off-by: simon-mo <[email protected]>
Signed-off-by: simon-mo <[email protected]>
Signed-off-by: Russell Bryant <[email protected]>
Signed-off-by: Russell Bryant <[email protected]>
…project#9919) Signed-off-by: DarkLight1337 <[email protected]>
Signed-off-by: youkaichao <[email protected]>
Signed-off-by: youkaichao <[email protected]>
…ject#10385) Signed-off-by: Randall Smith <[email protected]>
…ct#10287) Signed-off-by: rbbang <[email protected]>
…led (vllm-project#10388) Signed-off-by: imkero <[email protected]>
Signed-off-by: Woosuk Kwon <[email protected]>
…ect#10383) Signed-off-by: youkaichao <[email protected]>
…odels (vllm-project#10374) Signed-off-by: Roger Wang <[email protected]>
Signed-off-by: Chendi Xue <[email protected]>
…ject#10394) Signed-off-by: Isotr0py <[email protected]>
Signed-off-by: youkaichao <[email protected]>
Signed-off-by: Kunshang Ji <[email protected]>
…ject#10403) Signed-off-by: imkero <[email protected]>
vllm-project#10392) Signed-off-by: wchen61 <[email protected]>
Jocn2020
reviewed
Nov 19, 2024
if role == "prefill" and prefill_step: | ||
dist.send(hidden_states, dst=1) | ||
for i in range(len(self.kv_caches)): | ||
dist.send(self.kv_caches[i], dst=1) |
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.
Nice work on the rank hack!
Quick comment from me is currently you send the entire kvcache. Next step we want to do is just sending the kvcache of specific requests' block ids which you can find in scheduler_output.scheduled_new_reqs
or scheduler_output.scheduled_resumed_reqs
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
A working implementation for vllm to do kvcache transfer between prefill and decode engine.
Tested on the
examples/offline_inference.py
.To run it, using the following commands in two terminal:
Prefill Engine
Decode Engine
The first process will execute the model for one step (the prefill step), and send the hidden_state and kv_cache to the second process to complete the following decode.
For now, at least it's working.
Decode Engine Output, seems correct
Things to pay attention: