Skip to content

feat(mamba2): add indexed scan kernels for NVIDIA and MetaX - #1562

Draft
big-hip wants to merge 1 commit into
InfiniTensor:InfiniLM-v0.2.9cfrom
big-hip:feat/mamba2-device-scan
Draft

big-hip wants to merge 1 commit into
InfiniTensor:InfiniLM-v0.2.9cfrom
big-hip:feat/mamba2-device-scan

Conversation

@big-hip

@big-hip big-hip commented Sep 17, 2026

Copy link
Copy Markdown

Add packed Mamba-2 SSD scanning and single-step recurrent updates with FP32 state, indexed request rows and device-side computation. NVIDIA and MetaX share the scan kernels and workspace contract through platform launch wrappers. Integrate with the existing C/C++/Python operator and graph plan/run interfaces.

Branch: feat/mamba2-device-scan. Base: InfiniLM-v0.2.9c.

Twenty files (+851/-0): 647 implementation/interface lines and 204 test lines. The test uses an independent token recurrence and compares the whole state pool, including untouched rows. Public interfaces document contiguous tensor shapes, valid distinct destinations, read-only zero state and unsupported cross-request aliasing.

Validation: the unchanged operator sources previously passed 54 output/state cases on C500 and NVIDIA plus descriptor negative cases. The current C500 real-model test run passed with the same operator binary. This session did not rerun the full standalone operator matrix or rebuild this isolated branch. Formatting and whitespace checks passed.

Full Mamba Decode-graph use also needs the separate graph-lifetime/recording fixes in #1560. This operator PR does not include them or the MetaX GEMM precision switch. Scheduler chunked Prefill, state prefix caching, PP and additional device backends are outside its scope. The scan kernel's internal 256-token chunks do not implement scheduler chunking.

  • Device math and public operator contract.
  • Independent numerical/state regression retained.
  • Standalone branch build and upstream CI.

Published as a draft while independent branch builds and upstream CI are pending.

Saved output, source provenance, device conditions and archived measurements: immutable evidence. Attachments live on a separate fork branch and are not part of this source diff.

Rendering of saved regression output; not a fresh CI run

CI at publication: fork Ruff passed; the independent fork CPU build/test matrix is in progress. The upstream run reports action_required and needs repository-side approval. No successful upstream build is claimed.

Add the descriptor, workspace and graph-aware operator interfaces for packed prefill and single-step updates. Share device scan kernels and verify outputs plus the entire state pool against an independent recurrence.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant