[Bugfix] Fix incorrect single-token saves in v1#653
Merged
Siddhant-Ray merged 1 commit intoLMCache:devfrom May 15, 2025
Merged
Conversation
This commit fixes the chunk boundary for saves in the vllm v1 adatper. Before this fix, it was possible that a single token writes were not skipped. Signed-off-by: Or Ozeri <oro@il.ibm.com>
88bdba5 to
5ee7cf8
Compare
Contributor
Author
Siddhant-Ray
approved these changes
May 15, 2025
vMaroon
pushed a commit
to vMaroon/LMCache
that referenced
this pull request
May 16, 2025
vllm v1: Fix saves chunk boundary This commit fixes the chunk boundary for saves in the vllm v1 adatper. Before this fix, it was possible that a single token writes were not skipped. Signed-off-by: Or Ozeri <oro@il.ibm.com>
vMaroon
added a commit
to neuralmagic/LMCache
that referenced
this pull request
May 16, 2025
[Bugfix] Fix incorrect single-token saves in v1 (LMCache#653)
KevinCheung2259
pushed a commit
to KevinCheung2259/LMCache
that referenced
this pull request
Nov 5, 2025
vllm v1: Fix saves chunk boundary This commit fixes the chunk boundary for saves in the vllm v1 adatper. Before this fix, it was possible that a single token writes were not skipped. Signed-off-by: Or Ozeri <oro@il.ibm.com>
DongDongJu
pushed a commit
to DongDongJu/LMCache
that referenced
this pull request
Feb 22, 2026
vllm v1: Fix saves chunk boundary This commit fixes the chunk boundary for saves in the vllm v1 adatper. Before this fix, it was possible that a single token writes were not skipped. Signed-off-by: Or Ozeri <oro@il.ibm.com>
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
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.
After saving a (256 token) chunk,
num_saved_tokens % chunk_sizeis 0.After the next decoded token, chunk_boundary will incorrectly be set to equal num_saved_tokens, instead of num_saved_tokens+chunk_size.
This will yield an additional unwanted 1 token save.
For example:
This PR fixes
chunk_boundaryto avoid these incorrect writes.