-
-
Notifications
You must be signed in to change notification settings - Fork 16
Spans block duplication #92
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
Open
nataxcan
wants to merge
11
commits into
main
Choose a base branch
from
spans-block-duplication
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.
Open
Conversation
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
5b31ef2
to
919e73c
Compare
Co-authored-by: Nathan Ordonez <[email protected]> Signed-off-by: Thomas Parnell <[email protected]> Signed-off-by: Nathan Ordonez <[email protected]>
Signed-off-by: Nathan Ordonez <[email protected]>
Signed-off-by: Nathan Ordonez <[email protected]>
Signed-off-by: Nathan Ordonez <[email protected]>
An initial implementation of span semantics in vLLM. Please note that this has a known bug dealing with concurrent sequences that re-use the same span in different locations. We are working on a solution for this, but in the meantime accuracy may be negatively affected. n/a n/a --- <details> <summary> Essential Elements of an Effective PR Description Checklist </summary> - [x] The purpose of the PR, such as "Fix some issue (link existing issues this PR will resolve)". - [ ] The test plan, such as providing test command. - [ ] The test results, such as pasting the results comparison before and after, or e2e results - [ ] (Optional) The necessary documentation update, such as updating `supported_models.md` and `examples` for a new model. - [ ] (Optional) Release notes update. If your change is user facing, please update the release notes draft in the [Google Doc](https://docs.google.com/document/d/1YyVqrgX4gHTtrstbq8oWUImOyPCKSGnJ7xtTpmXzlRs/edit?tab=t.0). </details> --------- Signed-off-by: Thomas Parnell <[email protected]> Signed-off-by: Nathan Ordonez <[email protected]> Co-authored-by: Nathan Ordonez <[email protected]> Co-authored-by: Nathan Ordonez <[email protected]>
… benefits) Signed-off-by: Nathan Ordonez <[email protected]>
Signed-off-by: Nathan Ordonez <[email protected]>
919e73c
to
3998c6f
Compare
Signed-off-by: Nathan Ordonez <[email protected]>
Signed-off-by: Nathan Ordonez <[email protected]>
currently running evals to check accuracy... |
Signed-off-by: Nathan Ordonez <[email protected]>
i see that this addresses the regression in SPANS_DEBUG. but the hashes printed out aren't useful. to turn # just for example...
b = bytes.fromhex("abcd1234")
# turn b back into the string "abcd":
from binascii import hexlify
def pretty(b):
return hexlify(b).decode('utf-8')[:4]
pretty(b)
abcd whereas this PR uses |
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.
This PR implements block duplication.
Previously, span cache-hits were treated the same way prefix caching does it: same memory reference, different request being served.
But while the same memory reference contains the same semantic content (it refers to KV vectors of the same input tokens), it cannot contain two different positional encodings at once.
So, instead of using the same memory reference, we let vLLM allocate new blocks, but instead of prefilling those blocks we copy the KV vectors with adjusted (if needed) positional encodings.