跳到主要内容
Octopus Research Institute
TR-2026-0008技术报告同行评审: 未经同行评审证据强度: 实验性状态: 已发布

Porting Mamba (selective-scan SSM) into a sovereign sequence-mixing engine

Ran Tao (Octoryn Research)

本文未经同行评审。请将其视为工作文档,而非经验证的结果。

摘要

An independently implemented selective-scan state-space (Mamba-style, 130M-class) forward pass, built without the reference SSM GPU kernel library, reproduces a HuggingFace transformers f16 prefill-logit reference at cosine 0.999997, argmax 8/8 across two prompts. A kill-selectivity control removing input-dependent selection collapses parity to cosine -0.73 (0/8), showing selectivity is load-bearing, not incidental. This is the engine's first non-attention (state-space) sequence-mixing paradigm. Scope: an f16 logit-parity smoke test, not a benchmark; no quality, throughput, or quantized claim.

本 Research Object 以其原始语言(英文)发表。

1. Contribution

Claimed. This report documents a correctness-validation result: a hand-written, independently implemented selective-scan state-space version of a 130M-class Mamba model reproduces a reference HuggingFace transformers f16 prefill-logit forward pass at cosine similarity 0.999997, with argmax matching on 8/8 checks across two prompts. The implementation covers the selective scan with input-dependent step, input, and output projections, plus causal 1D convolution, softplus, and SiLU gating — with no attention, KV cache, or rotary position embedding. A kill-selectivity negative control that removes the input-dependent selection collapses parity to cosine -0.73, argmax 0/8, demonstrating that the selective mechanism — not incidental numerical proximity — drives the match. A linkage check confirms the build carries no dependency on the reference SSM GPU kernel library and no vendor BLAS. This is the engine's first non-attention paradigm, so the engineering altitude is paradigm coverage and faithful reproduction, not a novel algorithm.

NOT claimed. This is a logit-parity smoke test, not a benchmark. It does not establish generation quality (parity of next-token logits is not text quality), throughput or latency competitiveness (the scan runs sequentially and is not compared to a fused GPU kernel), correctness at quantized precision (only f16 was tested), or coverage of larger Mamba variants, Mamba-2/SSD, or hybrid state-space plus attention models (e.g. Jamba). The sample is small (two prompts) and single-run.

2. Methods

FieldValue
ModelMamba, 130M-class
HardwareConsumer AMD RDNA2-class GPU (16 GB class)
StackIndependent sovereign engine build (recent stack versions)
Oracle / baselineHuggingFace transformers (recent version)
Proceduref16 prefill-logit comparison versus oracle on identical input ids
Precisionf16
Metric + gateper-position cosine similarity and argmax match; reported 8/8 across two prompts
Stimulus / inputstwo prompts (exact text not recorded); coherent output observed

3. Results

MeasurementValue
f16 logit parity (cosine)0.999997
argmax match8/8 (two prompts)
Output coherencecoherent (qualitative)
Sovereignty (linkage check)no reference SSM GPU kernel library, no vendor BLAS

4. Ablations / Negative controls

ControlManipulationResultInterpretation
Kill-selectivityforce a constant step parameter (removes input-dependent selection)cosine -0.73, argmax 0/8 FAILThe selective mechanism is load-bearing; the f16 match is not coincidental.

5. Threats to Validity / Limitations

  • Sample size. Two prompts across a handful of token positions (8 argmax checks total) is a correctness smoke test, not a benchmark-scale evaluation. No claim about distributional behavior follows.
  • Single run, no variance. Parity is reported as point values; no repetition, seed sweep, or variance is recorded.
  • Precision ceiling. Only f16 was validated. Quantized correctness (8-bit / 4-bit) is untested and explicitly out of scope.
  • Parity is not quality. Cosine 0.999997 on logits demonstrates faithful numerical reproduction of the reference forward pass; it says nothing about generation quality, long-context behavior, or downstream task performance.
  • Baseline weakness. The oracle is the reference library's own sequential fallback (it falls back to a sequential scan when the fused GPU kernel is absent), so this validates against reference semantics but not against fused-kernel numerics. Throughput is not compared against any fused kernel.
  • Provenance gaps. Exact build identifiers, library versions, and exact prompt text are not recorded, weakening exact reproducibility.
  • Scope. A single 130M-class Mamba model only; no larger Mamba, Mamba-2/SSD, or hybrid state-space plus attention coverage. An experimental evidence level is retained as appropriate for a single-configuration parity result.

6. Reproducibility / Provenance

  • Implementation. Hand-written selective scan with causal 1D convolution, softplus for the step parameter, and SiLU gating; no attention, KV cache, or rotary position embedding. The recurrence follows the standard published selective state-space formulation.
  • Oracle caveat. Validate the oracle first: the reference must be exercising its sequential-scan fallback (no fused SSM GPU kernel present) for its semantics to match the on-box sequential scan.
  • Sovereignty check. A dynamic-linkage inspection shows the GPU runtime and system libraries only — no vendor BLAS or deep-learning primitives library, and no dependency on the reference SSM kernel package.
  • Build. Compiled with the AMD HIP toolchain targeting an RDNA2-class architecture. Exact build identifiers and run commands are not recorded.
  • Versions. Oracle and engine stack are recent versions; precise version fingerprints are omitted.

声明边界

作者对范围的明确界定——本工作证明了什么、未证明什么——沿用自 Octoryn Research 的发表模型。

证明

  • A hand-written, independently implemented selective-scan SSM (130M-class Mamba) reproduces a HuggingFace f16 prefill-logit reference at cosine 0.999997, with argmax matching on 8/8 checks across two prompts.
  • A kill-selectivity negative control collapses parity to cosine -0.73 (0/8), showing the selective mechanism is load-bearing and the f16 match is not coincidental.
  • The engine now spans both attention and state-space sequence-mixing paradigms, implemented independently of the reference SSM kernel library.

未证明

  • Generation quality, long-context behavior, or downstream task performance; logit parity is not a quality claim.
  • Correctness at quantized precision, since only f16 was tested.
  • Throughput or latency competitiveness of the sequential scan versus a fused GPU kernel.
  • Coverage of larger Mamba variants, Mamba-2/SSD, or hybrid state-space plus attention models such as Jamba.

适用于

  • f16 prefill-logit parity for a 130M-class Mamba model on a consumer AMD RDNA2-class GPU versus a HuggingFace transformers reference using identical input ids.

不适用于

  • Quantized precision, generation or throughput claims, other state-space model variants, or benchmark-scale evaluation.
  • The reference is not exercising its sequential-scan fallback path.

作者

  • Ran Tao — 调查研究, 写作

引用本文

引用格式

Tao, R., Octoryn Research. (2026). Porting Mamba (selective-scan SSM) into a sovereign sequence-mixing engine (TR-2026-0008). Octopus Research Institute.

BibTeX

@techreport{oritr20260008,
  title       = {Porting Mamba (selective-scan SSM) into a sovereign sequence-mixing engine},
  author      = {Tao, Ran and {Octoryn Research}},
  institution = {Octopus Research Institute},
  year        = {2026},
  note        = {Permanent ID TR-2026-0008. Not peer reviewed.}
}

披露

资助
硬件与基础设施由 Octoryn / Octopus Core Pty Ltd 提供。
利益冲突
Octoryn 提供商业推理与治理工具;相关发现独立报告。