Repository Analysis

state-spaces/mamba

Mamba SSM architecture

21.1 Moderate AI signal View on GitHub

Analysis Overview

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).

21.1
Adjusted Score
21.1
Raw Score
100%
Time Factor
2026-07-07
Last Push
18.6K
Stars
Python
Language
30.2K
Lines of Code
85
Files
394
Pattern Hits
2026-07-14
Scan Date
0.06
HC Hit Rate

What These Metrics Mean

Adjusted Score
Primary synthetic code indicator. Raw score normalised per 1,000 lines of code and multiplied by the temporal discount factor. This is the definitive comparative metric — use it to rank repositories by AI authorship density.
Raw Score
The unmodified sum of all severity-weighted, context-multiplied pattern match scores before temporal discounting. Reflects the absolute signal strength independent of when the repository was last active.
Time Factor
The temporal discount multiplier (0–100%) applied to the raw score. Repositories last updated before ChatGPT's launch (Nov 2022) receive a 5% factor. Full signal is only assigned to repositories active in the post-adoption era (Jan 2024+).
Pattern Hits
Total count of individual pattern matches across all files and categories. A high hit count with a low score may indicate a very large codebase with isolated AI snippets; a low count with a high score indicates dense, concentrated AI signatures.
HC Hit Rate
High+Critical pattern hits per file, averaged across the repository. This orthogonal signal catches repositories where a few files are densely packed with high-severity AI tells — a strong indicator even when the normalised score appears moderate due to codebase size.
Lines of Code / Files
Total lines and files analysed. The scanner examines 94 file extensions. These denominators are used to normalise the score, enabling fair comparison between repositories of vastly different sizes.

Score History

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.

Severity Breakdown

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.

CRITICAL 0HIGH 5MEDIUM 121LOW 268

Directory Score Breakdown

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.

Pattern Findings

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.

Decorative Section Separators116 hits · 332 pts
SeverityFileLineSnippetContext
MEDIUMtests/ops/triton/test_mamba3_siso.py342# ==================================================================COMMENT
MEDIUMtests/ops/triton/test_mamba3_siso.py344# ==================================================================COMMENT
MEDIUMtests/ops/triton/test_mamba3_siso.py483# ==================================================================COMMENT
MEDIUMtests/ops/triton/test_mamba3_siso.py485# ==================================================================COMMENT
MEDIUMtests/ops/triton/test_mamba3_siso.py553# ==================================================================COMMENT
MEDIUMtests/ops/triton/test_mamba3_siso.py555# ==================================================================COMMENT
MEDIUMtests/ops/triton/test_mamba3_siso.py667# ==================================================================COMMENT
MEDIUMtests/ops/triton/test_mamba3_siso.py669# ==================================================================COMMENT
MEDIUMtests/ops/triton/test_mamba3_siso.py839# ==================================================================COMMENT
MEDIUMtests/ops/triton/test_mamba3_siso.py841# ==================================================================COMMENT
MEDIUMtests/ops/tilelang/test_mamba3_mimo.py1727# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/ops/tilelang/test_mamba3_mimo.py1729# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/ops/tilelang/test_mamba3_mimo.py2032# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/ops/tilelang/test_mamba3_mimo.py2034# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/ops/tilelang/test_mamba3_mimo.py2046# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/ops/tilelang/test_mamba3_mimo.py2048# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/ops/tilelang/test_mamba3_mimo.py2152# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/ops/tilelang/test_mamba3_mimo.py2154# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/modules/test_mamba3_varlen.py21# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/modules/test_mamba3_varlen.py23# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/modules/test_mamba3_varlen.py55# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/modules/test_mamba3_varlen.py57# ---------------------------------------------------------------------------COMMENT
MEDIUMmamba_ssm/ops/cute/mamba3/mamba3_step_fn.py845 # =========================================================================COMMENT
MEDIUMmamba_ssm/ops/cute/mamba3/mamba3_step_fn.py847 # =========================================================================COMMENT
MEDIUMmamba_ssm/ops/cute/mamba3/mamba3_step_fn.py879 # =========================================================================COMMENT
MEDIUMmamba_ssm/ops/cute/mamba3/mamba3_step_fn.py881 # =========================================================================COMMENT
MEDIUMmamba_ssm/ops/cute/mamba3/mamba3_step_fn.py915 # =========================================================================COMMENT
MEDIUMmamba_ssm/ops/cute/mamba3/mamba3_step_fn.py917 # =========================================================================COMMENT
MEDIUMmamba_ssm/ops/triton/mamba3/angle_dt.py11# -----------------------------------------------------------------------------COMMENT
MEDIUMmamba_ssm/ops/triton/mamba3/angle_dt.py13# -----------------------------------------------------------------------------COMMENT
MEDIUMmamba_ssm/ops/triton/mamba3/angle_dt.py219# -----------------------------------------------------------------------------COMMENT
MEDIUMmamba_ssm/ops/triton/mamba3/angle_dt.py221# -----------------------------------------------------------------------------COMMENT
MEDIUMmamba_ssm/ops/triton/mamba3/mamba3_mimo_utils.py1409# ============================================================================COMMENT
MEDIUMmamba_ssm/ops/triton/mamba3/mamba3_mimo_utils.py1411# ============================================================================COMMENT
MEDIUMmamba_ssm/ops/triton/mamba3/mamba3_mimo_utils.py56# ============================================================================COMMENT
MEDIUMmamba_ssm/ops/triton/mamba3/mamba3_mimo_utils.py60# ============================================================================COMMENT
MEDIUMmamba_ssm/ops/triton/mamba3/mamba3_mimo_utils.py131# ============================================================================COMMENT
MEDIUMmamba_ssm/ops/triton/mamba3/mamba3_mimo_utils.py135# ============================================================================COMMENT
MEDIUMmamba_ssm/ops/triton/mamba3/mamba3_mimo_utils.py220# ============================================================================COMMENT
MEDIUMmamba_ssm/ops/triton/mamba3/mamba3_mimo_utils.py224# ============================================================================COMMENT
MEDIUMmamba_ssm/ops/triton/mamba3/mamba3_mimo_utils.py354# ============================================================================COMMENT
MEDIUMmamba_ssm/ops/triton/mamba3/mamba3_mimo_utils.py358# ============================================================================COMMENT
MEDIUMmamba_ssm/ops/triton/mamba3/mamba3_mimo_utils.py440# ============================================================================COMMENT
MEDIUMmamba_ssm/ops/triton/mamba3/mamba3_mimo_utils.py442# ============================================================================COMMENT
MEDIUMmamba_ssm/ops/triton/mamba3/mamba3_mimo_utils.py516# ============================================================================COMMENT
MEDIUMmamba_ssm/ops/triton/mamba3/mamba3_mimo_utils.py518# ============================================================================COMMENT
MEDIUMmamba_ssm/ops/triton/mamba3/mamba3_mimo_utils.py725# ============================================================================COMMENT
MEDIUMmamba_ssm/ops/triton/mamba3/mamba3_mimo_utils.py732# ============================================================================COMMENT
MEDIUMmamba_ssm/ops/triton/mamba3/mamba3_mimo_utils.py1005# ============================================================================COMMENT
MEDIUMmamba_ssm/ops/triton/mamba3/mamba3_mimo_utils.py1008# ============================================================================COMMENT
MEDIUMmamba_ssm/ops/triton/mamba3/mamba3_mimo_utils.py1700# ============================================================================COMMENT
MEDIUMmamba_ssm/ops/triton/mamba3/mamba3_mimo_utils.py1702# ============================================================================COMMENT
MEDIUMmamba_ssm/ops/triton/mamba3/mamba3_mimo_utils.py1844# ============================================================================COMMENT
MEDIUMmamba_ssm/ops/triton/mamba3/mamba3_mimo_utils.py1846# ============================================================================COMMENT
MEDIUMmamba_ssm/ops/triton/mamba3/mamba3_siso_bwd.py396 # ============================================================COMMENT
MEDIUMmamba_ssm/ops/triton/mamba3/mamba3_siso_bwd.py399 # ============================================================COMMENT
MEDIUMmamba_ssm/ops/triton/mamba3/mamba3_siso_bwd.py406 # ============================================================COMMENT
MEDIUMmamba_ssm/ops/triton/mamba3/mamba3_siso_bwd.py408 # ============================================================COMMENT
MEDIUMmamba_ssm/ops/triton/mamba3/mamba3_siso_bwd.py415 # ============================================================COMMENT
MEDIUMmamba_ssm/ops/triton/mamba3/mamba3_siso_bwd.py417 # ============================================================COMMENT
56 more matches not shown…
Unused Imports103 hits · 101 pts
SeverityFileLineSnippetContext
LOWtests/test_generation.py8CODE
LOWtests/test_generation.py10CODE
LOWtests/ops/test_selective_scan.py3CODE
LOWtests/ops/test_selective_scan.py6CODE
LOWtests/ops/test_selective_scan.py9CODE
LOWtests/ops/cute/test_mamba3_mimo_step.py15CODE
LOWtests/ops/cute/test_mamba3_mimo_step.py18CODE
LOWtests/ops/triton/test_ssd.py1CODE
LOWtests/ops/triton/test_ssd.py8CODE
LOWtests/ops/triton/test_ssd.py10CODE
LOWtests/ops/triton/test_ssd.py13CODE
LOWtests/ops/triton/test_ssd.py13CODE
LOWtests/ops/triton/test_ssd.py15CODE
LOWtests/ops/triton/test_ssd.py15CODE
LOWtests/ops/triton/test_ssd.py16CODE
LOWtests/ops/triton/test_ssd.py16CODE
LOWtests/ops/triton/test_ssd.py16CODE
LOWtests/ops/triton/test_ssd.py16CODE
LOWtests/ops/triton/test_ssd.py17CODE
LOWtests/ops/triton/test_ssd.py17CODE
LOWtests/ops/triton/test_mamba3_siso.py11CODE
LOWtests/ops/triton/test_mamba3_siso.py14CODE
LOWtests/ops/triton/test_layernorm_gated.py1CODE
LOWtests/ops/triton/test_layernorm_gated.py8CODE
LOWtests/ops/triton/test_selective_state_update.py3CODE
LOWtests/ops/triton/test_selective_state_update.py6CODE
LOWtests/ops/triton/test_selective_state_update.py9CODE
LOWtests/ops/tilelang/test_mamba3_mimo.py28CODE
LOWtests/ops/tilelang/test_mamba3_mimo.py29CODE
LOWbenchmarks/benchmark_generation_mamba_simple.py5CODE
LOWbenchmarks/benchmark_generation_mamba_simple.py8CODE
LOWbenchmarks/benchmark_generation_mamba_simple.py10CODE
LOWmamba_ssm/__init__.py3CODE
LOWmamba_ssm/__init__.py3CODE
LOWmamba_ssm/__init__.py4CODE
LOWmamba_ssm/__init__.py5CODE
LOWmamba_ssm/__init__.py6CODE
LOWmamba_ssm/__init__.py7CODE
LOWmamba_ssm/distributed/distributed_utils.py1CODE
LOWmamba_ssm/utils/generation.py3CODE
LOWmamba_ssm/utils/generation.py4CODE
LOWmamba_ssm/utils/generation.py6CODE
LOWmamba_ssm/utils/generation.py7CODE
LOWmamba_ssm/utils/generation.py7CODE
LOWmamba_ssm/utils/generation.py10CODE
LOWmamba_ssm/utils/generation.py11CODE
LOWmamba_ssm/utils/generation.py11CODE
LOWmamba_ssm/utils/generation.py13CODE
LOWmamba_ssm/utils/generation.py13CODE
LOWmamba_ssm/utils/generation.py13CODE
LOWmamba_ssm/utils/torch.py2CODE
LOWmamba_ssm/ops/cute/mamba3/mamba3_step_fn.py6CODE
LOWmamba_ssm/ops/cute/mamba3/mamba3_step_fn.py16CODE
LOWmamba_ssm/ops/cute/mamba3/mamba3_step_fn.py16CODE
LOWmamba_ssm/ops/cute/mamba3/mamba3_step_fn.py16CODE
LOWmamba_ssm/ops/triton/selective_state_update.py6CODE
LOWmamba_ssm/ops/triton/ssd_state_passing.py6CODE
LOWmamba_ssm/ops/triton/ssd_state_passing.py13CODE
LOWmamba_ssm/ops/triton/ssd_combined.py6CODE
LOWmamba_ssm/ops/triton/ssd_combined.py13CODE
43 more matches not shown…
Hyper-Verbose Identifiers75 hits · 69 pts
SeverityFileLineSnippetContext
LOWsetup.py62def get_cuda_bare_metal_version(cuda_dir):CODE
LOWtests/test_determinism.py194def test_combined_kernel_reproducible(case: str, d_has_hdim: bool, headdim: int, dstate: int):CODE
LOWtests/test_determinism.py202def test_kernel_close_to_default(case: str, headdim: int, dstate: int):CODE
LOWtests/test_determinism.py210def test_combined_kernel_close_to_default(case: str, d_has_hdim: bool, headdim: int, dstate: int):CODE
LOWtests/test_determinism.py215def test_default_mode_is_not_reproducible():CODE
LOWtests/test_generation.py115def test_generation_varlen_with_padding():CODE
LOWtests/ops/cute/test_mamba3_mimo_step.py55def _require_cuda_and_kernel_deps() -> None:CODE
LOWtests/ops/triton/test_selective_state_update.py22def test_selective_state_update(dim, dstate, has_z, itype):CODE
LOWtests/ops/triton/test_selective_state_update.py66def test_selective_state_update_with_heads(dim, dstate, ngroups, has_z, tie_hdim, itype):CODE
LOWtests/ops/triton/test_selective_state_update.py112def test_selective_state_update_with_batch_indices(dim, dstate, has_z, itype):CODE
LOWtests/ops/triton/test_selective_state_update.py161def test_selective_state_update_with_heads_with_batch_indices(dim, dstate, ngroups, has_z, tie_hdim, itype):CODE
LOWtests/ops/tilelang/test_mamba3_mimo.py71def _require_cuda_and_kernel_deps() -> None:CODE
LOWtests/ops/tilelang/test_mamba3_mimo.py628 def apply_rotary_emb_rotate_half(tensor: Tensor, cos: Tensor, sin: Tensor) -> Tensor:CODE
LOWtests/ops/tilelang/test_mamba3_mimo.py1596def test_mamba_mimo_smoke_forward_backward(mods: SimpleNamespace) -> None:CODE
LOWtests/ops/tilelang/test_mamba3_mimo.py1640def test_mamba_mimo_smoke_forward_backward_varlen(mods: SimpleNamespace) -> None:CODE
LOWmamba_ssm/distributed/distributed_utils.py120def allreduce_sequence_parallel_grad(model: torch.nn.Module, process_group: ProcessGroup):CODE
LOWmamba_ssm/utils/generation.py37def modify_logits_for_min_p_filtering(logits, min_p):CODE
LOWmamba_ssm/utils/generation.py45def modify_logits_for_top_k_filtering(logits, top_k):CODE
LOWmamba_ssm/utils/generation.py53def modify_logits_for_top_p_filtering(logits, top_p):CODE
LOWmamba_ssm/utils/generation.py69def modify_logit_for_repetition_penalty(logits, prev_output_tokens, repetition_penalty=1.0):CODE
LOWmamba_ssm/utils/determinism.py44def _filter_configs_by_block_sizes(configs):CODE
LOWmamba_ssm/ops/selective_scan_interface.py26def _check_selective_scan_cuda():CODE
LOWmamba_ssm/ops/triton/ssd_chunk_scan.py195def _chunk_scan_fwd_kernel_wip(CODE
LOWmamba_ssm/ops/triton/ssd_chunk_scan.py349def _chunk_scan_bwd_dz_kernel(CODE
LOWmamba_ssm/ops/triton/ssd_chunk_scan.py449def _chunk_scan_bwd_dstates_kernel(CODE
LOWmamba_ssm/ops/triton/ssd_chunk_scan.py530def _chunk_scan_bwd_dc_kernel(CODE
LOWmamba_ssm/ops/triton/ssd_chunk_scan.py641def _chunk_scan_bwd_dx_kernel(CODE
LOWmamba_ssm/ops/triton/ssd_chunk_scan.py774def _chunk_scan_bwd_dcb_kernel(CODE
LOWmamba_ssm/ops/triton/ssd_chunk_state.py286def _chunk_state_bwd_dx_kernel(CODE
LOWmamba_ssm/ops/triton/ssd_chunk_state.py398def _chunk_state_bwd_db_kernel(CODE
LOWmamba_ssm/ops/triton/ssd_chunk_state.py640def _chunk_state_varlen_kernel(CODE
LOWmamba_ssm/ops/triton/selective_state_update.py24def _selective_scan_update_kernel(CODE
LOWmamba_ssm/ops/triton/selective_state_update.py224def selective_state_update_ref(state, x, dt, A, B, C, D=None, z=None, dt_bias=None, dt_softplus=False):CODE
LOWmamba_ssm/ops/triton/ssd_state_passing.py30def _state_passing_fwd_kernel(CODE
LOWmamba_ssm/ops/triton/ssd_state_passing.py102def _state_passing_bwd_kernel(CODE
LOWmamba_ssm/ops/triton/ssd_combined.py93def _chunk_scan_chunk_state_bwd_dx_kernel(CODE
LOWmamba_ssm/ops/triton/ssd_combined.py262def _chunk_scan_chunk_state_bwd_dx(x, dt, dA_cumsum, B, CB, dout, dstates, D=None, seq_idx=None, dx=None):CODE
LOWmamba_ssm/ops/triton/ssd_combined.py343def _mamba_chunk_scan_combined_fwd(x, dt, A, B, C, chunk_size, D=None, z=None, dt_bias=None, initial_states=None, seq_idCODE
LOWmamba_ssm/ops/triton/ssd_combined.py397def _mamba_chunk_scan_combined_bwd(dout, x, dt, A, B, C, out, chunk_size, D=None, z=None,CODE
LOWmamba_ssm/ops/triton/ssd_combined.py628def mamba_chunk_scan_combined(x, dt, A, B, C, chunk_size, D=None, z=None, dt_bias=None, initial_states=None, seq_idx=NonCODE
LOWmamba_ssm/ops/triton/ssd_combined.py687def ssd_chunk_scan_combined_ref(x, dt, A, B, C, chunk_size, D=None, z=None, dt_bias=None, dt_softplus=False):CODE
LOWmamba_ssm/ops/triton/mamba3/mamba3_mimo_rotary_step.py16def rotary_qk_inference_kernel(CODE
LOWmamba_ssm/ops/triton/mamba3/mamba3_mimo_rotary_step.py151def apply_rotary_qk_inference_fwd(CODE
LOWmamba_ssm/ops/triton/mamba3/mamba3_mimo_rotary_step.py239def apply_rotary_qk_inference_reference(CODE
LOWmamba_ssm/ops/triton/mamba3/mamba3_mimo_rotary_step.py327def test_correctness_qk_inference():CODE
LOWmamba_ssm/ops/triton/mamba3/mamba3_mimo_utils.py1413def test_bwd_ddt_fused_correctness():CODE
LOWmamba_ssm/ops/triton/mamba3/mamba3_mimo_utils.py72def bwd_dadt_cumsum_fused_kernel(CODE
LOWmamba_ssm/ops/triton/mamba3/mamba3_mimo_utils.py369def dacs_segsum_kernel_varlen(CODE
LOWmamba_ssm/ops/triton/mamba3/mamba3_mimo_utils.py610def compute_dacs_segsum_triton_varlen(CODE
LOWmamba_ssm/ops/triton/mamba3/mamba3_mimo_utils.py691def compute_dacs_segsum_triton(CODE
LOWmamba_ssm/ops/triton/mamba3/mamba3_mimo_utils.py852def compute_dacs_segsum_ref_varlen(CODE
LOWmamba_ssm/ops/triton/mamba3/mamba3_mimo_utils.py907def bwd_dadt_fused_varlen_ref(CODE
LOWmamba_ssm/ops/triton/mamba3/mamba3_mimo_utils.py959def compute_dtrap_ddt_varlen_ref(CODE
LOWmamba_ssm/ops/triton/mamba3/mamba3_mimo_utils.py1020def bwd_dadt_cumsum_fused_kernel_varlen(CODE
LOWmamba_ssm/ops/triton/mamba3/mamba3_mimo_utils.py1089def bwd_segsum_dadt_kernel_varlen(CODE
LOWmamba_ssm/ops/triton/mamba3/mamba3_mimo_utils.py1160def bwd_dtrap_ddt_kernel_varlen(CODE
LOWmamba_ssm/ops/triton/mamba3/mamba3_mimo_utils.py1255def _build_varlen_chunk_mapping(cu_seqlens: torch.Tensor, chunk_size: int):CODE
LOWmamba_ssm/ops/triton/mamba3/mamba3_mimo_utils.py1311def bwd_dadt_fused_triton_varlen(CODE
LOWmamba_ssm/ops/triton/mamba3/mamba3_mimo_utils.py1367def bwd_dtrap_ddt_triton_varlen(CODE
LOWmamba_ssm/ops/triton/mamba3/mamba3_mimo_utils.py1458def test_dtrap_ddt_correctness():CODE
15 more matches not shown…
AI Structural Patterns39 hits · 38 pts
SeverityFileLineSnippetContext
LOWtests/ops/tilelang/test_mamba3_mimo.py131CODE
LOWtests/ops/tilelang/test_mamba3_mimo.py200CODE
LOWtests/ops/tilelang/test_mamba3_mimo.py487CODE
LOWmamba_ssm/utils/generation.py121CODE
LOWmamba_ssm/models/mixer_seq_simple.py30CODE
LOWmamba_ssm/models/mixer_seq_simple.py125CODE
LOWmamba_ssm/ops/selective_scan_interface.py386CODE
LOWmamba_ssm/ops/selective_scan_interface.py200CODE
LOWmamba_ssm/ops/triton/ssd_combined.py343CODE
LOWmamba_ssm/ops/triton/ssd_combined.py397CODE
LOWmamba_ssm/ops/triton/ssd_combined.py628CODE
LOWmamba_ssm/ops/triton/ssd_combined.py684CODE
LOWmamba_ssm/ops/triton/ssd_combined.py725CODE
LOWmamba_ssm/ops/triton/ssd_combined.py779CODE
LOWmamba_ssm/ops/triton/ssd_combined.py983CODE
LOWmamba_ssm/ops/triton/ssd_combined.py1006CODE
LOWmamba_ssm/ops/triton/ssd_combined.py599CODE
LOWmamba_ssm/ops/triton/ssd_combined.py824CODE
LOWmamba_ssm/ops/triton/layer_norm.py22CODE
LOWmamba_ssm/ops/triton/layer_norm.py77CODE
LOWmamba_ssm/ops/triton/layer_norm.py291CODE
LOWmamba_ssm/ops/triton/layer_norm.py589CODE
LOWmamba_ssm/ops/triton/layer_norm.py888CODE
LOWmamba_ssm/ops/triton/layer_norm.py922CODE
LOWmamba_ssm/ops/triton/layer_norm.py730CODE
LOWmamba_ssm/ops/tilelang/mamba3/mamba3_mimo_fwd.py38CODE
LOWmamba_ssm/ops/tilelang/mamba3/mamba3_mimo_fwd_varlen.py59CODE
LOWmamba_ssm/ops/tilelang/mamba3/mamba3_mimo_bwd.py48CODE
LOWmamba_ssm/ops/tilelang/mamba3/mamba3_mimo_bwd.py1343CODE
LOWmamba_ssm/ops/tilelang/mamba3/mamba3_mimo_bwd_varlen.py65CODE
LOWmamba_ssm/ops/tilelang/mamba3/mamba3_mimo_bwd_varlen.py693CODE
LOWmamba_ssm/ops/tilelang/mamba3/mamba3_mimo_bwd_varlen.py1388CODE
LOWmamba_ssm/modules/mamba_simple.py32CODE
LOWmamba_ssm/modules/mamba2.py38CODE
LOWmamba_ssm/modules/mamba3.py44CODE
LOWmamba_ssm/modules/mamba3.py278CODE
LOWmamba_ssm/modules/mamba2_simple.py25CODE
LOWmamba_ssm/modules/mha.py47CODE
LOWmamba_ssm/modules/mha.py294CODE
Deep Nesting24 hits · 24 pts
SeverityFileLineSnippetContext
LOWsetup.py279CODE
LOWtests/test_determinism.py85CODE
LOWtests/ops/tilelang/test_mamba3_mimo.py487CODE
LOWmamba_ssm/utils/generation.py83CODE
LOWmamba_ssm/models/mixer_seq_simple.py92CODE
LOWmamba_ssm/ops/cute/mamba3/mamba3_step_fn.py227CODE
LOWmamba_ssm/ops/triton/mamba3/mamba3_mimo_rotary_step.py327CODE
LOWmamba_ssm/ops/tilelang/mamba3/mamba3_mimo_fwd.py38CODE
LOWmamba_ssm/ops/tilelang/mamba3/mamba3_mimo_fwd.py467CODE
LOWmamba_ssm/ops/tilelang/mamba3/mamba3_mimo_fwd.py72CODE
LOWmamba_ssm/ops/tilelang/mamba3/mamba3_mimo_fwd_varlen.py59CODE
LOWmamba_ssm/ops/tilelang/mamba3/mamba3_mimo_fwd_varlen.py585CODE
LOWmamba_ssm/ops/tilelang/mamba3/mamba3_mimo_fwd_varlen.py132CODE
LOWmamba_ssm/ops/tilelang/mamba3/mamba3_mimo_bwd.py48CODE
LOWmamba_ssm/ops/tilelang/mamba3/mamba3_mimo_bwd.py665CODE
LOWmamba_ssm/ops/tilelang/mamba3/mamba3_mimo_bwd.py1343CODE
LOWmamba_ssm/ops/tilelang/mamba3/mamba3_mimo_bwd.py84CODE
LOWmamba_ssm/ops/tilelang/mamba3/mamba3_mimo_bwd.py701CODE
LOWmamba_ssm/ops/tilelang/mamba3/mamba3_mimo_bwd_varlen.py65CODE
LOWmamba_ssm/ops/tilelang/mamba3/mamba3_mimo_bwd_varlen.py693CODE
LOWmamba_ssm/ops/tilelang/mamba3/mamba3_mimo_bwd_varlen.py1388CODE
LOWmamba_ssm/ops/tilelang/mamba3/mamba3_mimo_bwd_varlen.py119CODE
LOWmamba_ssm/ops/tilelang/mamba3/mamba3_mimo_bwd_varlen.py746CODE
LOWmamba_ssm/modules/mha.py201CODE
Cross-File Repetition3 hits · 15 pts
SeverityFileLineSnippetContext
HIGHmamba_ssm/ops/triton/mamba3/mamba3_siso_fwd.py0custom allocator for tma descriptor global memory allocation.STRING
HIGHmamba_ssm/ops/triton/mamba3/mamba3_siso_step.py0custom allocator for tma descriptor global memory allocation.STRING
HIGHmamba_ssm/ops/triton/mamba3/mamba3_siso_bwd.py0custom allocator for tma descriptor global memory allocation.STRING
Docstring Block Structure2 hits · 10 pts
SeverityFileLineSnippetContext
HIGHmamba_ssm/ops/triton/mamba3/mamba3_siso_combined.py308Mamba-3 attention with Triton kernels and automatic differentiation. This is the main entry point for Mamba-3 forwaSTRING
HIGHmamba_ssm/ops/triton/mamba3/mamba3_siso_fwd.py458 Mamba-3 forward pass wrapper. Args: Q: Query tensor (batch, seqlen, nheads_qk, headdimSTRING
Over-Commented Block9 hits · 9 pts
SeverityFileLineSnippetContext
LOWcsrc/selective_scan/static_switch.h1// Inspired by https://github.com/NVIDIA/DALI/blob/main/include/dali/core/static_switch.hCOMMENT
LOWtests/ops/test_selective_scan.py241 # assert torch.allclose(A.grad, A_ref.grad, rtol=rtolw, atol=atolw * 5)COMMENT
LOWmamba_ssm/ops/triton/ssd_chunk_scan.py261 # cb = tl.load(cb_ptrs, mask=(offs_m[:, None] < chunk_size) & (offs_m[None, :] < chunk_size), other=0.0).to(tl.floatCOMMENT
LOWmamba_ssm/ops/triton/ssd_chunk_scan.py761 # triton.Config({'BLOCK_SIZE_M': 32}, num_stages=3, num_warps=4),COMMENT
LOWmamba_ssm/ops/triton/ssd_chunk_scan.py1061 # dout = tl.load(dout_ptrs, mask=(offs_m[:, None] < chunk_size_limit) & (offs_k[None, :] < hdim), other=0.0)COMMENT
LOWmamba_ssm/ops/triton/ssd_chunk_scan.py1141 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
LOWmamba_ssm/ops/triton/ssd_combined.py481 dB, ddA_next = _chunk_state_bwd_db(x, dt, dA_cumsum, dstates, seq_idx=seq_idx, B=B, ngroups=ngroups)COMMENT
LOWmamba_ssm/ops/tilelang/mamba3/mamba3_mimo_fwd.py241 T.copy(T.view(k_frag, shape=[fused_chunk_size, N]), k_shared)COMMENT
LOWmamba_ssm/ops/tilelang/mamba3/mamba3_mimo_fwd_varlen.py341 T.copy(T.view(k_frag, shape=[fused_chunk_size, N]), k_shared)COMMENT
Verbosity Indicators5 hits · 9 pts
SeverityFileLineSnippetContext
LOWmamba_ssm/ops/triton/mamba3/mamba3_siso_combined.py191 # Step 1: Compute dZ and scale grad_out if Z gating is presentCOMMENT
LOWmamba_ssm/ops/triton/mamba3/mamba3_siso_combined.py200 # Step 2: Compute main gradients (dQ_mid, dK_mid, dV, dADT, dQK_dot, dD, dInput_SSM_State)COMMENT
LOWmamba_ssm/ops/triton/mamba3/mamba3_siso_combined.py218 # Step 3: Compute gradients through rotary embeddings and biasesCOMMENT
LOWmamba_ssm/ops/triton/mamba3/mamba3_siso_combined.py235 # Step 4: Compute dDT, dTrap, and input state gradientsCOMMENT
LOWmamba_ssm/ops/triton/mamba3/mamba3_siso_combined.py247 # Step 5: Compute gradients through angle_dt cumsumCOMMENT
Structural Annotation Overuse5 hits · 9 pts
SeverityFileLineSnippetContext
LOWmamba_ssm/ops/triton/mamba3/mamba3_siso_combined.py191 # Step 1: Compute dZ and scale grad_out if Z gating is presentCOMMENT
LOWmamba_ssm/ops/triton/mamba3/mamba3_siso_combined.py200 # Step 2: Compute main gradients (dQ_mid, dK_mid, dV, dADT, dQK_dot, dD, dInput_SSM_State)COMMENT
LOWmamba_ssm/ops/triton/mamba3/mamba3_siso_combined.py218 # Step 3: Compute gradients through rotary embeddings and biasesCOMMENT
LOWmamba_ssm/ops/triton/mamba3/mamba3_siso_combined.py235 # Step 4: Compute dDT, dTrap, and input state gradientsCOMMENT
LOWmamba_ssm/ops/triton/mamba3/mamba3_siso_combined.py247 # Step 5: Compute gradients through angle_dt cumsumCOMMENT
Self-Referential Comments2 hits · 6 pts
SeverityFileLineSnippetContext
MEDIUMmamba_ssm/distributed/tensor_parallel.py217 # Create a mask of valid vocab ids (1 means it needs to be masked).COMMENT
MEDIUMmamba_ssm/models/mixer_seq_simple.py52 # Create a copy of the config to modifyCOMMENT
Dead Code3 hits · 6 pts
SeverityFileLineSnippetContext
MEDIUMmamba_ssm/utils/hf.py20CODE
MEDIUMmamba_ssm/utils/hf.py22CODE
MEDIUMmamba_ssm/utils/hf.py23CODE
Excessive Try-Catch Wrapping4 hits · 4 pts
SeverityFileLineSnippetContext
LOWsetup.py80 except Exception as e:CODE
LOWmamba_ssm/ops/triton/mamba3/mamba3_siso_combined.py29except Exception:CODE
LOWmamba_ssm/ops/triton/mamba3/mamba3_siso_combined.py79 except Exception:CODE
LOWmamba_ssm/ops/triton/mamba3/mamba3_siso_combined.py165 except Exception:CODE
AI Slop Vocabulary2 hits · 3 pts
SeverityFileLineSnippetContext
LOWmamba_ssm/ops/selective_scan_interface.py82 # Here we just pass in None and dz will be allocated in the C++ code.COMMENT
LOWmamba_ssm/ops/triton/ssd_combined.py583 # Here we just pass in None and dz will be allocated in the C++ code.COMMENT
Modern Structural Boilerplate2 hits · 2 pts
SeverityFileLineSnippetContext
LOWtests/test_determinism.py9def _set_deterministic(enabled: bool) -> None:CODE
LOWtests/test_determinism.py15def _set_seeds(seed: int) -> None:CODE