Mamba SSM architecture
This report presents the forensic synthetic code analysis of state-spaces/mamba, a Python project with 18,596 GitHub stars. SynthScan v2.0 examined 30,216 lines of code across 85 source files, recording 394 pattern matches distributed across 15 syntactic categories. The overall adjusted score of 21.1 places this repository in the Moderate AI signal band.
The scanner applied 160+ deterministic lexical heuristics, multi-line block detectors, abstract syntax tree depth profilers, and a cross-file Jaccard similarity matrix to construct a statistically normalised synthetic code estimate. All matches are individually weighted by severity coefficient and contextual multiplier before summation, and the resulting headline score is temporally discounted to account for the repository's development history relative to the commercial emergence of large language model coding tooling (November 2022 onward).
This chart maps the temporal evolution of the adjusted synthetic code score across successive scan runs. An upward trajectory indicates ongoing incorporation of AI-generated code or expanding LLM-assisted scaffolding; a stable or declining trajectory may reflect active human refactoring, code removal, or the adoption of stricter authorship policies. The dashed secondary line (right axis) independently tracks total raw pattern hit count, which can diverge from the normalised score when codebase size changes significantly between scans.
Classifies detected patterns by their diagnostic confidence and structural impact. CRITICAL patterns (coefficient 10) represent definitive synthetic signatures — hallucinated imports, explicit LLM attribution metadata — virtually never produced by human authors. HIGH (5) indicates strong structural tells such as cross-file repetition or cross-linguistic idioms. MEDIUM (2) covers recognisable conversational padding and AI-specific vocabulary. LOW (1) captures subtle indicators like tautological comments and generic boilerplate that require density to carry independent signal.
This horizontal bar chart decomposes the repository's raw synthetic code score by top-level directory, allowing you to pinpoint precisely which modules or components carry the highest AI authorship density. Directories with disproportionately high scores relative to their size warrant targeted manual review: concentrated AI signatures often trace back to mass-generated configuration layers, auto-ported test suites, LLM-scaffolded boilerplate classes, or entire subsystems authored under heavy copilot assistance. Use this view to prioritise your human code-review effort.
The scanner identified 394 distinct pattern matches across 15 syntactic categories. Each entry below represents a discrete location in the source code where the engine recorded a statistically significant AI authorship indicator. Expand any category row to inspect the individual file paths, line numbers, code snippets, and the lexical context (CODE, COMMENT, or STRING) in which each match was detected.
Reading the findings table: The Severity column indicates the diagnostic confidence level (CRITICAL / HIGH / MEDIUM / LOW). The Context column identifies whether the match occurred inside executable code, an inline comment, or a string literal — comment-context matches receive a ×1.5 weight because LLMs systematically over-annotate. The ⚡ bolt icon marks clustered matches: three or more patterns within a 10-line window, each receiving an additional ×1.5 density multiplier as dense clusters constitute far stronger evidence of synthetic authorship than isolated hits.
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | tests/ops/triton/test_mamba3_siso.py | 342 | # ================================================================== | COMMENT |
| MEDIUM | tests/ops/triton/test_mamba3_siso.py | 344 | # ================================================================== | COMMENT |
| MEDIUM | tests/ops/triton/test_mamba3_siso.py | 483 | # ================================================================== | COMMENT |
| MEDIUM | tests/ops/triton/test_mamba3_siso.py | 485 | # ================================================================== | COMMENT |
| MEDIUM | tests/ops/triton/test_mamba3_siso.py | 553 | # ================================================================== | COMMENT |
| MEDIUM | tests/ops/triton/test_mamba3_siso.py | 555 | # ================================================================== | COMMENT |
| MEDIUM | tests/ops/triton/test_mamba3_siso.py | 667 | # ================================================================== | COMMENT |
| MEDIUM | tests/ops/triton/test_mamba3_siso.py | 669 | # ================================================================== | COMMENT |
| MEDIUM | tests/ops/triton/test_mamba3_siso.py | 839 | # ================================================================== | COMMENT |
| MEDIUM | tests/ops/triton/test_mamba3_siso.py | 841 | # ================================================================== | COMMENT |
| MEDIUM | tests/ops/tilelang/test_mamba3_mimo.py | 1727 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM | tests/ops/tilelang/test_mamba3_mimo.py | 1729 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM | tests/ops/tilelang/test_mamba3_mimo.py | 2032 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM | tests/ops/tilelang/test_mamba3_mimo.py | 2034 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM | tests/ops/tilelang/test_mamba3_mimo.py | 2046 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM | tests/ops/tilelang/test_mamba3_mimo.py | 2048 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM | tests/ops/tilelang/test_mamba3_mimo.py | 2152 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM | tests/ops/tilelang/test_mamba3_mimo.py | 2154 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM | tests/modules/test_mamba3_varlen.py | 21 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM | tests/modules/test_mamba3_varlen.py | 23 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM | tests/modules/test_mamba3_varlen.py | 55 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM | tests/modules/test_mamba3_varlen.py | 57 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM | mamba_ssm/ops/cute/mamba3/mamba3_step_fn.py | 845 | # ========================================================================= | COMMENT |
| MEDIUM | mamba_ssm/ops/cute/mamba3/mamba3_step_fn.py | 847 | # ========================================================================= | COMMENT |
| MEDIUM | mamba_ssm/ops/cute/mamba3/mamba3_step_fn.py | 879 | # ========================================================================= | COMMENT |
| MEDIUM | mamba_ssm/ops/cute/mamba3/mamba3_step_fn.py | 881 | # ========================================================================= | COMMENT |
| MEDIUM | mamba_ssm/ops/cute/mamba3/mamba3_step_fn.py | 915 | # ========================================================================= | COMMENT |
| MEDIUM | mamba_ssm/ops/cute/mamba3/mamba3_step_fn.py | 917 | # ========================================================================= | COMMENT |
| MEDIUM | mamba_ssm/ops/triton/mamba3/angle_dt.py | 11 | # ----------------------------------------------------------------------------- | COMMENT |
| MEDIUM | mamba_ssm/ops/triton/mamba3/angle_dt.py | 13 | # ----------------------------------------------------------------------------- | COMMENT |
| MEDIUM | mamba_ssm/ops/triton/mamba3/angle_dt.py | 219 | # ----------------------------------------------------------------------------- | COMMENT |
| MEDIUM | mamba_ssm/ops/triton/mamba3/angle_dt.py | 221 | # ----------------------------------------------------------------------------- | COMMENT |
| MEDIUM⚡ | mamba_ssm/ops/triton/mamba3/mamba3_mimo_utils.py | 1409 | # ============================================================================ | COMMENT |
| MEDIUM⚡ | mamba_ssm/ops/triton/mamba3/mamba3_mimo_utils.py | 1411 | # ============================================================================ | COMMENT |
| MEDIUM | mamba_ssm/ops/triton/mamba3/mamba3_mimo_utils.py | 56 | # ============================================================================ | COMMENT |
| MEDIUM | mamba_ssm/ops/triton/mamba3/mamba3_mimo_utils.py | 60 | # ============================================================================ | COMMENT |
| MEDIUM | mamba_ssm/ops/triton/mamba3/mamba3_mimo_utils.py | 131 | # ============================================================================ | COMMENT |
| MEDIUM | mamba_ssm/ops/triton/mamba3/mamba3_mimo_utils.py | 135 | # ============================================================================ | COMMENT |
| MEDIUM | mamba_ssm/ops/triton/mamba3/mamba3_mimo_utils.py | 220 | # ============================================================================ | COMMENT |
| MEDIUM | mamba_ssm/ops/triton/mamba3/mamba3_mimo_utils.py | 224 | # ============================================================================ | COMMENT |
| MEDIUM | mamba_ssm/ops/triton/mamba3/mamba3_mimo_utils.py | 354 | # ============================================================================ | COMMENT |
| MEDIUM | mamba_ssm/ops/triton/mamba3/mamba3_mimo_utils.py | 358 | # ============================================================================ | COMMENT |
| MEDIUM | mamba_ssm/ops/triton/mamba3/mamba3_mimo_utils.py | 440 | # ============================================================================ | COMMENT |
| MEDIUM | mamba_ssm/ops/triton/mamba3/mamba3_mimo_utils.py | 442 | # ============================================================================ | COMMENT |
| MEDIUM | mamba_ssm/ops/triton/mamba3/mamba3_mimo_utils.py | 516 | # ============================================================================ | COMMENT |
| MEDIUM | mamba_ssm/ops/triton/mamba3/mamba3_mimo_utils.py | 518 | # ============================================================================ | COMMENT |
| MEDIUM | mamba_ssm/ops/triton/mamba3/mamba3_mimo_utils.py | 725 | # ============================================================================ | COMMENT |
| MEDIUM | mamba_ssm/ops/triton/mamba3/mamba3_mimo_utils.py | 732 | # ============================================================================ | COMMENT |
| MEDIUM | mamba_ssm/ops/triton/mamba3/mamba3_mimo_utils.py | 1005 | # ============================================================================ | COMMENT |
| MEDIUM | mamba_ssm/ops/triton/mamba3/mamba3_mimo_utils.py | 1008 | # ============================================================================ | COMMENT |
| MEDIUM | mamba_ssm/ops/triton/mamba3/mamba3_mimo_utils.py | 1700 | # ============================================================================ | COMMENT |
| MEDIUM | mamba_ssm/ops/triton/mamba3/mamba3_mimo_utils.py | 1702 | # ============================================================================ | COMMENT |
| MEDIUM | mamba_ssm/ops/triton/mamba3/mamba3_mimo_utils.py | 1844 | # ============================================================================ | COMMENT |
| MEDIUM | mamba_ssm/ops/triton/mamba3/mamba3_mimo_utils.py | 1846 | # ============================================================================ | COMMENT |
| MEDIUM⚡ | mamba_ssm/ops/triton/mamba3/mamba3_siso_bwd.py | 396 | # ============================================================ | COMMENT |
| MEDIUM⚡ | mamba_ssm/ops/triton/mamba3/mamba3_siso_bwd.py | 399 | # ============================================================ | COMMENT |
| MEDIUM⚡ | mamba_ssm/ops/triton/mamba3/mamba3_siso_bwd.py | 406 | # ============================================================ | COMMENT |
| MEDIUM⚡ | mamba_ssm/ops/triton/mamba3/mamba3_siso_bwd.py | 408 | # ============================================================ | COMMENT |
| MEDIUM⚡ | mamba_ssm/ops/triton/mamba3/mamba3_siso_bwd.py | 415 | # ============================================================ | COMMENT |
| MEDIUM⚡ | mamba_ssm/ops/triton/mamba3/mamba3_siso_bwd.py | 417 | # ============================================================ | COMMENT |
| 56 more matches not shown… | ||||
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | tests/test_generation.py | 8 | CODE | |
| LOW | tests/test_generation.py | 10 | CODE | |
| LOW | tests/ops/test_selective_scan.py | 3 | CODE | |
| LOW | tests/ops/test_selective_scan.py | 6 | CODE | |
| LOW | tests/ops/test_selective_scan.py | 9 | CODE | |
| LOW | tests/ops/cute/test_mamba3_mimo_step.py | 15 | CODE | |
| LOW | tests/ops/cute/test_mamba3_mimo_step.py | 18 | CODE | |
| LOW | tests/ops/triton/test_ssd.py | 1 | CODE | |
| LOW | tests/ops/triton/test_ssd.py | 8 | CODE | |
| LOW | tests/ops/triton/test_ssd.py | 10 | CODE | |
| LOW | tests/ops/triton/test_ssd.py | 13 | CODE | |
| LOW | tests/ops/triton/test_ssd.py | 13 | CODE | |
| LOW | tests/ops/triton/test_ssd.py | 15 | CODE | |
| LOW | tests/ops/triton/test_ssd.py | 15 | CODE | |
| LOW | tests/ops/triton/test_ssd.py | 16 | CODE | |
| LOW | tests/ops/triton/test_ssd.py | 16 | CODE | |
| LOW | tests/ops/triton/test_ssd.py | 16 | CODE | |
| LOW | tests/ops/triton/test_ssd.py | 16 | CODE | |
| LOW | tests/ops/triton/test_ssd.py | 17 | CODE | |
| LOW | tests/ops/triton/test_ssd.py | 17 | CODE | |
| LOW | tests/ops/triton/test_mamba3_siso.py | 11 | CODE | |
| LOW | tests/ops/triton/test_mamba3_siso.py | 14 | CODE | |
| LOW | tests/ops/triton/test_layernorm_gated.py | 1 | CODE | |
| LOW | tests/ops/triton/test_layernorm_gated.py | 8 | CODE | |
| LOW | tests/ops/triton/test_selective_state_update.py | 3 | CODE | |
| LOW | tests/ops/triton/test_selective_state_update.py | 6 | CODE | |
| LOW | tests/ops/triton/test_selective_state_update.py | 9 | CODE | |
| LOW | tests/ops/tilelang/test_mamba3_mimo.py | 28 | CODE | |
| LOW | tests/ops/tilelang/test_mamba3_mimo.py | 29 | CODE | |
| LOW | benchmarks/benchmark_generation_mamba_simple.py | 5 | CODE | |
| LOW | benchmarks/benchmark_generation_mamba_simple.py | 8 | CODE | |
| LOW | benchmarks/benchmark_generation_mamba_simple.py | 10 | CODE | |
| LOW | mamba_ssm/__init__.py | 3 | CODE | |
| LOW | mamba_ssm/__init__.py | 3 | CODE | |
| LOW | mamba_ssm/__init__.py | 4 | CODE | |
| LOW | mamba_ssm/__init__.py | 5 | CODE | |
| LOW | mamba_ssm/__init__.py | 6 | CODE | |
| LOW | mamba_ssm/__init__.py | 7 | CODE | |
| LOW | mamba_ssm/distributed/distributed_utils.py | 1 | CODE | |
| LOW | mamba_ssm/utils/generation.py | 3 | CODE | |
| LOW | mamba_ssm/utils/generation.py | 4 | CODE | |
| LOW | mamba_ssm/utils/generation.py | 6 | CODE | |
| LOW | mamba_ssm/utils/generation.py | 7 | CODE | |
| LOW | mamba_ssm/utils/generation.py | 7 | CODE | |
| LOW | mamba_ssm/utils/generation.py | 10 | CODE | |
| LOW | mamba_ssm/utils/generation.py | 11 | CODE | |
| LOW | mamba_ssm/utils/generation.py | 11 | CODE | |
| LOW | mamba_ssm/utils/generation.py | 13 | CODE | |
| LOW | mamba_ssm/utils/generation.py | 13 | CODE | |
| LOW | mamba_ssm/utils/generation.py | 13 | CODE | |
| LOW | mamba_ssm/utils/torch.py | 2 | CODE | |
| LOW | mamba_ssm/ops/cute/mamba3/mamba3_step_fn.py | 6 | CODE | |
| LOW | mamba_ssm/ops/cute/mamba3/mamba3_step_fn.py | 16 | CODE | |
| LOW | mamba_ssm/ops/cute/mamba3/mamba3_step_fn.py | 16 | CODE | |
| LOW | mamba_ssm/ops/cute/mamba3/mamba3_step_fn.py | 16 | CODE | |
| LOW | mamba_ssm/ops/triton/selective_state_update.py | 6 | CODE | |
| LOW | mamba_ssm/ops/triton/ssd_state_passing.py | 6 | CODE | |
| LOW | mamba_ssm/ops/triton/ssd_state_passing.py | 13 | CODE | |
| LOW | mamba_ssm/ops/triton/ssd_combined.py | 6 | CODE | |
| LOW | mamba_ssm/ops/triton/ssd_combined.py | 13 | CODE | |
| 43 more matches not shown… | ||||
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | setup.py | 62 | def get_cuda_bare_metal_version(cuda_dir): | CODE |
| LOW⚡ | tests/test_determinism.py | 194 | def test_combined_kernel_reproducible(case: str, d_has_hdim: bool, headdim: int, dstate: int): | CODE |
| LOW⚡ | tests/test_determinism.py | 202 | def test_kernel_close_to_default(case: str, headdim: int, dstate: int): | CODE |
| LOW⚡ | tests/test_determinism.py | 210 | def test_combined_kernel_close_to_default(case: str, d_has_hdim: bool, headdim: int, dstate: int): | CODE |
| LOW⚡ | tests/test_determinism.py | 215 | def test_default_mode_is_not_reproducible(): | CODE |
| LOW | tests/test_generation.py | 115 | def test_generation_varlen_with_padding(): | CODE |
| LOW | tests/ops/cute/test_mamba3_mimo_step.py | 55 | def _require_cuda_and_kernel_deps() -> None: | CODE |
| LOW | tests/ops/triton/test_selective_state_update.py | 22 | def test_selective_state_update(dim, dstate, has_z, itype): | CODE |
| LOW | tests/ops/triton/test_selective_state_update.py | 66 | def test_selective_state_update_with_heads(dim, dstate, ngroups, has_z, tie_hdim, itype): | CODE |
| LOW | tests/ops/triton/test_selective_state_update.py | 112 | def test_selective_state_update_with_batch_indices(dim, dstate, has_z, itype): | CODE |
| LOW | tests/ops/triton/test_selective_state_update.py | 161 | def test_selective_state_update_with_heads_with_batch_indices(dim, dstate, ngroups, has_z, tie_hdim, itype): | CODE |
| LOW | tests/ops/tilelang/test_mamba3_mimo.py | 71 | def _require_cuda_and_kernel_deps() -> None: | CODE |
| LOW | tests/ops/tilelang/test_mamba3_mimo.py | 628 | def apply_rotary_emb_rotate_half(tensor: Tensor, cos: Tensor, sin: Tensor) -> Tensor: | CODE |
| LOW | tests/ops/tilelang/test_mamba3_mimo.py | 1596 | def test_mamba_mimo_smoke_forward_backward(mods: SimpleNamespace) -> None: | CODE |
| LOW | tests/ops/tilelang/test_mamba3_mimo.py | 1640 | def test_mamba_mimo_smoke_forward_backward_varlen(mods: SimpleNamespace) -> None: | CODE |
| LOW | mamba_ssm/distributed/distributed_utils.py | 120 | def allreduce_sequence_parallel_grad(model: torch.nn.Module, process_group: ProcessGroup): | CODE |
| LOW⚡ | mamba_ssm/utils/generation.py | 37 | def modify_logits_for_min_p_filtering(logits, min_p): | CODE |
| LOW⚡ | mamba_ssm/utils/generation.py | 45 | def modify_logits_for_top_k_filtering(logits, top_k): | CODE |
| LOW⚡ | mamba_ssm/utils/generation.py | 53 | def modify_logits_for_top_p_filtering(logits, top_p): | CODE |
| LOW | mamba_ssm/utils/generation.py | 69 | def modify_logit_for_repetition_penalty(logits, prev_output_tokens, repetition_penalty=1.0): | CODE |
| LOW | mamba_ssm/utils/determinism.py | 44 | def _filter_configs_by_block_sizes(configs): | CODE |
| LOW | mamba_ssm/ops/selective_scan_interface.py | 26 | def _check_selective_scan_cuda(): | CODE |
| LOW | mamba_ssm/ops/triton/ssd_chunk_scan.py | 195 | def _chunk_scan_fwd_kernel_wip( | CODE |
| LOW | mamba_ssm/ops/triton/ssd_chunk_scan.py | 349 | def _chunk_scan_bwd_dz_kernel( | CODE |
| LOW | mamba_ssm/ops/triton/ssd_chunk_scan.py | 449 | def _chunk_scan_bwd_dstates_kernel( | CODE |
| LOW | mamba_ssm/ops/triton/ssd_chunk_scan.py | 530 | def _chunk_scan_bwd_dc_kernel( | CODE |
| LOW | mamba_ssm/ops/triton/ssd_chunk_scan.py | 641 | def _chunk_scan_bwd_dx_kernel( | CODE |
| LOW | mamba_ssm/ops/triton/ssd_chunk_scan.py | 774 | def _chunk_scan_bwd_dcb_kernel( | CODE |
| LOW | mamba_ssm/ops/triton/ssd_chunk_state.py | 286 | def _chunk_state_bwd_dx_kernel( | CODE |
| LOW | mamba_ssm/ops/triton/ssd_chunk_state.py | 398 | def _chunk_state_bwd_db_kernel( | CODE |
| LOW | mamba_ssm/ops/triton/ssd_chunk_state.py | 640 | def _chunk_state_varlen_kernel( | CODE |
| LOW | mamba_ssm/ops/triton/selective_state_update.py | 24 | def _selective_scan_update_kernel( | CODE |
| LOW | mamba_ssm/ops/triton/selective_state_update.py | 224 | def selective_state_update_ref(state, x, dt, A, B, C, D=None, z=None, dt_bias=None, dt_softplus=False): | CODE |
| LOW | mamba_ssm/ops/triton/ssd_state_passing.py | 30 | def _state_passing_fwd_kernel( | CODE |
| LOW | mamba_ssm/ops/triton/ssd_state_passing.py | 102 | def _state_passing_bwd_kernel( | CODE |
| LOW | mamba_ssm/ops/triton/ssd_combined.py | 93 | def _chunk_scan_chunk_state_bwd_dx_kernel( | CODE |
| LOW | mamba_ssm/ops/triton/ssd_combined.py | 262 | def _chunk_scan_chunk_state_bwd_dx(x, dt, dA_cumsum, B, CB, dout, dstates, D=None, seq_idx=None, dx=None): | CODE |
| LOW | mamba_ssm/ops/triton/ssd_combined.py | 343 | def _mamba_chunk_scan_combined_fwd(x, dt, A, B, C, chunk_size, D=None, z=None, dt_bias=None, initial_states=None, seq_id | CODE |
| LOW | mamba_ssm/ops/triton/ssd_combined.py | 397 | def _mamba_chunk_scan_combined_bwd(dout, x, dt, A, B, C, out, chunk_size, D=None, z=None, | CODE |
| LOW | mamba_ssm/ops/triton/ssd_combined.py | 628 | def mamba_chunk_scan_combined(x, dt, A, B, C, chunk_size, D=None, z=None, dt_bias=None, initial_states=None, seq_idx=Non | CODE |
| LOW | mamba_ssm/ops/triton/ssd_combined.py | 687 | def ssd_chunk_scan_combined_ref(x, dt, A, B, C, chunk_size, D=None, z=None, dt_bias=None, dt_softplus=False): | CODE |
| LOW | mamba_ssm/ops/triton/mamba3/mamba3_mimo_rotary_step.py | 16 | def rotary_qk_inference_kernel( | CODE |
| LOW | mamba_ssm/ops/triton/mamba3/mamba3_mimo_rotary_step.py | 151 | def apply_rotary_qk_inference_fwd( | CODE |
| LOW | mamba_ssm/ops/triton/mamba3/mamba3_mimo_rotary_step.py | 239 | def apply_rotary_qk_inference_reference( | CODE |
| LOW | mamba_ssm/ops/triton/mamba3/mamba3_mimo_rotary_step.py | 327 | def test_correctness_qk_inference(): | CODE |
| LOW⚡ | mamba_ssm/ops/triton/mamba3/mamba3_mimo_utils.py | 1413 | def test_bwd_ddt_fused_correctness(): | CODE |
| LOW | mamba_ssm/ops/triton/mamba3/mamba3_mimo_utils.py | 72 | def bwd_dadt_cumsum_fused_kernel( | CODE |
| LOW | mamba_ssm/ops/triton/mamba3/mamba3_mimo_utils.py | 369 | def dacs_segsum_kernel_varlen( | CODE |
| LOW | mamba_ssm/ops/triton/mamba3/mamba3_mimo_utils.py | 610 | def compute_dacs_segsum_triton_varlen( | CODE |
| LOW | mamba_ssm/ops/triton/mamba3/mamba3_mimo_utils.py | 691 | def compute_dacs_segsum_triton( | CODE |
| LOW | mamba_ssm/ops/triton/mamba3/mamba3_mimo_utils.py | 852 | def compute_dacs_segsum_ref_varlen( | CODE |
| LOW | mamba_ssm/ops/triton/mamba3/mamba3_mimo_utils.py | 907 | def bwd_dadt_fused_varlen_ref( | CODE |
| LOW | mamba_ssm/ops/triton/mamba3/mamba3_mimo_utils.py | 959 | def compute_dtrap_ddt_varlen_ref( | CODE |
| LOW | mamba_ssm/ops/triton/mamba3/mamba3_mimo_utils.py | 1020 | def bwd_dadt_cumsum_fused_kernel_varlen( | CODE |
| LOW | mamba_ssm/ops/triton/mamba3/mamba3_mimo_utils.py | 1089 | def bwd_segsum_dadt_kernel_varlen( | CODE |
| LOW | mamba_ssm/ops/triton/mamba3/mamba3_mimo_utils.py | 1160 | def bwd_dtrap_ddt_kernel_varlen( | CODE |
| LOW | mamba_ssm/ops/triton/mamba3/mamba3_mimo_utils.py | 1255 | def _build_varlen_chunk_mapping(cu_seqlens: torch.Tensor, chunk_size: int): | CODE |
| LOW | mamba_ssm/ops/triton/mamba3/mamba3_mimo_utils.py | 1311 | def bwd_dadt_fused_triton_varlen( | CODE |
| LOW | mamba_ssm/ops/triton/mamba3/mamba3_mimo_utils.py | 1367 | def bwd_dtrap_ddt_triton_varlen( | CODE |
| LOW | mamba_ssm/ops/triton/mamba3/mamba3_mimo_utils.py | 1458 | def test_dtrap_ddt_correctness(): | CODE |
| 15 more matches not shown… | ||||
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | tests/ops/tilelang/test_mamba3_mimo.py | 131 | CODE | |
| LOW | tests/ops/tilelang/test_mamba3_mimo.py | 200 | CODE | |
| LOW | tests/ops/tilelang/test_mamba3_mimo.py | 487 | CODE | |
| LOW | mamba_ssm/utils/generation.py | 121 | CODE | |
| LOW | mamba_ssm/models/mixer_seq_simple.py | 30 | CODE | |
| LOW | mamba_ssm/models/mixer_seq_simple.py | 125 | CODE | |
| LOW | mamba_ssm/ops/selective_scan_interface.py | 386 | CODE | |
| LOW | mamba_ssm/ops/selective_scan_interface.py | 200 | CODE | |
| LOW | mamba_ssm/ops/triton/ssd_combined.py | 343 | CODE | |
| LOW | mamba_ssm/ops/triton/ssd_combined.py | 397 | CODE | |
| LOW | mamba_ssm/ops/triton/ssd_combined.py | 628 | CODE | |
| LOW | mamba_ssm/ops/triton/ssd_combined.py | 684 | CODE | |
| LOW | mamba_ssm/ops/triton/ssd_combined.py | 725 | CODE | |
| LOW | mamba_ssm/ops/triton/ssd_combined.py | 779 | CODE | |
| LOW | mamba_ssm/ops/triton/ssd_combined.py | 983 | CODE | |
| LOW | mamba_ssm/ops/triton/ssd_combined.py | 1006 | CODE | |
| LOW | mamba_ssm/ops/triton/ssd_combined.py | 599 | CODE | |
| LOW | mamba_ssm/ops/triton/ssd_combined.py | 824 | CODE | |
| LOW | mamba_ssm/ops/triton/layer_norm.py | 22 | CODE | |
| LOW | mamba_ssm/ops/triton/layer_norm.py | 77 | CODE | |
| LOW | mamba_ssm/ops/triton/layer_norm.py | 291 | CODE | |
| LOW | mamba_ssm/ops/triton/layer_norm.py | 589 | CODE | |
| LOW | mamba_ssm/ops/triton/layer_norm.py | 888 | CODE | |
| LOW | mamba_ssm/ops/triton/layer_norm.py | 922 | CODE | |
| LOW | mamba_ssm/ops/triton/layer_norm.py | 730 | CODE | |
| LOW | mamba_ssm/ops/tilelang/mamba3/mamba3_mimo_fwd.py | 38 | CODE | |
| LOW | mamba_ssm/ops/tilelang/mamba3/mamba3_mimo_fwd_varlen.py | 59 | CODE | |
| LOW | mamba_ssm/ops/tilelang/mamba3/mamba3_mimo_bwd.py | 48 | CODE | |
| LOW | mamba_ssm/ops/tilelang/mamba3/mamba3_mimo_bwd.py | 1343 | CODE | |
| LOW | mamba_ssm/ops/tilelang/mamba3/mamba3_mimo_bwd_varlen.py | 65 | CODE | |
| LOW | mamba_ssm/ops/tilelang/mamba3/mamba3_mimo_bwd_varlen.py | 693 | CODE | |
| LOW | mamba_ssm/ops/tilelang/mamba3/mamba3_mimo_bwd_varlen.py | 1388 | CODE | |
| LOW | mamba_ssm/modules/mamba_simple.py | 32 | CODE | |
| LOW | mamba_ssm/modules/mamba2.py | 38 | CODE | |
| LOW | mamba_ssm/modules/mamba3.py | 44 | CODE | |
| LOW | mamba_ssm/modules/mamba3.py | 278 | CODE | |
| LOW | mamba_ssm/modules/mamba2_simple.py | 25 | CODE | |
| LOW | mamba_ssm/modules/mha.py | 47 | CODE | |
| LOW | mamba_ssm/modules/mha.py | 294 | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | setup.py | 279 | CODE | |
| LOW | tests/test_determinism.py | 85 | CODE | |
| LOW | tests/ops/tilelang/test_mamba3_mimo.py | 487 | CODE | |
| LOW | mamba_ssm/utils/generation.py | 83 | CODE | |
| LOW | mamba_ssm/models/mixer_seq_simple.py | 92 | CODE | |
| LOW | mamba_ssm/ops/cute/mamba3/mamba3_step_fn.py | 227 | CODE | |
| LOW | mamba_ssm/ops/triton/mamba3/mamba3_mimo_rotary_step.py | 327 | CODE | |
| LOW | mamba_ssm/ops/tilelang/mamba3/mamba3_mimo_fwd.py | 38 | CODE | |
| LOW | mamba_ssm/ops/tilelang/mamba3/mamba3_mimo_fwd.py | 467 | CODE | |
| LOW | mamba_ssm/ops/tilelang/mamba3/mamba3_mimo_fwd.py | 72 | CODE | |
| LOW | mamba_ssm/ops/tilelang/mamba3/mamba3_mimo_fwd_varlen.py | 59 | CODE | |
| LOW | mamba_ssm/ops/tilelang/mamba3/mamba3_mimo_fwd_varlen.py | 585 | CODE | |
| LOW | mamba_ssm/ops/tilelang/mamba3/mamba3_mimo_fwd_varlen.py | 132 | CODE | |
| LOW | mamba_ssm/ops/tilelang/mamba3/mamba3_mimo_bwd.py | 48 | CODE | |
| LOW | mamba_ssm/ops/tilelang/mamba3/mamba3_mimo_bwd.py | 665 | CODE | |
| LOW | mamba_ssm/ops/tilelang/mamba3/mamba3_mimo_bwd.py | 1343 | CODE | |
| LOW | mamba_ssm/ops/tilelang/mamba3/mamba3_mimo_bwd.py | 84 | CODE | |
| LOW | mamba_ssm/ops/tilelang/mamba3/mamba3_mimo_bwd.py | 701 | CODE | |
| LOW | mamba_ssm/ops/tilelang/mamba3/mamba3_mimo_bwd_varlen.py | 65 | CODE | |
| LOW | mamba_ssm/ops/tilelang/mamba3/mamba3_mimo_bwd_varlen.py | 693 | CODE | |
| LOW | mamba_ssm/ops/tilelang/mamba3/mamba3_mimo_bwd_varlen.py | 1388 | CODE | |
| LOW | mamba_ssm/ops/tilelang/mamba3/mamba3_mimo_bwd_varlen.py | 119 | CODE | |
| LOW | mamba_ssm/ops/tilelang/mamba3/mamba3_mimo_bwd_varlen.py | 746 | CODE | |
| LOW | mamba_ssm/modules/mha.py | 201 | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| HIGH | mamba_ssm/ops/triton/mamba3/mamba3_siso_fwd.py | 0 | custom allocator for tma descriptor global memory allocation. | STRING |
| HIGH | mamba_ssm/ops/triton/mamba3/mamba3_siso_step.py | 0 | custom allocator for tma descriptor global memory allocation. | STRING |
| HIGH | mamba_ssm/ops/triton/mamba3/mamba3_siso_bwd.py | 0 | custom allocator for tma descriptor global memory allocation. | STRING |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| HIGH | mamba_ssm/ops/triton/mamba3/mamba3_siso_combined.py | 308 | Mamba-3 attention with Triton kernels and automatic differentiation. This is the main entry point for Mamba-3 forwa | STRING |
| HIGH | mamba_ssm/ops/triton/mamba3/mamba3_siso_fwd.py | 458 | Mamba-3 forward pass wrapper. Args: Q: Query tensor (batch, seqlen, nheads_qk, headdim | STRING |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | csrc/selective_scan/static_switch.h | 1 | // Inspired by https://github.com/NVIDIA/DALI/blob/main/include/dali/core/static_switch.h | COMMENT |
| LOW | tests/ops/test_selective_scan.py | 241 | # assert torch.allclose(A.grad, A_ref.grad, rtol=rtolw, atol=atolw * 5) | COMMENT |
| LOW | mamba_ssm/ops/triton/ssd_chunk_scan.py | 261 | # cb = tl.load(cb_ptrs, mask=(offs_m[:, None] < chunk_size) & (offs_m[None, :] < chunk_size), other=0.0).to(tl.float | COMMENT |
| LOW | mamba_ssm/ops/triton/ssd_chunk_scan.py | 761 | # triton.Config({'BLOCK_SIZE_M': 32}, num_stages=3, num_warps=4), | COMMENT |
| LOW | mamba_ssm/ops/triton/ssd_chunk_scan.py | 1061 | # dout = tl.load(dout_ptrs, mask=(offs_m[:, None] < chunk_size_limit) & (offs_k[None, :] < hdim), other=0.0) | COMMENT |
| LOW | mamba_ssm/ops/triton/ssd_chunk_scan.py | 1141 | dA_cs_m = tl.load(dA_cumsum_ptr + offs_m * stride_dA_cs_csize, mask=offs_m < chunk_size, other=0.0).to(tl.float32) | COMMENT |
| LOW | mamba_ssm/ops/triton/ssd_combined.py | 481 | dB, ddA_next = _chunk_state_bwd_db(x, dt, dA_cumsum, dstates, seq_idx=seq_idx, B=B, ngroups=ngroups) | COMMENT |
| LOW | mamba_ssm/ops/tilelang/mamba3/mamba3_mimo_fwd.py | 241 | T.copy(T.view(k_frag, shape=[fused_chunk_size, N]), k_shared) | COMMENT |
| LOW | mamba_ssm/ops/tilelang/mamba3/mamba3_mimo_fwd_varlen.py | 341 | T.copy(T.view(k_frag, shape=[fused_chunk_size, N]), k_shared) | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW⚡ | mamba_ssm/ops/triton/mamba3/mamba3_siso_combined.py | 191 | # Step 1: Compute dZ and scale grad_out if Z gating is present | COMMENT |
| LOW⚡ | mamba_ssm/ops/triton/mamba3/mamba3_siso_combined.py | 200 | # Step 2: Compute main gradients (dQ_mid, dK_mid, dV, dADT, dQK_dot, dD, dInput_SSM_State) | COMMENT |
| LOW | mamba_ssm/ops/triton/mamba3/mamba3_siso_combined.py | 218 | # Step 3: Compute gradients through rotary embeddings and biases | COMMENT |
| LOW | mamba_ssm/ops/triton/mamba3/mamba3_siso_combined.py | 235 | # Step 4: Compute dDT, dTrap, and input state gradients | COMMENT |
| LOW | mamba_ssm/ops/triton/mamba3/mamba3_siso_combined.py | 247 | # Step 5: Compute gradients through angle_dt cumsum | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW⚡ | mamba_ssm/ops/triton/mamba3/mamba3_siso_combined.py | 191 | # Step 1: Compute dZ and scale grad_out if Z gating is present | COMMENT |
| LOW⚡ | mamba_ssm/ops/triton/mamba3/mamba3_siso_combined.py | 200 | # Step 2: Compute main gradients (dQ_mid, dK_mid, dV, dADT, dQK_dot, dD, dInput_SSM_State) | COMMENT |
| LOW | mamba_ssm/ops/triton/mamba3/mamba3_siso_combined.py | 218 | # Step 3: Compute gradients through rotary embeddings and biases | COMMENT |
| LOW | mamba_ssm/ops/triton/mamba3/mamba3_siso_combined.py | 235 | # Step 4: Compute dDT, dTrap, and input state gradients | COMMENT |
| LOW | mamba_ssm/ops/triton/mamba3/mamba3_siso_combined.py | 247 | # Step 5: Compute gradients through angle_dt cumsum | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | mamba_ssm/distributed/tensor_parallel.py | 217 | # Create a mask of valid vocab ids (1 means it needs to be masked). | COMMENT |
| MEDIUM | mamba_ssm/models/mixer_seq_simple.py | 52 | # Create a copy of the config to modify | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | mamba_ssm/utils/hf.py | 20 | CODE | |
| MEDIUM | mamba_ssm/utils/hf.py | 22 | CODE | |
| MEDIUM | mamba_ssm/utils/hf.py | 23 | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | setup.py | 80 | except Exception as e: | CODE |
| LOW | mamba_ssm/ops/triton/mamba3/mamba3_siso_combined.py | 29 | except Exception: | CODE |
| LOW | mamba_ssm/ops/triton/mamba3/mamba3_siso_combined.py | 79 | except Exception: | CODE |
| LOW | mamba_ssm/ops/triton/mamba3/mamba3_siso_combined.py | 165 | except Exception: | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | mamba_ssm/ops/selective_scan_interface.py | 82 | # Here we just pass in None and dz will be allocated in the C++ code. | COMMENT |
| LOW | mamba_ssm/ops/triton/ssd_combined.py | 583 | # Here we just pass in None and dz will be allocated in the C++ code. | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | tests/test_determinism.py | 9 | def _set_deterministic(enabled: bool) -> None: | CODE |
| LOW | tests/test_determinism.py | 15 | def _set_seeds(seed: int) -> None: | CODE |