DeepGEMM: clean and efficient BLAS kernel library on GPU
This report summarizes scanner evidence for deepseek-ai/DeepGEMM, a Cuda project with 8,926 GitHub stars. SynthScan examined 19,045 lines of code across 99 source files, recording 211 pattern matches distributed across 10 syntactic categories. The legacy adjusted pattern signal is 9.9 (Moderate 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? 88 finding(s).
Are imports declared and package/API names verified? 114 finding(s).
Are wrappers, guards, and repeated structures necessary? 51 finding(s).
Which changes need focused human review? 211 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 211 distinct pattern matches across 10 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 |
|---|---|---|---|---|
| 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 | 17 | CODE | |
| LOW | deep_gemm/__init__.py | 31 | CODE | |
| LOW | deep_gemm/__init__.py | 31 | CODE | |
| LOW | deep_gemm/__init__.py | 31 | CODE | |
| LOW | deep_gemm/__init__.py | 31 | CODE | |
| LOW | deep_gemm/__init__.py | 31 | CODE | |
| LOW | deep_gemm/__init__.py | 31 | CODE | |
| LOW | deep_gemm/__init__.py | 31 | CODE | |
| LOW | deep_gemm/__init__.py | 39 | CODE | |
| LOW | deep_gemm/__init__.py | 39 | CODE | |
| LOW | deep_gemm/__init__.py | 39 | CODE | |
| LOW | deep_gemm/__init__.py | 39 | CODE | |
| LOW | deep_gemm/__init__.py | 39 | CODE | |
| LOW | deep_gemm/__init__.py | 39 | CODE | |
| LOW | deep_gemm/__init__.py | 39 | CODE | |
| LOW | deep_gemm/__init__.py | 39 | CODE | |
| LOW | deep_gemm/__init__.py | 39 | CODE | |
| LOW | deep_gemm/__init__.py | 39 | CODE | |
| LOW | deep_gemm/__init__.py | 39 | CODE | |
| LOW | deep_gemm/__init__.py | 39 | CODE | |
| LOW | deep_gemm/__init__.py | 39 | CODE | |
| LOW | deep_gemm/__init__.py | 39 | CODE | |
| LOW | deep_gemm/__init__.py | 39 | CODE | |
| LOW | deep_gemm/__init__.py | 39 | CODE | |
| LOW | deep_gemm/__init__.py | 39 | CODE | |
| LOW | deep_gemm/__init__.py | 39 | CODE | |
| LOW | deep_gemm/__init__.py | 39 | CODE | |
| LOW | deep_gemm/__init__.py | 39 | CODE | |
| LOW | deep_gemm/__init__.py | 39 | CODE | |
| LOW | deep_gemm/__init__.py | 39 | CODE | |
| LOW | deep_gemm/__init__.py | 39 | CODE | |
| LOW | deep_gemm/__init__.py | 39 | CODE | |
| LOW | deep_gemm/__init__.py | 39 | CODE | |
| LOW | deep_gemm/__init__.py | 39 | CODE | |
| LOW | deep_gemm/__init__.py | 39 | CODE | |
| LOW | deep_gemm/__init__.py | 39 | CODE | |
| LOW | deep_gemm/__init__.py | 39 | CODE | |
| LOW | deep_gemm/__init__.py | 39 | CODE | |
| LOW | deep_gemm/__init__.py | 39 | CODE | |
| LOW | deep_gemm/__init__.py | 39 | CODE | |
| LOW | deep_gemm/__init__.py | 39 | CODE | |
| LOW | deep_gemm/__init__.py | 39 | CODE | |
| LOW | deep_gemm/__init__.py | 39 | CODE | |
| LOW | deep_gemm/__init__.py | 39 | CODE | |
| LOW | deep_gemm/__init__.py | 39 | CODE | |
| LOW | deep_gemm/__init__.py | 39 | CODE | |
| LOW | deep_gemm/__init__.py | 39 | CODE | |
| LOW | deep_gemm/__init__.py | 39 | CODE | |
| LOW | deep_gemm/__init__.py | 39 | CODE | |
| LOW | deep_gemm/__init__.py | 39 | CODE | |
| LOW | deep_gemm/__init__.py | 39 | CODE | |
| 54 more matches not shown… | ||||
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | deep_gemm/mega/__init__.py | 87 | def get_symm_buffer_for_mega_moe(group: dist.ProcessGroup, | CODE |
| LOW | deep_gemm/mega/__init__.py | 146 | def transform_weights_for_mega_moe( | CODE |
| LOW | tests/test_mega_moe.py | 36 | def _to_shared_mega_moe_sf_layout(sf: torch.Tensor, block_m: int, num_max_sf_tokens: int) -> torch.Tensor: | CODE |
| LOW | tests/test_lazy_init.py | 116 | def test_real_cublaslt_shutdown(self): | STRING |
| LOW | tests/test_lazy_init.py | 141 | def test_cuda_workspaces_are_released(self): | STRING |
| LOW | tests/test_mega_gate.py | 258 | def test_mega_gate_api_contract() -> None: | CODE |
| LOW | tests/generators.py | 176 | def enumerate_batched_syrk_symm() -> Generator: | CODE |
| LOW | tests/generators.py | 194 | def enumerate_m_grouped_contiguous(dtype: torch.dtype) -> Generator: | CODE |
| LOW | tests/generators.py | 213 | def enumerate_m_grouped_masked(dtype: torch.dtype) -> Generator: | CODE |
| LOW | tests/generators.py | 229 | def enumerate_k_grouped_contiguous(dtype: torch.dtype): | CODE |
| LOW | tests/generators.py | 265 | def enumerate_k_grouped_contiguous_test_variants(real_ks_cpu: List[int]): | CODE |
| LOW | tests/generators.py | 293 | def enumerate_k_grouped_sf_layout(): | CODE |
| LOW | tests/generators.py | 303 | def enumerate_k_grouped_psum_sf_layout(): | CODE |
| LOW | tests/generators.py | 378 | def generate_m_grouped_contiguous(num_groups: int, expected_m_per_group: int, n: int, k: int, | CODE |
| LOW | tests/generators.py | 434 | def masked_valid_mask_to_psum(masked_m: torch.Tensor, psum_m: torch.Tensor) -> torch.Tensor: | CODE |
| LOW | tests/generators.py | 446 | 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 | 542 | def build_psum_layout_from_ks(real_ks: List[int], k_alignment: int) -> List[int]: | CODE |
| LOW | tests/generators.py | 551 | def generate_k_grouped_contiguous(num_groups: int, m: int, n: int, major_a: MajorTypeAB, major_b: MajorTypeAB, logical_k | CODE |
| LOW | tests/test_fp8_fp4.py | 114 | def test_m_grouped_gemm_contiguous() -> None: | CODE |
| LOW | tests/test_fp8_fp4.py | 178 | def test_m_grouped_gemm_masked() -> None: | CODE |
| LOW | tests/test_fp8_fp4.py | 241 | def test_k_grouped_gemm_contiguous() -> None: | CODE |
| LOW | tests/test_attention.py | 304 | def enumerate_paged_mqa_logits(): | CODE |
| LOW | tests/test_attention.py | 442 | def make_sparse_kv_block_indices(context_lens: List[int], request_indices: List[int] | None, | CODE |
| LOW | tests/test_attention.py | 480 | def enumerate_sparse_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 | 69 | def test_m_grouped_gemm_contiguous() -> None: | CODE |
| LOW | tests/test_bf16.py | 111 | def test_m_grouped_gemm_masked() -> None: | CODE |
| LOW | tests/test_bf16.py | 158 | def test_k_grouped_gemm_contiguous() -> None: | CODE |
| LOW | tests/test_bf16.py | 247 | def test_cublaslt_batched_syrk() -> None: | CODE |
| LOW | tests/test_bf16.py | 283 | def test_cublaslt_batched_symm() -> None: | CODE |
| LOW | tests/test_layout.py | 83 | def test_k_grouped_sf_layout_kernels() -> None: | CODE |
| LOW | tests/test_layout.py | 118 | def test_k_grouped_psum_sf_layout_kernels() -> None: | CODE |
| LOW | tests/test_mega_mhc.py | 243 | def test_mega_mhc_api_contract() -> 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/test_lazy_init.py | 141 | CODE | |
| LOW | tests/generators.py | 122 | CODE | |
| LOW | tests/generators.py | 194 | CODE | |
| LOW | tests/generators.py | 213 | CODE | |
| LOW | tests/generators.py | 229 | CODE | |
| LOW | tests/generators.py | 276 | CODE | |
| LOW | tests/test_fp8_fp4.py | 26 | CODE | |
| LOW | tests/test_fp8_fp4.py | 241 | CODE | |
| LOW | tests/test_attention.py | 104 | CODE | |
| LOW | tests/test_attention.py | 299 | CODE | |
| LOW | tests/test_attention.py | 442 | CODE | |
| LOW | tests/test_attention.py | 477 | CODE | |
| LOW | tests/test_attention.py | 123 | CODE | |
| LOW | tests/test_attention.py | 304 | CODE | |
| LOW | tests/test_attention.py | 480 | CODE | |
| LOW | tests/test_legacy.py | 14 | CODE | |
| LOW | tests/test_bf16.py | 23 | CODE | |
| LOW | tests/test_bf16.py | 158 | CODE | |
| LOW | tests/test_bf16.py | 247 | CODE | |
| LOW | tests/test_bf16.py | 283 | CODE | |
| LOW | tests/test_einsum.py | 44 | CODE | |
| LOW | tests/test_einsum.py | 75 | CODE | |
| LOW | tests/test_einsum.py | 128 | CODE | |
| LOW | tests/test_mega_mhc.py | 320 | 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 | setup.py | 68 | except Exception: | CODE |
| LOW | deep_gemm/__init__.py | 118 | except Exception as e: | 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 |
|---|---|---|---|---|
| LOW | csrc/python_api.cpp | 1 | #include <pybind11/pybind11.h> | COMMENT |
| LOW | csrc/apis/einsum.hpp | 1 | #pragma once | COMMENT |
| LOW | csrc/runtime/runtime.hpp | 1 | #pragma once | COMMENT |
| LOW | csrc/utils/layout.hpp | 1 | #pragma once | COMMENT |
| LOW | csrc/jit_kernels/heuristics/mega_gate.hpp | 1 | #pragma once | COMMENT |
| LOW | csrc/jit_kernels/heuristics/mega_moe.hpp | 1 | #pragma once | COMMENT |
| LOW | csrc/jit_kernels/impls/epilogue_class.hpp | 1 | #pragma once | COMMENT |
| LOW | csrc/jit_kernels/impls/runtime_utils.hpp | 1 | #pragma once | COMMENT |
| 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 |
|---|---|---|---|---|
| HIGH | deep_gemm/__init__.py | 12 | except ImportError: | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | docs/scaling-factor-format.md | 411 | # Step 1: pack to the Section 3 int32 layout (mandatory; float32 SFs are rejected) | COMMENT |
| LOW | docs/scaling-factor-format.md | 414 | # Step 2: mega-MoE weight/SF shuffle (gate-up interleave + UTCCP SF transpose; mandatory) | 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 |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | tests/generators.py | 551 | CODE |