Skip to content

[Perf] mamba: Fuse strided state updates and replay index translation - #44971

Merged
ch-wan merged 2 commits into
mainfrom
cheng/dev/unified-conv-state-updates
Oct 18, 2026
Merged

ch-wan merged 2 commits into
mainfrom
cheng/dev/unified-conv-state-updates

Conversation

@ch-wan

@ch-wan ch-wan commented Oct 18, 2026 •

Copy link
Copy Markdown
Collaborator

This PR is part of a stack (oldest at bottom):

Current head aa99e4122c, based on main d318a546da. Stack predecessor: #44970. The Files changed tab isolates this PR from its predecessor.

Motivation

Unified recurrent-state entries can have non-contiguous strides. Falling back to separate state scatters and translating replay indices outside the captured work adds launch and scheduler overhead.

Modifications

Replayed onto the corrected prerequisites; its patch is unchanged.

  • Support strided destination layouts in the fused state scatter, including destination strides in descriptor cache keys.
  • Fuse replay-state index translation into captured work.
  • Share checkpoint/index preparation between static and unified paths without changing their index domains.
  • Add strided scatter, checkpoint, and replay-index regression coverage.

CI registration updates

Updated est_time in 1 affected test files from observed file-level CI timings, including process/import cost and margin. Existing estimates with sufficient margin are retained. The expanded weekly configurator test also passed all 11 cases in a 30.1-second CPU measurement.

The CI registry check validated 2,960 registrations before landing. An AST comparison confirmed that this follow-up changes registration metadata only. Runtime test measurements elsewhere in this description refer to their stated earlier revisions.

Accuracy Tests

Earlier combined stack b550cacde6 adds a test-fixture correction in #43326: the Gemma4 read-stream fixture declares its FULL address space, and the HiSparse registry test uses real CacheInitParams for the retained-window calculation. Both complete test files pass locally with GPUs hidden: 4 Gemma4 tests and 26 registry tests. Pre-commit passed. The five descendant patches are unchanged (git range-diff); this follow-up changes no production code. The earlier 455-test run did not cover these two files; GitHub CI has not yet been revalidated for this head.

Validation before the test-fixture follow-up, on combined stack 4cf27a551c: 455 tests and 921 subtests passed on B300, plus the two widened-history regressions against Rust TreeCore. The new FULL-fallback metadata cases cover eager execution and CUDA graph replay. New allocation-reclaim, explicit-prefill and JIT-reuse regressions fail on the previous code and pass with the fixes. These are combined-stack checks, not independent model reruns of each PR.

31 tests and 106 subtests passed on B300 at the previous head 67271ce153, covering checkpoint indices, state scatter, and fused replay-state indices.

Speed Tests and Profiling

Performance validation is reported for the final combined stack below; this run does not attribute an isolated throughput gain to this PR.

Prior combined-stack E2E output/acceptance and throughput results: #44973. These measurements include all five changes before the review updates.

Checklist

  • Commit pre-commit hooks passed.
  • Regression tests passed on the combined stack; earlier individual-head results are labeled above.
  • Followed SGLang code style.
  • Upstream CI pending.

CI States

Latest PR Test (Base): 🚫 Run #39128289566
Latest PR Test (Extra): 🚫 Run #39128289592
Latest PR Test (AMD ROCm 10): ❌ Run #39128289604

@ch-wan
ch-wan force-pushed the cheng/dev/unified-conv-state-updates branch from 67271ce to b8d1cee Compare October 18, 2026 08:13
@ch-wan
ch-wan force-pushed the cheng/dev/unified-allocator-overhead branch from c59c07f to 68553ac Compare October 18, 2026 09:02
@ch-wan
ch-wan force-pushed the cheng/dev/unified-conv-state-updates branch from b8d1cee to ea86492 Compare October 18, 2026 09:02
@ch-wan
ch-wan force-pushed the cheng/dev/unified-allocator-overhead branch from 68553ac to d541e80 Compare October 18, 2026 12:39
@ch-wan
ch-wan requested a review from Jialin as a code owner October 18, 2026 12:39
Base automatically changed from cheng/dev/unified-allocator-overhead to main October 18, 2026 12:40
@ch-wan
ch-wan force-pushed the cheng/dev/unified-conv-state-updates branch from ea86492 to aa99e41 Compare October 18, 2026 12:40
@ch-wan
ch-wan merged commit 2a83471 into main Oct 18, 2026
36 of 46 checks passed
@ch-wan
ch-wan deleted the cheng/dev/unified-conv-state-updates branch October 18, 2026 12:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant