DeepGEMM: clean and efficient BLAS kernel library on GPU
This report presents the forensic synthetic code analysis of deepseek-ai/DeepGEMM, a Cuda project with 7,510 GitHub stars. SynthScan v2.0 examined 15,704 lines of code across 89 source files, recording 167 pattern matches distributed across 7 syntactic categories. The overall adjusted score of 9.7 places this repository in the Low 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 167 distinct pattern matches across 7 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 |
|---|---|---|---|---|
| LOW | deep_gemm/__init__.py | 3 | CODE | |
| LOW | deep_gemm/__init__.py | 17 | CODE | |
| LOW | deep_gemm/__init__.py | 17 | CODE | |
| LOW | deep_gemm/__init__.py | 17 | CODE | |
| LOW | deep_gemm/__init__.py | 17 | CODE | |
| LOW | deep_gemm/__init__.py | 17 | CODE | |
| LOW | deep_gemm/__init__.py | 17 | CODE | |
| LOW | deep_gemm/__init__.py | 17 | CODE | |
| LOW | deep_gemm/__init__.py | 17 | CODE | |
| LOW | deep_gemm/__init__.py | 29 | CODE | |
| LOW | deep_gemm/__init__.py | 29 | CODE | |
| LOW | deep_gemm/__init__.py | 29 | CODE | |
| LOW | deep_gemm/__init__.py | 29 | CODE | |
| LOW | deep_gemm/__init__.py | 84 | CODE | |
| LOW | deep_gemm/__init__.py | 84 | CODE | |
| LOW | deep_gemm/__init__.py | 84 | CODE | |
| LOW | deep_gemm/__init__.py | 84 | CODE | |
| LOW | deep_gemm/__init__.py | 84 | CODE | |
| LOW | deep_gemm/__init__.py | 93 | CODE | |
| LOW | deep_gemm/__init__.py | 94 | CODE | |
| LOW | deep_gemm/__init__.py | 95 | CODE | |
| LOW | deep_gemm/__init__.py | 36 | CODE | |
| LOW | deep_gemm/__init__.py | 36 | CODE | |
| LOW | deep_gemm/__init__.py | 36 | CODE | |
| LOW | deep_gemm/__init__.py | 36 | CODE | |
| LOW | deep_gemm/__init__.py | 36 | CODE | |
| LOW | deep_gemm/__init__.py | 36 | CODE | |
| LOW | deep_gemm/__init__.py | 36 | CODE | |
| LOW | deep_gemm/__init__.py | 36 | CODE | |
| LOW | deep_gemm/__init__.py | 36 | CODE | |
| LOW | deep_gemm/__init__.py | 36 | CODE | |
| LOW | deep_gemm/__init__.py | 36 | CODE | |
| LOW | deep_gemm/__init__.py | 36 | CODE | |
| LOW | deep_gemm/__init__.py | 36 | CODE | |
| LOW | deep_gemm/__init__.py | 36 | CODE | |
| LOW | deep_gemm/__init__.py | 36 | CODE | |
| LOW | deep_gemm/__init__.py | 36 | CODE | |
| LOW | deep_gemm/__init__.py | 36 | CODE | |
| LOW | deep_gemm/__init__.py | 36 | CODE | |
| LOW | deep_gemm/__init__.py | 36 | CODE | |
| LOW | deep_gemm/__init__.py | 36 | CODE | |
| LOW | deep_gemm/__init__.py | 36 | CODE | |
| LOW | deep_gemm/__init__.py | 36 | CODE | |
| LOW | deep_gemm/__init__.py | 36 | CODE | |
| LOW | deep_gemm/__init__.py | 36 | CODE | |
| LOW | deep_gemm/__init__.py | 36 | CODE | |
| LOW | deep_gemm/__init__.py | 36 | CODE | |
| LOW | deep_gemm/__init__.py | 36 | CODE | |
| LOW | deep_gemm/__init__.py | 36 | CODE | |
| LOW | deep_gemm/__init__.py | 36 | CODE | |
| LOW | deep_gemm/__init__.py | 36 | CODE | |
| LOW | deep_gemm/__init__.py | 36 | CODE | |
| LOW | deep_gemm/__init__.py | 36 | CODE | |
| LOW | deep_gemm/__init__.py | 99 | CODE | |
| LOW | deep_gemm/legacy/m_grouped_gemm.py | 4 | CODE | |
| LOW | deep_gemm/legacy/m_grouped_gemm.py | 6 | CODE | |
| LOW | deep_gemm/legacy/__init__.py | 2 | CODE | |
| LOW | deep_gemm/legacy/__init__.py | 3 | CODE | |
| LOW | deep_gemm/legacy/__init__.py | 4 | CODE | |
| LOW | deep_gemm/legacy/__init__.py | 5 | CODE | |
| 30 more matches not shown… | ||||
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | deep_gemm/mega/__init__.py | 68 | def get_symm_buffer_for_mega_moe(group: dist.ProcessGroup, | CODE |
| LOW | deep_gemm/mega/__init__.py | 133 | def transform_weights_for_mega_moe( | CODE |
| LOW | tests/generators.py | 157 | def enumerate_m_grouped_contiguous(dtype: torch.dtype) -> Generator: | CODE |
| LOW | tests/generators.py | 174 | def enumerate_m_grouped_masked(dtype: torch.dtype) -> Generator: | CODE |
| LOW | tests/generators.py | 190 | def enumerate_k_grouped_contiguous(dtype: torch.dtype): | CODE |
| LOW | tests/generators.py | 211 | def enumerate_k_grouped_contiguous_test_variants(real_ks_cpu: List[int], k_alignment: int, | CODE |
| LOW | tests/generators.py | 241 | def enumerate_k_grouped_sf_layout(): | CODE |
| LOW | tests/generators.py | 251 | def enumerate_k_grouped_psum_sf_layout(): | CODE |
| LOW | tests/generators.py | 327 | def generate_m_grouped_contiguous(num_groups: int, expected_m_per_group: int, n: int, k: int, | CODE |
| LOW | tests/generators.py | 380 | def generate_m_grouped_masked(num_groups: int, max_m: int, expected_m_per_group: int, n: int, k: int, | CODE |
| LOW | tests/generators.py | 436 | def generate_k_grouped_contiguous(num_groups: int, m: int, n: int, major_a: MajorTypeAB, major_b: MajorTypeAB, ks_cpu: L | CODE |
| LOW | tests/generators.py | 480 | def build_psum_layout_from_ks(real_ks: List[int], k_alignment: int) -> List[int]: | CODE |
| LOW | tests/generators.py | 490 | def generate_k_grouped_contiguous_psum(num_groups: int, m: int, n: int, | CODE |
| LOW | tests/test_fp8_fp4.py | 71 | def test_m_grouped_gemm_contiguous() -> None: | CODE |
| LOW | tests/test_fp8_fp4.py | 129 | def test_m_grouped_gemm_masked() -> None: | CODE |
| LOW | tests/test_fp8_fp4.py | 193 | def test_k_grouped_gemm_contiguous() -> None: | CODE |
| LOW | tests/test_attention.py | 279 | def reset_cuda_peak_memory_stats(): | CODE |
| LOW | tests/test_attention.py | 318 | def enumerate_paged_mqa_logits(): | CODE |
| LOW | tests/test_legacy.py | 14 | def test_m_grouped_gemm_contiguous_tl() -> None: | CODE |
| LOW | tests/test_legacy.py | 50 | def test_k_grouped_gemm_contiguous_tl() -> None: | CODE |
| LOW | tests/test_bf16.py | 64 | def test_m_grouped_gemm_contiguous() -> None: | CODE |
| LOW | tests/test_bf16.py | 114 | def test_m_grouped_gemm_masked() -> None: | CODE |
| LOW | tests/test_bf16.py | 171 | def test_k_grouped_gemm_contiguous() -> None: | CODE |
| LOW | tests/test_layout.py | 83 | def test_k_grouped_sf_layout_kernels() -> None: | CODE |
| LOW | tests/test_layout.py | 108 | def test_k_grouped_psum_sf_layout_kernels() -> None: | CODE |
| LOW | scripts/generate_pyi.py | 135 | def _in_top_level_of_other_brackets(self): | CODE |
| LOW | scripts/generate_pyi.py | 345 | def extract_cpp_signature_from_content(cpp_func_name, content): | CODE |
| LOW | scripts/generate_pyi.py | 389 | def parse_mdef_and_attach_cpp_signatures(item, func_index): | CODE |
| LOW | scripts/generate_pyi.py | 494 | def parse_parameter_declaration(decl: str): | CODE |
| LOW | scripts/generate_pyi.py | 581 | def extract_cpp_signature_details(item): | CODE |
| LOW | scripts/generate_pyi.py | 723 | def cpp_default_to_python_default(cpp_default: str): | CODE |
| LOW | scripts/generate_pyi.py | 828 | def generate_pyi_file_content(enhanced_results, module_name: str = 'my_module'): | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | deep_gemm/testing/bench.py | 79 | CODE | |
| LOW | tests/generators.py | 115 | CODE | |
| LOW | tests/generators.py | 157 | CODE | |
| LOW | tests/generators.py | 174 | CODE | |
| LOW | tests/generators.py | 229 | CODE | |
| LOW | tests/test_fp8_fp4.py | 71 | CODE | |
| LOW | tests/test_fp8_fp4.py | 129 | CODE | |
| LOW | tests/test_attention.py | 116 | CODE | |
| LOW | tests/test_attention.py | 291 | CODE | |
| LOW | tests/test_attention.py | 136 | CODE | |
| LOW | tests/test_attention.py | 318 | CODE | |
| LOW | tests/test_legacy.py | 14 | CODE | |
| LOW | tests/test_bf16.py | 64 | CODE | |
| LOW | tests/test_bf16.py | 114 | CODE | |
| LOW | scripts/generate_pyi.py | 5 | CODE | |
| LOW | scripts/generate_pyi.py | 151 | CODE | |
| LOW | scripts/generate_pyi.py | 225 | CODE | |
| LOW | scripts/generate_pyi.py | 345 | CODE | |
| LOW | scripts/generate_pyi.py | 828 | CODE | |
| LOW | scripts/generate_pyi.py | 112 | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | csrc/python_api.cpp | 1 | #include <pybind11/pybind11.h> | COMMENT |
| LOW | csrc/apis/einsum.hpp | 1 | #pragma once | COMMENT |
| LOW | csrc/apis/mega.hpp | 1 | #pragma once | COMMENT |
| LOW | csrc/apis/attention.hpp | 1 | #pragma once | COMMENT |
| LOW | csrc/apis/gemm.hpp | 1 | #pragma once | COMMENT |
| LOW | csrc/utils/system.hpp | 1 | #pragma once | COMMENT |
| LOW | csrc/utils/format.hpp | 1 | #pragma once | COMMENT |
| LOW | csrc/utils/compatibility.hpp | 1 | #pragma once | COMMENT |
| LOW | csrc/jit/compiler.hpp | 1 | #pragma once | COMMENT |
| LOW | csrc/jit_kernels/heuristics/mega_moe.hpp | 1 | #pragma once | COMMENT |
| LOW | csrc/jit_kernels/impls/sm100_fp8_fp4_gemm_1d1d.hpp | 1 | #pragma once | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | setup.py | 71 | except Exception: | CODE |
| LOW | deep_gemm/__init__.py | 100 | except Exception as e: | CODE |
| LOW | deep_gemm/__init__.py | 114 | except Exception: | CODE |
| LOW | deep_gemm/mega/__init__.py | 12 | except Exception as exception: | CODE |
| LOW | tests/test_mega_moe.py | 30 | except Exception as ex: | CODE |
| LOW | scripts/generate_pyi.py | 25 | except Exception as e: | CODE |
| LOW | scripts/generate_pyi.py | 170 | except Exception as e: | CODE |
| LOW | scripts/generate_pyi.py | 594 | except Exception as e: | CODE |
| LOW | scripts/generate_pyi.py | 846 | except Exception as e: | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | scripts/generate_pyi.py | 517 | # Instead of simple splitting, we'll use a more robust approach | COMMENT |
| LOW | scripts/generate_pyi.py | 523 | # No parameter name found, just return the type | COMMENT |
| LOW | scripts/generate_pyi.py | 574 | # Fallback: if we can't find a clear parameter name, just return the type | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | scripts/generate_pyi.py | 182 | # Check if it's a comment | COMMENT |
| LOW | scripts/generate_pyi.py | 549 | # Check if this might be part of a type keyword (like 'int', 'bool', etc.) | COMMENT |