[Hybrid] Fix and optimize block-aligned splitting in mamba cache align mode#33706
Merged
vllm-bot merged 10 commits intovllm-project:mainfrom Feb 13, 2026
Merged
[Hybrid] Fix and optimize block-aligned splitting in mamba cache align mode#33706vllm-bot merged 10 commits intovllm-project:mainfrom
vllm-bot merged 10 commits intovllm-project:mainfrom
Conversation
Signed-off-by: huanghaoyan.hhy <huanghaoyan.hhy@alibaba-inc.com>
Signed-off-by: huanghaoyan.hhy <huanghaoyan.hhy@alibaba-inc.com>
Signed-off-by: huanghaoyan.hhy <huanghaoyan.hhy@alibaba-inc.com>
Signed-off-by: huanghaoyan.hhy <huanghaoyan.hhy@alibaba-inc.com>
Signed-off-by: huanghaoyan.hhy <huanghaoyan.hhy@alibaba-inc.com>
Signed-off-by: huanghaoyan.hhy <huanghaoyan.hhy@alibaba-inc.com>
Signed-off-by: huanghaoyan.hhy <huanghaoyan.hhy@alibaba-inc.com>
Contributor
There was a problem hiding this comment.
Code Review
This pull request addresses an issue with block-aligned splitting in Mamba's cache align mode, which previously did not handle resumed requests correctly. The changes ensure that block-aligned splitting is performed for both new and resumed requests during the prefill phase. Additionally, the logic is optimized to handle prompt and output tokens separately for resumed requests, which should improve cache hit rates. The code has been refactored to introduce a helper function _mamba_compute_cache_pos for better clarity. The changes appear correct and well-implemented to solve the described problem.
Closed
5 tasks
heheda12345
reviewed
Feb 4, 2026
This reverts commit c29650b. Signed-off-by: huanghaoyan.hhy <huanghaoyan.hhy@alibaba-inc.com>
Signed-off-by: huanghaoyan.hhy <huanghaoyan.hhy@alibaba-inc.com>
eldarkurtic
pushed a commit
to eldarkurtic/vllm
that referenced
this pull request
Feb 19, 2026
…gn mode (vllm-project#33706) Signed-off-by: huanghaoyan.hhy <huanghaoyan.hhy@alibaba-inc.com> Signed-off-by: Eldar Kurtic <research@neuralmagic.com>
llsj14
pushed a commit
to llsj14/vllm
that referenced
this pull request
Mar 1, 2026
…gn mode (vllm-project#33706) Signed-off-by: huanghaoyan.hhy <huanghaoyan.hhy@alibaba-inc.com>
tunglinwood
pushed a commit
to tunglinwood/vllm
that referenced
this pull request
Mar 4, 2026
…gn mode (vllm-project#33706) Signed-off-by: huanghaoyan.hhy <huanghaoyan.hhy@alibaba-inc.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.
Purpose
Currently, block-aligned splitting is only executed during the prefill phase of new requests (
num_output_tokens == 0). It does not account for resumed requests. This leads to resumed requests being scheduled without block alignment, causing Mamba states to be stored in a non-aligned fashion. Consequently, incorrect states are retrieved during subsequent cache hits.Changes in this PR:
Optimize the logic to split prompt tokens and output tokens separately on block-aligned boundaries for resumed requests. This ensures that the Mamba states at the end of the prompt is cached, improving the cache hit rate during request replays.Removed for code simplicity.Test Plan
Test Result
Essential Elements of an Effective PR Description Checklist
supported_models.mdandexamplesfor a new model.