Repository navigation
Conversation
prepare_load_back raw-allocs the request's device mamba slot, bypassing HybridReqToTokenPool.alloc's fresh-slot hygiene, and the H2D load-back writes only temporal+conv (the host tier carries no ring state). The GDN ReplaySSM decode kernel replays ring contents whenever write_pos>0, so a load-back slot inherited its previous tenant's ring on top of the loaded checkpoint: cross-conversation recurrent-state bleed, observed as sticky deterministic wrong retrievals (~10% of revisits) served through HiCache load-back only. Reset write_pos on the freshly allocated slot before the load-back lands, mirroring the fresh-slot reset in HybridReqToTokenPool.alloc. Relationship to upstream: sgl-project#36345 (open) resets write_pos only on its new buffer-only load-back path; sgl-project#37837 (open) resets it on the extra_buffer donate path. Neither covers prepare_load_back. Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
rodamani
marked this pull request as ready for review
September 29, 2026 21:15
rodamani
requested review from
Ying1123,
alphabetc1,
hanming-lu,
hnyls2002,
huangtingwei9988,
hzh0425,
ispobock,
merrymercy,
xiezhq-hermann and
yizhang2077
as code owners
September 29, 2026 21:15
Contributor
Author
|
/rerun-test -c test_retraction_mamba_backup.py test_mamba_unittest.py test_linear_replayssm_decode.py |
Contributor
|
Results for 🚀 🚀 🚀 ⛔ |
Contributor
Author
|
/tag-and-rerun-ci |
3 of 5 tasks
This branch has not been deployed
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.
Motivation
With decode ReplaySSM (
--enable-linear-replayssm) and HiCache,MambaComponent.prepare_load_backallocates the request's device Mamba slot directly from the allocator. That bypassesHybridReqToTokenPool.alloc, which is where a fresh slot'sreplayssm_write_posis reset; the request already holds a slot by the timeallocruns, so the reset branch is skipped. The H2D load-back writes only temporal + conv state (the host tier carries no ring state).Cursors are reset on release only by the finish-and-insert path. Retract and abort release with
is_insert=Falseand free the slot without touchingwrite_pos. So a load-back can land in a slot whose previous tenant was retracted or aborted mid-decode, and the decode kernel then replays that tenant's ring on top of the loaded checkpoint (cross-request recurrent-state bleed). Cache eviction is not a source: tree-held slots enter the tree with cursor 0.Speculative ReplaySSM (
--enable-linear-replayssm-spec) keeps its cursors per request row and is not affected.Modifications
replayssm_write_poson the freshly allocated load-back slot inprepare_load_back, mirroring the fresh-slot reset inHybridReqToTokenPool.alloc. No-op when decode ReplaySSM is off.test/registered/unit/mem_cache/test_mamba_load_back_replayssm_reset.py.Relationship to open PRs: #36345 resets
write_posonly on its new buffer-only load-back path; #37837 resets it on the extra_buffer donate path. Neither coversprepare_load_back.Accuracy Tests
CPU: 2 passed. With the reset removed:
test_load_back_slot_starts_with_empty_ringfails (cursor stays nonzero). The test seeds the stale cursor directly; that retract/abort leave one behind is from reading the release paths. Not run end-to-end on GPU.Speed Tests and Profiling
No hot-path change beyond the fix itself; not separately benchmarked.
Checklist
Review and Merge Process
/tag-and-rerun-ci,/tag-run-ci-label,/rerun-failed-ciCI States
Latest PR Test (Base): ❌ Run #36767714730
Latest PR Test (Extra): ❌ Run #36767714122
Latest PR Test (AMD ROCm 10): ❌ Run #36767714748