-
Notifications
You must be signed in to change notification settings - Fork 2.7k
[None][feat] Checkpointing variant of replay for MTP for mamba models #14203
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
Merged
hnover-nv
merged 102 commits into
NVIDIA:main
from
hnover-nv:mamba_checkpointing_submit
Jun 19, 2026
+6,790
−1,968
Merged
Changes from all commits
Commits
Show all changes
102 commits
Select commit
Hold shift + click to select a range
cfcab7c
Add --parallel-warmup phase to replay benchmark
hnover-nv e6694fa
Fork checkpointing_state_update kernel and test (placeholder = today)
hnover-nv de30678
Trim heads_per_block tests: drop PDL parametrize, pin batch=8
hnover-nv 1819cb4
Add --variant {replay,checkpointing} flag to benchmark
hnover-nv 4dfd300
Print mismatch magnitude in checkpointing tests on assertion failure
hnover-nv 8ff8e94
Rectangle CB factoring in checkpointing_state_update kernel
hnover-nv ed569d3
Track Mamba replay history window in cache manager
hnover-nv b4c53c5
Cache-write semantics: PNAT-aware writes + WRITE_CHECKPOINT/RECTANGLE…
hnover-nv a9dff37
Add computation of n_writes and the nwrite-partition metadata vector …
hnover-nv 93bf1d5
Add int8/int16/fp8 quant state to checkpointing kernel + benchmark/te…
hnover-nv 93f5d2a
Benchmark: --sr-modes RN,SR sweep param replaces --philox-rounding flag
hnover-nv f837935
rect_precompute opt B: pre-wait factor_dt × exp_diff via cb_scaled sc…
hnover-nv d2bcdc5
Fix _checkpointing_main_kernel: handle PNAT > T-1 when max_window > T
hnover-nv aeab6a7
rect_precompute opt C: vectorize per-head loop, keep combo (H,T,K) li…
hnover-nv 7740397
Rectangle nowrite kernel + benchmark axes (--rectangle-for-nowrite, -…
hnover-nv 7362767
checkpointing_precompute (replay) opt: vectorize loops 1+2 via (H,T,T…
hnover-nv 39f0854
Add maindl + dlgrouped modes + PDL-out-of-main for dl-family chains
hnover-nv ea9ed6c
main kernels: vectorize HAS_Z output loop ((T, M) tile op)
hnover-nv cbebb65
Slot-perm dispatch: USE_PERM/REVERSE_PERM constexprs in dl-family ker…
hnover-nv 96df458
rect: convention swap — new tokens at runtime [PNAT, PNAT+T) instead …
hnover-nv 3d1e4c1
hardcode-sort: bench-side per-iter PNAT pre-sort (kernel unchanged) +…
hnover-nv a5311d0
test/bench: --max-window default 16 matches Nemotron-Super production
hnover-nv 33a5d43
dl_write_only debug mode + EO regression isolation runs
hnover-nv bbcc22e
TMA state load/store toggles for rect/replay main kernels (backlog #17)
hnover-nv 4bf337a
persistent_main: maindl pattern, n_writes/batch_total kernel args, ct…
hnover-nv f078fc7
SR randomness over-generation fix (backlog #19)
hnover-nv 6d5a663
persistent_dynamic: single-launch persistent kernel with runtime per-…
hnover-nv 3d7ee6f
cupti: in-process kernel timing for benchmark_replay_selective_state_…
hnover-nv ab17e86
merge: cupti timing + persistent kernels (with TMA refactor + bench p…
hnover-nv a1460de
persistent: cap launch grid at min(NUM_PERSISTENT, total_work)
hnover-nv f0e805b
bench + persistent kernel: scale compile-warmup parallelism
hnover-nv bef4981
bench: cache + grow-in-place batch-scaled tensors
hnover-nv 658485b
bench: crash-safe JSONL incremental persistence + resume + per-main k…
hnover-nv 5789041
bench: speed up mamba replay benchmark CUPTI parsing
hnover-nv a6604e5
bench: tune mamba replay benchmark host overhead
hnover-nv 00d78f6
bench: defer mamba replay CUPTI parsing
hnover-nv fc0dce3
bench: compute compact CUPTI stats in parser process
hnover-nv ccdc799
bench: trim cuda graph capture host overhead
hnover-nv 80e5710
bench: group mixed cuda graph replays
hnover-nv c69ea44
bench: reduce cuda graph pre-capture warmup
hnover-nv 73a438a
bench: add mix-only replay benchmark mode
hnover-nv eb76214
bench: keep compact per-iter mix stats
hnover-nv 25836d8
bench: keep CUPTI flush probe scratch helper
hnover-nv f5ccc28
bench: JSONL-canonical artifact + host-blind resume + cell-list mode
hnover-nv 0abdb90
bench: compile-warmup CPS-grouping + cell-list direct enum + phase ma…
hnover-nv 811f2cb
bench: iterate cell-list directly (O(|cells|), not O(cartesian))
hnover-nv 8e91b93
bench: guard cell-list-direct iter on 'not warmup_only'
hnover-nv ac8ec9e
bench: compile-warmup uses per-cell outer in cell-list mode (no outer…
hnover-nv 646c9a2
checkpointing: wire TMA load under IS_DYNAMIC=True + per-path descrip…
hnover-nv e9ead28
bench: retry CUPTI parser spawn with timeout + alive polling
hnover-nv be5046f
bench: add --mp-start-method forkserver option
hnover-nv 588bcaf
mamba_checkpointing kernel: pack int8/int16 SR random bits + supporti…
hnover-nv 42b1382
mamba_checkpointing: promote pd WC_IS_CONSTEXPR refactor to live kernel
hnover-nv 6a8d3c4
mamba_checkpointing: _slim copies (kernel/test/bench) — persistent_dy…
hnover-nv 0515114
mamba_checkpointing: fix dA_cumsum cross-step continuity in slim prec…
hnover-nv c578008
mamba_checkpointing/slim: wire split-form loop_stages/cta_per_sm in t…
hnover-nv 11ed0b8
Merge slim Mamba replay kernel sources
hnover-nv d7c1e39
mamba replay benchmark: harden driver cell handling
hnover-nv 4a5a398
mamba replay: fix rectangle precompute write-read race
hnover-nv da8f6e4
mamba replay: handle rectangle fallback and pad slots
hnover-nv 5acc881
mamba replay: benchmark cache slot load knob
hnover-nv 18a353e
mamba replay: specialize rectangle gather fallback
hnover-nv b319eac
mamba replay: remove pad-slot guard and hsort default
hnover-nv 97f0b6d
mamba replay: add nowrite-first launch knob
hnover-nv f4b1060
mamba replay: double-buffer old_x to eliminate write-path race
hnover-nv 6546272
mamba replay: double-buffer old_x cache allocation
hnover-nv 2ed22dc
mamba replay: address review cleanup
hnover-nv c1d4c5a
mamba benchmark: restore FlashInfer replay baseline
hnover-nv 92de174
mamba benchmark: model FlashInfer cache-slot indirection
hnover-nv ef75adf
mamba benchmark: improve default timing UX
hnover-nv d17b7fd
remove scratch kernel copies and do precommit fixes
hnover-nv f3f5be4
Update mamba replay default tunings
hnover-nv 141006b
Merge main wheel target for mamba checkpointing
hnover-nv 481f9d1
Merge current main for mamba checkpointing
hnover-nv 6127ae3
[None][fix] stabilize Triton Mamba softplus
hnover-nv 172cc08
Clean up mamba replay default tuning
hnover-nv 7f5b6f3
Merge softmax fix and current head.
hnover-nv c99fcdf
Merge in head (has softmax already). Also fix PNAT size to int32.
hnover-nv e02ff1e
Merge current main for Mamba checkpointing
hnover-nv 1c76c1f
Wire AutoDeploy checkpoint replay support
hnover-nv 452a129
Merge current main into Mamba checkpointing
hnover-nv a2b12e8
Fix empty persistent-main PDL bridge
hnover-nv bbed7f2
Zero initialize Mamba base state caches
hnover-nv e623f4d
Keep Mamba dummy replay slots nowrite
hnover-nv 68ab316
Add memory clobber to Mamba replay PDL wait
hnover-nv f4f6768
Hoist Mamba replay PDL wait and update tunings
hnover-nv dcf8e5a
Require explicit Mamba replay cache metadata
hnover-nv 63f3033
Clean up Mamba checkpoint replay plumbing
hnover-nv 349b5c6
Merge main into Mamba checkpoint replay
hnover-nv 63ad831
Clean up Mamba replay seed handling and precompute tuning
hnover-nv c1365f5
Fix Mamba replay gating without spec decode
hnover-nv 12a4642
Fix AutoDeploy replay resource validation
hnover-nv a90d5cc
Fix replay benchmark kwargs and int8 tunings
hnover-nv 061ce29
Handle strided TMA state layout for replay
hnover-nv 038cc1a
Merge main through 1283c6b for mamba checkpointing
hnover-nv 3436b76
Update Mamba replay precompute tunings
hnover-nv cb8ce0e
Merge main through feca41c for mamba checkpointing
hnover-nv 1990828
Refresh Mamba dummy mask under inference mode. The dummy mask refact…
hnover-nv 80b1f7a
Keep AutoDeploy replay metadata standalone
hnover-nv d417759
Lower Ultra ADP MTP KV cache fraction
hnover-nv ca32494
remove benchmark and flashinfer imports for PR
hnover-nv 4538e22
Merge branch 'main' into mamba_checkpointing_submit
hnover-nv 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
22 changes: 22 additions & 0 deletions
22
tensorrt_llm/_torch/auto_deploy/custom_ops/mamba/replay_metadata.py
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,22 @@ | ||
| # SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 (the "License"); | ||
| # you may not use this file except in compliance with the License. | ||
| # You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
|
|
||
| """Replay metadata layout shared by AutoDeploy Mamba descriptors.""" | ||
|
|
||
| REPLAY_WORK_POSITION_IN_DECODE_BATCH = 0 | ||
| REPLAY_WORK_CACHE_SLOT = 1 | ||
| REPLAY_WORK_PNAT = 2 | ||
| REPLAY_WORK_CACHE_BUF_IDX = 3 | ||
| REPLAY_WORK_ITEM_WIDTH = 4 |
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
Oops, something went wrong.
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.