-
-
Notifications
You must be signed in to change notification settings - Fork 22.3k
[Mamba] Unify FI ReplaySSM STP/MTP/Prefix Caching Lifecycle #55688
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
askliar
wants to merge
58
commits into
vllm-project:main
Choose a base branch
from
askliar:feat/unify_replayssm_cycle
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
Changes from all commits
Commits
Show all changes
58 commits
Select commit
Hold shift + click to select a range
069ba91
[Mamba] Add FlashInfer ReplaySSM support for MTP
f86b0fd
fix merge inconsistencies
829531c
restore test skips
2a20d79
remove unnecessary code
0f7abb7
Add ReplaySSM prefix caching on the MTP branch
65fac9b
test(mamba): skip ReplaySSM graph test without autotuning
25b2f1d
Simplify ReplaySSM lifecycle integration
4d8d019
Fix ReplaySSM pre-commit checks
efbfcee
Fix ReplaySSM type checks
47a0133
fix(mamba): maintain FlashInfer ReplaySSM trackers in all cache modes
a9339be
refactor(mamba): clarify ReplaySSM lifecycle and prefix materialization
fe27076
fix(mamba): compact ReplaySSM materialization requests
8546368
refactor(mamba): simplify ReplaySSM cache lifecycle
791a665
refactor(mamba): minimize ReplaySSM postprocess planning
30d9042
fix(mamba): publish ReplaySSM state after drafting
00a8998
[Mamba] Reconcile ReplaySSM live-state prefix caching
9d9c728
test: trim ReplaySSM regression suite
c202d4b
[Mamba] Strengthen ReplaySSM MTP cache tests
b1008ee
Merge remote ReplaySSM test cleanup
25890ec
[Mamba] Respect MTP prefix-cache support boundary
5f6d99f
[Mamba] Keep ReplaySSM prefix E2E on supported model
ab96e0b
[Mamba] Correct ReplaySSM cache lifecycle
7a2c540
[Mamba] Simplify ReplaySSM prefix maintenance
2d75f40
[Mamba] Bound ReplaySSM reset launch to active batch
ce28868
refactor(mamba): clarify ReplaySSM MTP bookkeeping
1d828e0
Refactor MTP decode tensor views
609e19e
Run ReplaySSM end-to-end tests in CI
3c6d80e
Merge upstream main and preserve ReplaySSM CI coverage
77dea00
Expand ReplaySSM CI dependencies
c1dd5a3
test(mamba): run ReplaySSM MTP at TP2
d4757fa
[Mamba] Address ReplaySSM review feedback
57085cd
[Mamba] Simplify ReplaySSM cache ownership
9f93dcb
[Mamba] Fix ReplaySSM materialization expectation
0c4f84f
[Mamba] Preserve hybrid MTP prefix-cache hits
27d0b55
[Mamba] Fix all-mode MTP prefix-cache coverage
38429ac
[Mamba] Finish ReplaySSM review cleanup
4def0e5
[Mamba] Address ReplaySSM review follow-up
476dc96
test: trim redundant ReplaySSM coverage
d2dae3d
test: second trim pass on ReplaySSM coverage
2409c0c
test: drop superficial ReplaySSM assertions
7bb8f00
test: reduce ReplaySSM suite to core coverage
487b9cc
test: restore load-bearing ReplaySSM coverage
9d29c8b
[Mamba] Scope hybrid fallback to ReplaySSM
b7ec902
[Mamba] Clarify ReplaySSM copied state
9bf580c
[Mamba] Keep ReplaySSM changes feature-scoped
ce01679
[Mamba] Explain ReplaySSM state transitions
b0185c6
[Mamba] Document runner state staging
7d8c575
test(mamba): pin Triton ReplaySSM to runner V1
669da5b
test(mamba): cover FlashInfer ReplaySSM on V1
19fe160
test(mamba): cover FlashInfer MTP on V1
53fe7ed
test(mamba): require FlashInfer ReplaySSM coverage
4c223a7
[Mamba] Tighten ReplaySSM integration boundaries
fc4313d
[Mamba] Fix ReplaySSM cache paths and MTP grouping
6cececc
[Mamba] Commit RecoverSSM state in Model Runner V1
c196387
Merge ReplaySSM MTP base into prefix caching
4eb2ead
[Mamba] Merge current main into unified ReplaySSM lifecycle
e4be47b
[Mamba] Preserve ReplaySSM state for padded prompt tails
89f5ad7
[Mamba] Fix ReplaySSM prefix lifecycle and validation
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 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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,76 @@ | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
| # SPDX-FileCopyrightText: Copyright contributors to the vLLM project | ||
|
|
||
| from types import SimpleNamespace | ||
| from unittest.mock import patch | ||
|
|
||
| import torch.nn as nn | ||
|
|
||
| from vllm.config import CompilationMode | ||
| from vllm.transformers_utils.configs.nemotron_h import NemotronHConfig | ||
|
|
||
|
|
||
| class _StubModule(nn.Module): | ||
| def __init__(self, *args, **kwargs): | ||
| super().__init__() | ||
|
|
||
|
|
||
| def test_native_mtp_attention_registers_after_target_attention(): | ||
| from vllm.model_executor.models import nemotron_h, nemotron_h_mtp | ||
|
|
||
| static_forward_context = {} | ||
|
|
||
| class StaticContextAttention(_StubModule): | ||
| def __init__(self, *args, prefix: str = "", **kwargs): | ||
| super().__init__() | ||
| static_forward_context[prefix] = self | ||
|
|
||
| config = NemotronHConfig( | ||
| vocab_size=8, | ||
| hidden_size=4, | ||
| num_hidden_layers=1, | ||
| hybrid_override_pattern="*", | ||
| mtp_hybrid_override_pattern="*", | ||
| num_attention_heads=1, | ||
| num_key_value_heads=1, | ||
| head_dim=4, | ||
| num_nextn_predict_layers=1, | ||
| ) | ||
| model_config = SimpleNamespace(hf_config=config) | ||
| vllm_config = SimpleNamespace( | ||
| model_config=model_config, | ||
| cache_config=None, | ||
| quant_config=None, | ||
| parallel_config=None, | ||
| compilation_config=SimpleNamespace(mode=CompilationMode.NONE), | ||
| ) | ||
|
|
||
| with ( | ||
| patch.object( | ||
| nemotron_h, "get_tensor_model_parallel_world_size", return_value=1 | ||
| ), | ||
| patch.object(nemotron_h, "Attention", StaticContextAttention), | ||
| patch.object(nemotron_h, "QKVParallelLinear", _StubModule), | ||
| patch.object(nemotron_h, "RowParallelLinear", _StubModule), | ||
| patch.object(nemotron_h, "RMSNorm", _StubModule), | ||
| patch.object(nemotron_h_mtp, "VocabParallelEmbedding", _StubModule), | ||
| patch.object(nemotron_h_mtp, "ColumnParallelLinear", _StubModule), | ||
| patch.object(nemotron_h_mtp, "ParallelLMHead", _StubModule), | ||
| patch.object(nemotron_h_mtp, "LogitsProcessor", _StubModule), | ||
| patch.object(nemotron_h_mtp, "RMSNorm", _StubModule), | ||
| ): | ||
| nemotron_h.NemotronHAttentionDecoderLayer( | ||
| config=config, | ||
| layer_idx=0, | ||
| model_config=model_config, | ||
| prefix="model.layers.0", | ||
| ) | ||
| nemotron_h_mtp.NemotronHMTP( | ||
| vllm_config=vllm_config, | ||
| prefix="draft_model", | ||
| ) | ||
|
|
||
| assert list(static_forward_context) == [ | ||
| "model.layers.0.mixer.attn", | ||
| "draft_model.mtp.layers.0.mixer.attn", | ||
| ] |
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.
Uh oh!
There was an error while loading. Please reload this page.