Conversation
Pack only after all weights are loaded, keep layout state local to each linear, and preserve fused projection slicing. Add a shared-head and repeated-packing regression.
Reuse existing layers, request-state pools and Decode graphs for pure Mamba-2. Support indexed states, checkpoint preparation, tensor parallelism and standard service entrypoints. Keep recurrence, state-isolation and lifecycle regressions with bounded repeat counts.
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.
Summary
Support the prepared
state-spaces/mamba2-130mcheckpoint through existing inference, benchmark and service entrypoints. Add a Mamba-2 model and processor, weight mapping/preparation, indexed convolution/SSM state, tensor-parallel projections and protected Decode capture. Reuse the existing linear, convolution, normalization, state-pool and graph mechanisms. Prefill remains eager.The first commit fixes shared packed-linear layouts and loading tied weights before capture; the second adds the model; a focused follow-up rejects unsupported pipeline service configuration before worker setup. The branch contains 18 changed files (+1394/-32), including 636 test lines and 65 README lines.
Branch:
feat/mamba2-model-inference. Base:InfiniLM-v0.2.9c.Motivation
Add a pure SSM model architecture using device computation on NVIDIA and MetaX. For 130M TP1 BF16, recurrent state occupies approximately 18.25 MiB per request independent of processed history length; the existing scheduler still enforces its logical page budget.
Dependencies: InfiniCore #1562 (scan kernels) and #1560 (graph lifetimes/recording); strict MetaX FP32 validation additionally uses #1561. The three Core diffs are disjoint and were validated together; the model needs their combined runtime as described below.
Type of Change
feat— new model.fix— required loading/layout and state capture correctness.Test Results of Involved Models on Supported Platforms (Please attach screenshots)
Follow-up
5f89ae3d: the existing unsupported-service configuration regression now covers PP and fails if it reachesModelRunner. Before the fix, the PP case reached worker setup (1 failed, 4 passed); after the fix, 5 passed. Repository formatting passed. These configuration checks load no model and are not a fresh GPU/model performance run. The C500 42-test result and performance evidence below refer to the earlierd337a05frevision; model math and device code are unchanged.Core graph/precision checks passed separately (13 cases). Retained model checks cover recurrence, dynamic request reordering, zero-state isolation, recapture with live requests, state-pool rebuild, capacity exhaustion, cancellation and EOS/length release. Default repeat loops are 16 Decode steps with recapture at step 8 and 12 service cycles; this is bounded regression coverage, not a soak test.
Prior matching-source entrypoint checks completed text inference, offline benchmark, evaluation adapter and HTTP service. The five MMLU samples scored 0/5: this demonstrates adapter execution only, not acceptable task accuracy. Those entrypoints were not all rerun in this cleanup. Saved output is attached below as a rendered image, with immutable logs and provenance links; it is not a fresh CI screenshot.
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.
Benchmark / Performance Impact
Archived C500 BF16 TP1 internal comparison: 128 input tokens, batch 1, 128 greedy output tokens, 16 Decode warmup tokens and three repetitions. Enabling existing Decode graphs reduced the median of per-run mean ITLs from 12.54 to 7.67 ms; finite-request output rate rose from 79.48 to 128.95 token/s. Prefill was eager in both configurations; capture/loading/tokenization were excluded. This is not a new Prefill-graph result or sustained service benchmark.
Fixed WikiText subset: 8 passages / 4099 prediction targets; C500 BF16 mean NLL 3.14331950 versus archived official NVIDIA BF16 3.13971278. It is a bounded numerical-quality check, not universal logit equality or a broad quality evaluation. Official NVIDIA graph inference remained faster in the archived A6000 comparison.
Notes for Reviewers
Current scope: pure Mamba-2, one B/C group, convolution width 4, head-wise D, gated RMSNorm after gating and unbounded time steps. No hybrid Attention/SSM, quantization, scheduler chunked Prefill, prefix-state snapshots, remote state transfer, speculative rollback or PP. No CPU scan/update fallback. Low-precision logits can vary across compute shapes.
No research logs, weights, profiles or machine-specific build patches are included in the source diff. Native implementation and model math match the previously tested snapshot; the only subsequent production change is the two-line Python PP preflight check. Fresh full builds of every split branch remain pending.
CI / ChatOps
Current
5f89ae3dfork push checks passed: CI formatting and Ruff. The upstream CI run reportsaction_requiredand needs repository-side approval before jobs start.Local targeted regressions, repository formatting and whitespace checks passed. This remains a Draft PR: fresh independent accelerator builds and remaining checklist audits are pending. Fork formatting is not a full hardware build. No maintainer review is requested yet.
Checklist
Title, Branch, and Commits
feat(nvidia): …,fix(cuda/gemm): …).<type>/xxx-yyyy-zzzzwhere<type>matches the PR title's Conventional Commits type and words are joined with hyphens (seeCONTRIBUTING.md§Branches).CONTRIBUTING.md§Pull Requests).InfiniLM-v0.2.9c(270feb3e) without merge commits; the remote base was verified unchanged at publication.fixup!/squash!/wipcommits remain.Scope and Design
CONTRIBUTING.md§Code/General).printf/std::cout/print(...)left behind, orTODOwithout an owner and issue link.General Code Hygiene (applies to all languages)
CONTRIBUTING.md§Code/General).CONTRIBUTING.md§Code/General).the `seqlens_k` tensor) (CONTRIBUTING.md§Code/General).CONTRIBUTING.md§Code/General).CONTRIBUTING.md§Code/General; §Python).C++ Specific (if C++ files changed)
CONTRIBUTING.md§C++).CONTRIBUTING.md§C++).new/delete; RAII / smart pointers / existing allocators are used.scripts/format.py.csrc/models/llama_legacy/.Python Specific (if Python files changed)
CONTRIBUTING.md§Python).CONTRIBUTING.md§Python).scripts/format.py.python/infinilm/auto_config.py.Testing
examples/test_infer.py), or specify the reason for skipping.examples/bench.py), or specify the reason for skipping.test/bench/test_benchmark.py), or specify the reason for skipping.python/infinilm/server/inference_server.py+scripts/test_perf.py), or specify the reason for skipping.Build, CI, and Tooling
/retestwas requested.Documentation
README.md,CONTRIBUTING.md, or inline docs updated when behavior, build flags, or developer workflow changed.Security and Safety