Mamba SSM architecture
This report summarizes scanner evidence for state-spaces/mamba, a Python project with 18,898 GitHub stars. SynthScan examined 30,340 lines of code across 85 source files, recording 400 pattern matches distributed across 16 syntactic categories. The legacy adjusted pattern signal is 21.8 (Elevated pattern signal); it is not an authorship estimate.
Use the findings to ask whether maintainers can explain intent, verify dependencies, simplify unnecessary scaffolding, and focus review effort. Risk Payload v1 adds ownership, supply-chain, over-engineering, and review-effort vectors when available. These are prompts for human verification, not probabilities, security findings, or measured maintenance costs.
Use each vector to guide manual verification of the underlying findings.
Can maintainers explain intent, assumptions, and trade-offs? 163 finding(s).
Are imports declared and package/API names verified? 102 finding(s).
Are wrappers, guards, and repeated structures necessary? 249 finding(s).
Which changes need focused human review? 400 finding(s).
This chart tracks the legacy adjusted pattern score across scan runs. Changes can reflect source changes, scan coverage, or detector/scoring versions; they do not measure AI adoption or prove that a team refactored code. Compare runs only when their scoring versions are compatible. The dashed line tracks the raw pattern-hit count.
Groups findings by configured severity weight. Severity is not a confidence estimate, security rating, or proof that a package is missing. Verify imports against the project's manifests and inspect each finding in its local design context.
This horizontal bar chart shows where configured pattern scores accumulate across directories. Treat the bars as locations to inspect, not as evidence of authorship or code quality. Use the file-level findings to decide whether a directory needs a focused ownership, dependency, complexity, or review check.
The scanner identified 400 distinct pattern matches across 16 syntactic categories. Each entry below represents a discrete location in the source code where the engine recorded a detector match to inspect in context. 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 configured finding weight (CRITICAL / HIGH / MEDIUM / LOW). The Context column identifies whether the match occurred inside executable code, an inline comment, or a string literal — legacy comment-context matches receive a ×1.5 score weight. The ⚡ bolt icon marks clustered matches: three or more patterns within a 10-line window, each receiving an additional ×1.5 density multiplier under the legacy scoring model.
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | tests/ops/triton/test_mamba3_siso.py | 343 | # ================================================================== | COMMENT |
| MEDIUM | tests/ops/triton/test_mamba3_siso.py | 345 | # ================================================================== | COMMENT |
| MEDIUM | tests/ops/triton/test_mamba3_siso.py | 484 | # ================================================================== | COMMENT |
| MEDIUM | tests/ops/triton/test_mamba3_siso.py | 486 | # ================================================================== | COMMENT |
| MEDIUM | tests/ops/triton/test_mamba3_siso.py | 554 | # ================================================================== | COMMENT |
| MEDIUM | tests/ops/triton/test_mamba3_siso.py | 556 | # ================================================================== | COMMENT |
| MEDIUM | tests/ops/triton/test_mamba3_siso.py | 668 | # ================================================================== | COMMENT |
| MEDIUM | tests/ops/triton/test_mamba3_siso.py | 670 | # ================================================================== | COMMENT |
| MEDIUM | tests/ops/triton/test_mamba3_siso.py | 840 | # ================================================================== | COMMENT |
| MEDIUM | tests/ops/triton/test_mamba3_siso.py | 842 | # ================================================================== | COMMENT |
| MEDIUM | tests/ops/triton/test_mamba3_siso.py | 902 | # ================================================================== | COMMENT |
| MEDIUM | tests/ops/triton/test_mamba3_siso.py | 904 | # ================================================================== | COMMENT |
| MEDIUM | tests/ops/triton/test_mamba3_siso.py | 944 | # ================================================================== | COMMENT |
| MEDIUM | tests/ops/triton/test_mamba3_siso.py | 946 | # ================================================================== | 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 |
| 60 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 | 15 | 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 | |
| LOW | mamba_ssm/ops/triton/ssd_combined.py | 33 | CODE | |
| 42 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_combined.py | 29 | except Exception: | CODE |
| HIGH | mamba_ssm/ops/triton/mamba3/mamba3_siso_combined.py | 79 | except Exception: | CODE |
| HIGH | mamba_ssm/ops/triton/mamba3/mamba3_siso_combined.py | 165 | except Exception: | 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 | 477 | 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 |