{"about":{"site":"https://codewithpapers.app","non_affiliation":"Code with Papers and Syntology are not affiliated with, endorsed by, or sponsored by Papers with Code, Meta, or the pwc-archive mirror.","licence":"CC BY-SA 4.0","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","attribution":"https://codewithpapers.app/attribution","modified":"archive material modified by Syntology; see the attribution page"},"url":"/paper/arxiv-2603-09555","title":"Compiler-First State Space Duality and Portable $O(1)$ Autoregressive Caching for Inference","arxiv_id":"2603.09555","date":"2026-03-10","proceeding":null,"authors":["Cosmo Santoni","Anmol Thapar"],"abstract":"High-throughput Mamba-2 inference is usually tied to fused CUDA and Triton kernels, limiting portability across accelerator backends. We show that the state space duality (SSD) recurrence has a compiler-friendly structure: diagonal per-head dynamics, fixed-size chunking, einsum-dominated compute, and static control flow. Expressing this structure in standard JAX primitives gives a single-source inference path with no custom kernels, a registered JAX PyTree cache, and a compiled on-device autoregressive loop. On a single Google Cloud TPU v6e, batch-1 prefill reaches approximately 140 TFLOPS, or 15% model FLOP utilisation (MFU), the roofline ceiling for this regime, and cached decode reaches up to 64% hardware bandwidth utilisation (HBU). At a 4096-token context, cached decode is 27x--36x faster than full-prefix recomputation across five Mamba-2 checkpoints from 130M to 2.7B parameters. The same source runs unmodified on NVIDIA L40S, where cached decode remains sequence-length independent across all model scales. WikiText-103 validation perplexity matches the Triton reference mamba_ssm v2.2.2 within +/-0.0005 points, and hidden states agree to float32 rounding tolerance. Code is available at https://github.com/CosmoNaught/mamba2-jax.","url_abs":"https://arxiv.org/abs/2603.09555","url_pdf":"https://arxiv.org/pdf/2603.09555","source":{"archive":null,"snapshot":"2025-07-28","note":"not in the Papers with Code archive (frozen at the snapshot)","row_kind":"graph","title_abstract_authors_date":"arXiv metadata, CC0 1.0 (https://info.arxiv.org/help/license)"},"code_links":[],"tasks":[],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":"https://syntology.ai/paper/2603.09555","atlas_url":"https://app.syntology.ai/?focus=2603.09555","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2603.09555"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-25T09:33:49+00:00","read_at_is":"when the build read Syntology's graph, not when any sample ran","claim":"Per-sample execution status on synthesized fixtures; not a correctness claim about the paper. Samples come from repositories linked to the paper, official or community; repo_kind says which.","repos":[{"mentioned_in_github":null,"is_official":null,"provenance":"deterministic:regex_extraction","mentioned_in_paper":null,"url":"https://github.com/CosmoNaught/mamba2-jax","reach":null}],"summary":{"ran_fixture":2,"ran_violates":1,"unverified":1},"by_repo_kind":{"found_in_text":{"samples":4,"ran":3,"repositories":1}},"repo_kind_vocabulary":{"official":"The archive marks this repository official for the paper","named_in_paper":"The archive records that the paper mentions this repository; it is not marked official","listed":"In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper","found_in_text":"Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted","community":"Not in the archive's code links for this paper; a community repository Syntology harvested"},"n_pointer_only_for_licence":0,"samples":[{"code_sha256_prefix":"1c1570e713cb8b07","entry":"_pad_seq_dim","repo":"CosmoNaught/mamba2-jax","repo_kind":"found_in_text","path":"mamba2_jax/modeling.py","file_url":"https://github.com/CosmoNaught/mamba2-jax/blob/HEAD/mamba2_jax/modeling.py","link_basis":"first_harvest_node","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"1c1570e713cb8b07"}},{"code_sha256_prefix":"31f8b1d88653bd4c","entry":"segsum","repo":"CosmoNaught/mamba2-jax","repo_kind":"found_in_text","path":"mamba2_jax/modeling.py","file_url":"https://github.com/CosmoNaught/mamba2-jax/blob/HEAD/mamba2_jax/modeling.py","link_basis":"first_harvest_node","language":"python","status":"ran_violates","verification_level":1,"contract_check":"VIOLATES","metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"31f8b1d88653bd4c"}},{"code_sha256_prefix":"6c01ca80a21a483b","entry":"ssd_forward","repo":"CosmoNaught/mamba2-jax","repo_kind":"found_in_text","path":"mamba2_jax/modeling.py","file_url":"https://github.com/CosmoNaught/mamba2-jax/blob/HEAD/mamba2_jax/modeling.py","link_basis":"first_harvest_node","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":"deterministic","behaviour_fingerprint":true,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"6c01ca80a21a483b"}},{"code_sha256_prefix":"e45297636d686a11","entry":"_ssd_single_chunk","repo":"CosmoNaught/mamba2-jax","repo_kind":"found_in_text","path":"mamba2_jax/modeling.py","file_url":"https://github.com/CosmoNaught/mamba2-jax/blob/HEAD/mamba2_jax/modeling.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"e45297636d686a11"}}]},"arxiv_metadata":{"licence":"arXiv metadata, CC0 1.0 (https://info.arxiv.org/help/license)","fields":["title","abstract","authors","date"],"primary_category":"cs.LG","source":"arxiv_2026.jsonl"},"syntology_extracted_results":null}