A Flexible Framework for Experiencing Heterogeneous LLM Inference/Fine-tune Optimizations
This report presents the forensic synthetic code analysis of kvcache-ai/ktransformers, a Python project with 17,432 GitHub stars. SynthScan v2.0 examined 377,740 lines of code across 1222 source files, recording 3690 pattern matches distributed across 24 syntactic categories. The overall adjusted score of 15.8 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 3690 distinct pattern matches across 24 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 |
|---|---|---|---|---|
| HIGH | archive/merge_tensors/merge_safetensor_gguf.py | 0 | :param folder_path: folder path :return: key_to_file_map | STRING |
| HIGH | archive/kt-sft/merge_tensors/merge_safetensor_gguf.py | 0 | :param folder_path: folder path :return: key_to_file_map | STRING |
| HIGH | kt-kernel/scripts/check.py | 0 | :param folder_path: folder path :return: key_to_file_map | STRING |
| HIGH | archive/merge_tensors/merge_safetensor_gguf.py | 0 | # :param name: name of the tensor # :return: translated name # | STRING |
| HIGH | archive/kt-sft/merge_tensors/merge_safetensor_gguf.py | 0 | # :param name: name of the tensor # :return: translated name # | STRING |
| HIGH | kt-kernel/scripts/check.py | 0 | # :param name: name of the tensor # :return: translated name # | STRING |
| HIGH | archive/csrc/ktransformers_ext/bench/bench_moe_torch.py | 0 | description : author : chenht2022 date : 2024-07-25 10:32:05 version : 1.0.0 lasteditors : chenht2022 lastedittime : 202 | STRING |
| HIGH | …kt-sft/csrc/ktransformers_ext/bench/bench_moe_torch.py | 0 | description : author : chenht2022 date : 2024-07-25 10:32:05 version : 1.0.0 lasteditors : chenht2022 lastedittime : 202 | STRING |
| HIGH | archive/csrc/ktransformers_ext/bench/bench_moe.py | 0 | description : author : chenht2022 date : 2024-07-25 10:32:05 version : 1.0.0 lasteditors : chenht2022 lastedittime : 202 | STRING |
| HIGH | …chive/kt-sft/csrc/ktransformers_ext/bench/bench_moe.py | 0 | description : author : chenht2022 date : 2024-07-25 10:32:05 version : 1.0.0 lasteditors : chenht2022 lastedittime : 202 | STRING |
| HIGH | kt-kernel/bench/bench_moe_kernel.py | 0 | description : author : chenht2022 date : 2024-07-25 10:32:05 version : 1.0.0 lasteditors : chenht2022 lastedittime : 202 | STRING |
| HIGH | kt-kernel/bench/bench_moe_amx.py | 0 | description : author : chenht2022 date : 2024-07-25 10:32:05 version : 1.0.0 lasteditors : chenht2022 lastedittime : 202 | STRING |
| HIGH | kt-kernel/bench/bench_moe_amx_k.py | 0 | description : author : chenht2022 date : 2024-07-25 10:32:05 version : 1.0.0 lasteditors : chenht2022 lastedittime : 202 | STRING |
| HIGH | kt-kernel/bench/bench_moe_kml.py | 0 | description : author : chenht2022 date : 2024-07-25 10:32:05 version : 1.0.0 lasteditors : chenht2022 lastedittime : 202 | STRING |
| HIGH | archive/csrc/ktransformers_ext/examples/test_mlp.py | 0 | description : author : chenht2022 date : 2024-07-25 10:32:05 version : 1.0.0 lasteditors : chenht2022 lastedittime : 202 | STRING |
| HIGH | …ive/kt-sft/csrc/ktransformers_ext/examples/test_mlp.py | 0 | description : author : chenht2022 date : 2024-07-25 10:32:05 version : 1.0.0 lasteditors : chenht2022 lastedittime : 202 | STRING |
| HIGH | kt-kernel/examples/test_mlp.py | 0 | description : author : chenht2022 date : 2024-07-25 10:32:05 version : 1.0.0 lasteditors : chenht2022 lastedittime : 202 | STRING |
| HIGH | archive/csrc/ktransformers_ext/examples/test_moe.py | 0 | description : author : chenht2022 date : 2024-07-25 10:32:05 version : 1.0.0 lasteditors : chenht2022 lastedittime : 202 | STRING |
| HIGH | …ft/csrc/ktransformers_ext/examples/test_sft_amx_moe.py | 0 | description : author : chenht2022 date : 2024-07-25 10:32:05 version : 1.0.0 lasteditors : chenht2022 lastedittime : 202 | STRING |
| HIGH | …ive/kt-sft/csrc/ktransformers_ext/examples/test_moe.py | 0 | description : author : chenht2022 date : 2024-07-25 10:32:05 version : 1.0.0 lasteditors : chenht2022 lastedittime : 202 | STRING |
| HIGH | …kt-sft/csrc/ktransformers_ext/examples/test_sft_moe.py | 0 | description : author : chenht2022 date : 2024-07-25 10:32:05 version : 1.0.0 lasteditors : chenht2022 lastedittime : 202 | STRING |
| HIGH | kt-kernel/examples/test_moe_kernel.py | 0 | description : author : chenht2022 date : 2024-07-25 10:32:05 version : 1.0.0 lasteditors : chenht2022 lastedittime : 202 | STRING |
| HIGH | kt-kernel/examples/test_moe_kml.py | 0 | description : author : chenht2022 date : 2024-07-25 10:32:05 version : 1.0.0 lasteditors : chenht2022 lastedittime : 202 | STRING |
| HIGH | archive/csrc/ktransformers_ext/examples/test_linear.py | 0 | description : author : chenht2022 date : 2024-07-25 10:32:05 version : 1.0.0 lasteditors : chenht2022 lastedittime : 202 | STRING |
| HIGH | …/kt-sft/csrc/ktransformers_ext/examples/test_linear.py | 0 | description : author : chenht2022 date : 2024-07-25 10:32:05 version : 1.0.0 lasteditors : chenht2022 lastedittime : 202 | STRING |
| HIGH | kt-kernel/examples/test_linear.py | 0 | description : author : chenht2022 date : 2024-07-25 10:32:05 version : 1.0.0 lasteditors : chenht2022 lastedittime : 202 | STRING |
| HIGH | archive/csrc/ktransformers_ext/bench/bench_attention.py | 0 | description : author : jianwei dong date : 2024-08-28 10:32:05 version : 1.0.0 lasteditors : chenht2022 lastedittime : 2 | STRING |
| HIGH | …/csrc/ktransformers_ext/bench/bench_attention_torch.py | 0 | description : author : jianwei dong date : 2024-08-28 10:32:05 version : 1.0.0 lasteditors : chenht2022 lastedittime : 2 | STRING |
| HIGH | …kt-sft/csrc/ktransformers_ext/bench/bench_attention.py | 0 | description : author : jianwei dong date : 2024-08-28 10:32:05 version : 1.0.0 lasteditors : chenht2022 lastedittime : 2 | STRING |
| HIGH | …/csrc/ktransformers_ext/bench/bench_attention_torch.py | 0 | description : author : jianwei dong date : 2024-08-28 10:32:05 version : 1.0.0 lasteditors : chenht2022 lastedittime : 2 | STRING |
| HIGH | kt-kernel/bench/bench_attention.py | 0 | description : author : jianwei dong date : 2024-08-28 10:32:05 version : 1.0.0 lasteditors : chenht2022 lastedittime : 2 | STRING |
| HIGH | kt-kernel/bench/bench_attention_torch.py | 0 | description : author : jianwei dong date : 2024-08-28 10:32:05 version : 1.0.0 lasteditors : chenht2022 lastedittime : 2 | STRING |
| HIGH | …hive/csrc/ktransformers_ext/examples/test_attention.py | 0 | description : author : jianwei dong date : 2024-08-28 10:32:05 version : 1.0.0 lasteditors : chenht2022 lastedittime : 2 | STRING |
| HIGH | …-sft/csrc/ktransformers_ext/examples/test_attention.py | 0 | description : author : jianwei dong date : 2024-08-28 10:32:05 version : 1.0.0 lasteditors : chenht2022 lastedittime : 2 | STRING |
| HIGH | kt-kernel/examples/test_attention.py | 0 | description : author : jianwei dong date : 2024-08-28 10:32:05 version : 1.0.0 lasteditors : chenht2022 lastedittime : 2 | STRING |
| HIGH | archive/csrc/ktransformers_ext/bench/bench_mlp.py | 0 | description : author : chenht2022 date : 2024-07-16 10:43:18 version : 1.0.0 lasteditors : chenht2022 lastedittime : 202 | STRING |
| HIGH | …chive/kt-sft/csrc/ktransformers_ext/bench/bench_mlp.py | 0 | description : author : chenht2022 date : 2024-07-16 10:43:18 version : 1.0.0 lasteditors : chenht2022 lastedittime : 202 | STRING |
| HIGH | kt-kernel/bench/bench_mlp.py | 0 | description : author : chenht2022 date : 2024-07-16 10:43:18 version : 1.0.0 lasteditors : chenht2022 lastedittime : 202 | STRING |
| HIGH | archive/csrc/ktransformers_ext/bench/bench_linear.py | 0 | description : author : chenht2022 date : 2024-07-25 10:31:59 version : 1.0.0 lasteditors : chenht2022 lastedittime : 202 | STRING |
| HIGH | …ve/kt-sft/csrc/ktransformers_ext/bench/bench_linear.py | 0 | description : author : chenht2022 date : 2024-07-25 10:31:59 version : 1.0.0 lasteditors : chenht2022 lastedittime : 202 | STRING |
| HIGH | kt-kernel/bench/bench_linear.py | 0 | description : author : chenht2022 date : 2024-07-25 10:31:59 version : 1.0.0 lasteditors : chenht2022 lastedittime : 202 | STRING |
| HIGH | …ive/csrc/ktransformers_ext/bench/bench_linear_torch.py | 0 | description : author : chenht2022 date : 2024-07-25 10:31:59 version : 1.0.0 lasteditors : chenht2022 lastedittime : 202 | STRING |
| HIGH | …sft/csrc/ktransformers_ext/bench/bench_linear_torch.py | 0 | description : author : chenht2022 date : 2024-07-25 10:31:59 version : 1.0.0 lasteditors : chenht2022 lastedittime : 202 | STRING |
| HIGH | kt-kernel/bench/bench_linear_torch.py | 0 | description : author : chenht2022 date : 2024-07-25 10:31:59 version : 1.0.0 lasteditors : chenht2022 lastedittime : 202 | STRING |
| HIGH | archive/csrc/ktransformers_ext/bench/bench_mlp_torch.py | 0 | description : author : chenht2022 date : 2024-07-16 10:43:18 version : 1.0.0 lasteditors : chenht2022 lastedittime : 202 | STRING |
| HIGH | …kt-sft/csrc/ktransformers_ext/bench/bench_mlp_torch.py | 0 | description : author : chenht2022 date : 2024-07-16 10:43:18 version : 1.0.0 lasteditors : chenht2022 lastedittime : 202 | STRING |
| HIGH | kt-kernel/bench/bench_mlp_torch.py | 0 | description : author : chenht2022 date : 2024-07-16 10:43:18 version : 1.0.0 lasteditors : chenht2022 lastedittime : 202 | STRING |
| HIGH | archive/csrc/custom_marlin/utils/format24.py | 0 | class for creating n:m sparsity masks. masks will be created using the n:m ratio, where for every block of m weights, n | STRING |
| HIGH | archive/kt-sft/csrc/custom_marlin/utils/format24.py | 0 | class for creating n:m sparsity masks. masks will be created using the n:m ratio, where for every block of m weights, n | STRING |
| HIGH | …xt/operators/custom_marlin/quantize/utils/format_24.py | 0 | class for creating n:m sparsity masks. masks will be created using the n:m ratio, where for every block of m weights, n | STRING |
| HIGH | …xt/operators/custom_marlin/quantize/utils/format_24.py | 0 | class for creating n:m sparsity masks. masks will be created using the n:m ratio, where for every block of m weights, n | STRING |
| HIGH | archive/kt-sft/ktransformers/local_chat.py | 0 | description : author : boxin zhang, azure-tang version : 0.1.0 copyright (c) 2024 by kvcache.ai, all rights reserved. | STRING |
| HIGH | archive/kt-sft/ktransformers/optimize/optimize.py | 0 | description : author : boxin zhang, azure-tang version : 0.1.0 copyright (c) 2024 by kvcache.ai, all rights reserved. | STRING |
| HIGH | archive/kt-sft/ktransformers/util/utils.py | 0 | description : author : boxin zhang, azure-tang version : 0.1.0 copyright (c) 2024 by kvcache.ai, all rights reserved. | STRING |
| HIGH | archive/ktransformers/local_chat_test.py | 0 | description : author : boxin zhang, azure-tang version : 0.1.0 copyright (c) 2024 by kvcache.ai, all rights reserved. | STRING |
| HIGH | archive/ktransformers/local_chat.py | 0 | description : author : boxin zhang, azure-tang version : 0.1.0 copyright (c) 2024 by kvcache.ai, all rights reserved. | STRING |
| HIGH | archive/ktransformers/optimize/optimize.py | 0 | description : author : boxin zhang, azure-tang version : 0.1.0 copyright (c) 2024 by kvcache.ai, all rights reserved. | STRING |
| HIGH | archive/ktransformers/util/utils.py | 0 | description : author : boxin zhang, azure-tang version : 0.1.0 copyright (c) 2024 by kvcache.ai, all rights reserved. | STRING |
| HIGH | archive/kt-sft/ktransformers/local_chat.py | 0 | '): # end multi lines input line = line[:-3] # suffix | STRING |
| HIGH | archive/ktransformers/local_chat.py | 0 | '): # end multi lines input line = line[:-3] # suffix | STRING |
| 347 more matches not shown… | ||||
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | ktransformers.py | 8 | CODE | |
| LOW | ktransformers.py | 29 | CODE | |
| LOW | …chive/merge_tensors/merge_safetensor_gguf_for_qwen3.py | 18 | CODE | |
| LOW | archive/merge_tensors/merge_safetensor_gguf.py | 5 | CODE | |
| LOW | archive/csrc/ktransformers_ext/bench/bench_moe_torch.py | 12 | CODE | |
| LOW | archive/csrc/ktransformers_ext/bench/bench_moe_torch.py | 12 | CODE | |
| LOW | …ive/csrc/ktransformers_ext/bench/bench_linear_torch.py | 12 | CODE | |
| LOW | …ive/csrc/ktransformers_ext/bench/bench_linear_torch.py | 12 | CODE | |
| LOW | archive/csrc/ktransformers_ext/bench/bench_mlp_torch.py | 12 | CODE | |
| LOW | archive/csrc/ktransformers_ext/bench/bench_mlp_torch.py | 12 | CODE | |
| LOW | …/csrc/ktransformers_ext/bench/bench_attention_torch.py | 16 | CODE | |
| LOW | archive/csrc/ktransformers_ext/cuda/setup.py | 2 | CODE | |
| LOW | archive/csrc/ktransformers_ext/cuda/setup.py | 3 | CODE | |
| LOW | archive/csrc/ktransformers_ext/cuda/test_dequant.py | 1 | CODE | |
| LOW | archive/csrc/ktransformers_ext/examples/test_mlp.py | 13 | CODE | |
| LOW | archive/csrc/ktransformers_ext/examples/test_moe.py | 13 | CODE | |
| LOW | …hive/csrc/ktransformers_ext/examples/test_attention.py | 13 | CODE | |
| LOW | archive/csrc/ktransformers_ext/examples/test_linear.py | 13 | CODE | |
| LOW | archive/csrc/custom_marlin/setup.py | 1 | CODE | |
| LOW | archive/csrc/custom_marlin/setup.py | 2 | CODE | |
| LOW | archive/csrc/custom_marlin/test_cuda_graph.py | 1 | CODE | |
| LOW | archive/csrc/custom_marlin/test_cuda_graph.py | 6 | CODE | |
| LOW | archive/csrc/custom_marlin/utils/marlin_utils.py | 13 | CODE | |
| LOW | archive/kt-sft/withoutKT_PEFT.py | 2 | CODE | |
| LOW | archive/kt-sft/withoutKT_PEFT.py | 4 | CODE | |
| LOW | archive/kt-sft/withoutKT_PEFT.py | 9 | CODE | |
| LOW | archive/kt-sft/withoutKT_PEFT.py | 9 | CODE | |
| LOW | archive/kt-sft/merge_tensors/merge_safetensor_gguf.py | 5 | CODE | |
| LOW | …kt-sft/csrc/ktransformers_ext/bench/bench_moe_torch.py | 12 | CODE | |
| LOW | …kt-sft/csrc/ktransformers_ext/bench/bench_moe_torch.py | 12 | CODE | |
| LOW | …sft/csrc/ktransformers_ext/bench/bench_linear_torch.py | 12 | CODE | |
| LOW | …sft/csrc/ktransformers_ext/bench/bench_linear_torch.py | 12 | CODE | |
| LOW | …kt-sft/csrc/ktransformers_ext/bench/bench_mlp_torch.py | 12 | CODE | |
| LOW | …kt-sft/csrc/ktransformers_ext/bench/bench_mlp_torch.py | 12 | CODE | |
| LOW | …/csrc/ktransformers_ext/bench/bench_attention_torch.py | 16 | CODE | |
| LOW | archive/kt-sft/csrc/ktransformers_ext/cuda/setup.py | 2 | CODE | |
| LOW | archive/kt-sft/csrc/ktransformers_ext/cuda/setup.py | 3 | CODE | |
| LOW | …ive/kt-sft/csrc/ktransformers_ext/cuda/test_dequant.py | 1 | CODE | |
| LOW | …ive/kt-sft/csrc/ktransformers_ext/examples/test_mlp.py | 13 | CODE | |
| LOW | …ive/kt-sft/csrc/ktransformers_ext/examples/test_moe.py | 13 | CODE | |
| LOW | …-sft/csrc/ktransformers_ext/examples/test_attention.py | 13 | CODE | |
| LOW | …/kt-sft/csrc/ktransformers_ext/examples/test_linear.py | 13 | CODE | |
| LOW | archive/kt-sft/csrc/custom_marlin/setup.py | 1 | CODE | |
| LOW | archive/kt-sft/csrc/custom_marlin/setup.py | 2 | CODE | |
| LOW | archive/kt-sft/csrc/custom_marlin/test_cuda_graph.py | 1 | CODE | |
| LOW | archive/kt-sft/csrc/custom_marlin/test_cuda_graph.py | 6 | CODE | |
| LOW | archive/kt-sft/csrc/custom_marlin/utils/marlin_utils.py | 13 | CODE | |
| LOW | archive/kt-sft/ktransformers/moe_test_module.py | 2 | CODE | |
| LOW | archive/kt-sft/ktransformers/moe_test_module.py | 8 | CODE | |
| LOW | archive/kt-sft/ktransformers/moe_test_module.py | 9 | CODE | |
| LOW | archive/kt-sft/ktransformers/moe_test_module.py | 11 | CODE | |
| LOW | archive/kt-sft/ktransformers/moe_test_module.py | 11 | CODE | |
| LOW | archive/kt-sft/ktransformers/moe_test_module.py | 11 | CODE | |
| LOW | archive/kt-sft/ktransformers/moe_test_module.py | 11 | CODE | |
| LOW | archive/kt-sft/ktransformers/moe_test_module.py | 19 | CODE | |
| LOW | archive/kt-sft/ktransformers/moe_test_module.py | 21 | CODE | |
| LOW | archive/kt-sft/ktransformers/moe_test_module.py | 21 | CODE | |
| LOW | archive/kt-sft/ktransformers/moe_test_module.py | 22 | CODE | |
| LOW | archive/kt-sft/ktransformers/moe_test_module.py | 25 | CODE | |
| LOW | archive/kt-sft/ktransformers/__init__.py | 18 | CODE | |
| 860 more matches not shown… | ||||
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | docker/docker-utils.sh | 1 | #!/usr/bin/env bash | COMMENT |
| LOW | docker/docker-utils.sh | 161 | ################################################################################ | COMMENT |
| LOW | docker/build-docker-tar.sh | 1 | #!/usr/bin/env bash | COMMENT |
| LOW | docker/push-to-dockerhub.sh | 1 | #!/usr/bin/env bash | COMMENT |
| LOW | docker/push-to-dockerhub.sh | 581 | # - Automatic version detection | COMMENT |
| LOW | …chive/merge_tensors/merge_safetensor_gguf_for_qwen3.py | 1 | # coding=utf-8 | COMMENT |
| LOW | archive/csrc/ktransformers_ext/ext_bindings.cpp | 21 | #if defined(__x86_64__) && defined(__HAS_AVX512F__) && defined(__HAS_AMX__) | COMMENT |
| LOW | archive/csrc/ktransformers_ext/vendors/musa.h | 1 | #pragma once | COMMENT |
| LOW | archive/csrc/ktransformers_ext/vendors/musa.h | 21 | #define cublasDestroy mublasDestroy | COMMENT |
| LOW | archive/csrc/ktransformers_ext/vendors/musa.h | 41 | #define cudaEventCreateWithFlags musaEventCreateWithFlags | COMMENT |
| LOW | archive/csrc/ktransformers_ext/vendors/musa.h | 61 | #define cudaMallocManaged musaMallocManaged | COMMENT |
| LOW | archive/csrc/ktransformers_ext/vendors/musa.h | 81 | #define cudaStreamWaitEvent musaStreamWaitEvent | COMMENT |
| LOW | archive/csrc/ktransformers_ext/vendors/musa.h | 101 | #define cuMemGetAllocationGranularity muMemGetAllocationGranularity | COMMENT |
| LOW | archive/csrc/ktransformers_ext/vendors/musa.h | 121 | #define cudaGraphExecUpdate musaGraphExecUpdate | COMMENT |
| LOW | archive/csrc/ktransformers_ext/vendors/hip.h | 1 | #pragma once | COMMENT |
| LOW | archive/csrc/ktransformers_ext/vendors/hip.h | 21 | #define CUBLAS_TF32_TENSOR_OP_MATH 0 | COMMENT |
| LOW | archive/csrc/ktransformers_ext/vendors/hip.h | 41 | #define cublasSgemm hipblasSgemm | COMMENT |
| LOW | archive/csrc/ktransformers_ext/vendors/hip.h | 61 | #define cudaGetDevice hipGetDevice | COMMENT |
| LOW | archive/csrc/ktransformers_ext/vendors/hip.h | 81 | #define cudaMemset hipMemset | COMMENT |
| LOW | archive/csrc/ktransformers_ext/vendors/hip.h | 101 | #define cudaStreamCreateWithFlags hipStreamCreateWithFlags | COMMENT |
| LOW | archive/csrc/ktransformers_ext/vendors/hip.h | 121 | #define cudaGraphKernelNodeSetParams hipGraphKernelNodeSetParams | COMMENT |
| LOW | archive/csrc/ktransformers_ext/vendors/hip.h | 141 | #define CUBLAS_STATUS_INTERNAL_ERROR HIPBLAS_STATUS_INTERNAL_ERROR | COMMENT |
| LOW | archive/csrc/ktransformers_ext/vendors/hip.h | 161 | #define RDNA2 | COMMENT |
| LOW | archive/csrc/ktransformers_ext/vendors/cuda.h | 1 | #pragma once | COMMENT |
| LOW | archive/csrc/ktransformers_ext/vendors/vendor.h | 1 | #ifndef CPUINFER_VENDOR_VENDOR_H | COMMENT |
| LOW | …ive/csrc/ktransformers_ext/operators/kvcache/kvcache.h | 21 | #include <fstream> | COMMENT |
| LOW | archive/csrc/ktransformers_ext/operators/amx/la/amx.hpp | 21 | #include <sys/syscall.h> | COMMENT |
| LOW | archive/csrc/ktransformers_ext/operators/amx/la/amx.hpp | 41 | namespace amx { | COMMENT |
| LOW | archive/csrc/ktransformers_ext/cpu_backend/cpuinfer.h | 21 | #ifdef KTRANSFORMERS_USE_CUDA | COMMENT |
| LOW | …hive/csrc/ktransformers_ext/cpu_backend/vendors/musa.h | 1 | #pragma once | COMMENT |
| LOW | …hive/csrc/ktransformers_ext/cpu_backend/vendors/musa.h | 21 | #define cublasDestroy mublasDestroy | COMMENT |
| LOW | …hive/csrc/ktransformers_ext/cpu_backend/vendors/musa.h | 41 | #define cudaEventCreateWithFlags musaEventCreateWithFlags | COMMENT |
| LOW | …hive/csrc/ktransformers_ext/cpu_backend/vendors/musa.h | 61 | #define cudaMallocManaged musaMallocManaged | COMMENT |
| LOW | …hive/csrc/ktransformers_ext/cpu_backend/vendors/musa.h | 81 | #define cudaStreamWaitEvent musaStreamWaitEvent | COMMENT |
| LOW | …hive/csrc/ktransformers_ext/cpu_backend/vendors/musa.h | 101 | #define cuMemGetAllocationGranularity muMemGetAllocationGranularity | COMMENT |
| LOW | …hive/csrc/ktransformers_ext/cpu_backend/vendors/musa.h | 121 | #define cudaGraphExecUpdate musaGraphExecUpdate | COMMENT |
| LOW | …chive/csrc/ktransformers_ext/cpu_backend/vendors/hip.h | 1 | #pragma once | COMMENT |
| LOW | …chive/csrc/ktransformers_ext/cpu_backend/vendors/hip.h | 21 | #define CUBLAS_TF32_TENSOR_OP_MATH 0 | COMMENT |
| LOW | …chive/csrc/ktransformers_ext/cpu_backend/vendors/hip.h | 41 | #define cublasSgemm hipblasSgemm | COMMENT |
| LOW | …chive/csrc/ktransformers_ext/cpu_backend/vendors/hip.h | 61 | #define cudaGetDevice hipGetDevice | COMMENT |
| LOW | …chive/csrc/ktransformers_ext/cpu_backend/vendors/hip.h | 81 | #define cudaMemset hipMemset | COMMENT |
| LOW | …chive/csrc/ktransformers_ext/cpu_backend/vendors/hip.h | 101 | #define cudaStreamCreateWithFlags hipStreamCreateWithFlags | COMMENT |
| LOW | …chive/csrc/ktransformers_ext/cpu_backend/vendors/hip.h | 121 | #define cudaGraphKernelNodeSetParams hipGraphKernelNodeSetParams | COMMENT |
| LOW | …chive/csrc/ktransformers_ext/cpu_backend/vendors/hip.h | 141 | #define CUBLAS_STATUS_INTERNAL_ERROR HIPBLAS_STATUS_INTERNAL_ERROR | COMMENT |
| LOW | …chive/csrc/ktransformers_ext/cpu_backend/vendors/hip.h | 161 | #define RDNA2 | COMMENT |
| LOW | …hive/csrc/ktransformers_ext/cpu_backend/vendors/cuda.h | 1 | #pragma once | COMMENT |
| LOW | …ve/csrc/ktransformers_ext/cpu_backend/vendors/vendor.h | 1 | #ifndef CPUINFER_VENDOR_VENDOR_H | COMMENT |
| LOW | archive/csrc/ktransformers_ext/cuda/binding.cpp | 1 | /** | COMMENT |
| LOW | archive/csrc/ktransformers_ext/cuda/gptq_marlin/ops.h | 21 | COMMENT | |
| LOW | archive/csrc/balance_serve/sched/scheduler.h | 1 | #pragma once | COMMENT |
| LOW | archive/csrc/balance_serve/sched/scheduler.cpp | 1 | #define SPDLOG_ACTIVE_LEVEL SPDLOG_LEVEL_INFO | COMMENT |
| LOW | archive/csrc/balance_serve/sched/metrics.h | 1 | #ifndef Metrics_H | COMMENT |
| LOW | archive/csrc/balance_serve/sched/utils/all.hpp | 1 | #pragma once | COMMENT |
| LOW | archive/csrc/balance_serve/kvc2/test/page_pool_test.cpp | 1 | COMMENT | |
| LOW | …ve/csrc/balance_serve/kvc2/test/kvc2test/lookup-mt.cpp | 61 | // // common prefix | COMMENT |
| LOW | …ve/csrc/balance_serve/kvc2/test/kvc2test/lookup-mt.cpp | 81 | // // insert partly new | COMMENT |
| LOW | …e/csrc/balance_serve/kvc2/test/kvc2test/lookup-gpu.cpp | 101 | cmp_handle_data(k1, k_from_gpu, 3); | COMMENT |
| LOW | …e/csrc/balance_serve/kvc2/test/kvc2test/lookup-gpu.cpp | 121 | COMMENT | |
| LOW | …e/csrc/balance_serve/kvc2/test/kvc2test/lookup-gpu.cpp | 141 | // auto ids2 = random_ids(10 * config.num_token_per_page, gen); | COMMENT |
| LOW | archive/csrc/balance_serve/kvc2/src/async_store.cpp | 1 | COMMENT | |
| 598 more matches not shown… | ||||
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | ktransformers.py | 30 | except Exception: | CODE |
| MEDIUM | ktransformers.py | 27 | def has_sft_support() -> bool: | CODE |
| LOW | …chive/merge_tensors/merge_safetensor_gguf_for_qwen3.py | 47 | except Exception as e: | CODE |
| MEDIUM | …chive/merge_tensors/merge_safetensor_gguf_for_qwen3.py | 48 | print(f"Error reading Safetensor file {file_path}: {e}") | CODE |
| LOW | archive/merge_tensors/merge_safetensor_gguf.py | 48 | except Exception as e: | CODE |
| MEDIUM | archive/merge_tensors/merge_safetensor_gguf.py | 49 | print(f"Error reading Safetensor file {file_path}: {e}") | CODE |
| LOW | archive/kt-sft/setup.py | 45 | except Exception: | CODE |
| LOW | archive/kt-sft/setup.py | 73 | except Exception: | CODE |
| LOW | archive/kt-sft/merge_tensors/merge_safetensor_gguf.py | 48 | except Exception as e: | CODE |
| MEDIUM | archive/kt-sft/merge_tensors/merge_safetensor_gguf.py | 49 | print(f"Error reading Safetensor file {file_path}: {e}") | CODE |
| LOW | archive/kt-sft/test_adapter/infer_with_adapter.py | 27 | except Exception as e: | CODE |
| LOW | archive/kt-sft/test_adapter/inspect_adapter.py | 60 | except Exception as e: | CODE |
| LOW | archive/kt-sft/test_adapter/inspect_adapter.py | 77 | except Exception as e: | CODE |
| LOW | archive/kt-sft/test_adapter/inspect_adapter.py | 94 | except Exception as e: | CODE |
| LOW | archive/kt-sft/ktransformers/local_chat.py | 224 | except Exception as e: | CODE |
| MEDIUM⚡ | archive/kt-sft/ktransformers/util/custom_loader.py | 71 | print(f"Error opening Safetensor file {file_path}: {e}") | CODE |
| MEDIUM⚡ | archive/kt-sft/ktransformers/util/custom_loader.py | 81 | print(f"Error reading Safetensor file {file_path}: {e}") | CODE |
| LOW⚡ | archive/kt-sft/ktransformers/util/custom_loader.py | 70 | except Exception as e: | CODE |
| LOW⚡ | archive/kt-sft/ktransformers/util/custom_loader.py | 80 | except Exception as e: | CODE |
| LOW⚡ | archive/kt-sft/ktransformers/util/custom_loader.py | 557 | except Exception as e: | CODE |
| LOW⚡ | archive/kt-sft/ktransformers/util/custom_loader.py | 566 | except Exception as e: | CODE |
| LOW | archive/kt-sft/ktransformers/util/utils.py | 74 | except Exception: | CODE |
| LOW⚡ | archive/kt-sft/ktransformers/util/weight_loader.py | 85 | except Exception as e: | CODE |
| MEDIUM⚡ | archive/kt-sft/ktransformers/util/weight_loader.py | 86 | print(f"Error opening Safetensor file {file_path}: {e}") | CODE |
| LOW⚡ | archive/kt-sft/ktransformers/util/weight_loader.py | 95 | except Exception as e: | CODE |
| MEDIUM⚡ | archive/kt-sft/ktransformers/util/weight_loader.py | 96 | print(f"Error reading Safetensor file {file_path}: {e}") | CODE |
| LOW | archive/kt-sft/ktransformers/tests/mmlu_pro_test.py | 150 | except Exception as e: | CODE |
| MEDIUM | archive/kt-sft/ktransformers/tests/mmlu_pro_test.py | 151 | print(f"Error processing request {i}: {e}") | CODE |
| LOW | archive/kt-sft/ktransformers/tests/mmlu_test_multi.py | 156 | except Exception as e: | CODE |
| MEDIUM | archive/kt-sft/ktransformers/tests/mmlu_test_multi.py | 157 | print(f"Error processing request {index}: {e}") | CODE |
| LOW | archive/kt-sft/ktransformers/tests/mmlu_test.py | 142 | except Exception as e: | CODE |
| MEDIUM | archive/kt-sft/ktransformers/tests/mmlu_test.py | 143 | print(f"Error processing request {i}: {e}") | CODE |
| LOW | archive/kt-sft/ktransformers/tests/test_speed.py | 116 | except Exception as e: | CODE |
| LOW | archive/kt-sft/ktransformers/tests/test_speed.py | 134 | except Exception as e: | CODE |
| MEDIUM | archive/kt-sft/ktransformers/tests/test_speed.py | 48 | def fetch_event_stream(session, request_id, prompt, max_tokens, model): | CODE |
| LOW | archive/kt-sft/ktransformers/tests/test_client.py | 63 | except Exception as e: | CODE |
| LOW | archive/kt-sft/ktransformers/tests/test_client.py | 73 | except Exception as e: | CODE |
| MEDIUM | archive/kt-sft/ktransformers/tests/test_client.py | 15 | def fetch_event_stream(session, payload, request_id, stream): | CODE |
| LOW | …chive/kt-sft/ktransformers/tests/humaneval/eval_api.py | 75 | except Exception as e: | CODE |
| MEDIUM | …chive/kt-sft/ktransformers/tests/humaneval/eval_api.py | 78 | print(f"Error: {e}") | CODE |
| LOW | …chive/kt-sft/ktransformers/tests/AIME_2024/eval_api.py | 110 | except Exception as e: | CODE |
| LOW | archive/kt-sft/ktransformers/server/utils/sql_utils.py | 97 | except Exception as e: | CODE |
| LOW | archive/kt-sft/ktransformers/server/utils/sql_utils.py | 108 | except Exception as e: | CODE |
| LOW | archive/kt-sft/ktransformers/server/utils/sql_utils.py | 123 | except Exception as e: | CODE |
| LOW | …kt-sft/ktransformers/server/balance_serve/sched_rpc.py | 98 | except Exception as e: | CODE |
| LOW | …serve/inference/distributed/custom_all_reduce_utils.py | 244 | except Exception as e: | CODE |
| LOW | …/balance_serve/inference/distributed/parallel_state.py | 1248 | except Exception as e: | CODE |
| MEDIUM | …/balance_serve/inference/distributed/parallel_state.py | 1249 | print("Error ignored in is_in_the_same_node: %s", e) | CODE |
| LOW | …lance_serve/inference/distributed/custom_all_reduce.py | 20 | except Exception: | CODE |
| LOW | …/balance_serve/inference/distributed/pynccl_wrapper.py | 193 | except Exception as e: | CODE |
| LOW | …s/server/balance_serve/inference/distributed/pynccl.py | 62 | except Exception: | CODE |
| LOW | …-sft/ktransformers/server/api/openai/endpoints/chat.py | 379 | except Exception as e: | STRING |
| LOW | archive/kt-sft/ktransformers/sft/lora.py | 150 | except Exception: | CODE |
| LOW | archive/kt-sft/ktransformers/sft/lora.py | 228 | except Exception: | CODE |
| LOW | archive/kt-sft/ktransformers/sft/lora.py | 327 | except Exception: | CODE |
| MEDIUM | …hive/kt-sft/ktransformers/sft/peft_utils/peft_model.py | 153 | def active_adapters(self) -> list[str]: | CODE |
| LOW | …hive/kt-sft/ktransformers/sft/peft_utils/peft_model.py | 919 | except Exception: # something went wrong, roll back | CODE |
| LOW | …t-sft/ktransformers/sft/flops_utils/lora_test_utils.py | 29 | except Exception as e: | CODE |
| LOW | …t-sft/ktransformers/sft/flops_utils/lora_test_utils.py | 40 | except Exception as e: | CODE |
| LOW | …t-sft/ktransformers/sft/flops_utils/lora_test_utils.py | 58 | except Exception as e: | CODE |
| 255 more matches not shown… | ||||
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | archive/setup.py | 80 | def get_musa_bare_metal_version(self, musa_dir): | CODE |
| LOW | archive/setup.py | 90 | def get_rocm_bare_metal_version(self, rocm_dir): | CODE |
| LOW | archive/setup.py | 154 | def get_cuda_bare_metal_version(self, cuda_dir): | CODE |
| LOW | archive/setup.py | 163 | def get_cuda_version_of_torch(self): | CODE |
| LOW | archive/setup.py | 365 | def run_command_with_live_tail(ext: str, command: List[str], output_lines: int = 20, | CODE |
| LOW | …chive/merge_tensors/merge_safetensor_gguf_for_qwen3.py | 27 | def read_safetensor_keys_from_folder(folder_path) -> dict: | CODE |
| LOW | archive/merge_tensors/merge_safetensor_gguf.py | 15 | def read_safetensor_keys_from_folder(folder_path)->dict: | CODE |
| LOW | archive/csrc/custom_marlin/utils/format24.py | 21 | def _calculate_meta_reordering_scatter_offsets(m, meta_ncols, meta_dtype, | CODE |
| LOW | archive/csrc/custom_marlin/utils/format24.py | 52 | def sparse_semi_structured_from_dense_cutlass(dense): | CODE |
| LOW | archive/csrc/custom_marlin/utils/format24.py | 184 | def sparse_semi_structured_to_dense_cutlass(sparse, meta_reordered): | CODE |
| LOW | archive/kt-sft/setup.py | 105 | def get_musa_bare_metal_version(self, musa_dir): | CODE |
| LOW | archive/kt-sft/setup.py | 115 | def get_rocm_bare_metal_version(self, rocm_dir): | CODE |
| LOW | archive/kt-sft/setup.py | 179 | def get_cuda_bare_metal_version(self, cuda_dir): | CODE |
| LOW | archive/kt-sft/setup.py | 188 | def get_cuda_version_of_torch(self): | CODE |
| LOW | archive/kt-sft/setup.py | 384 | def run_command_with_live_tail(ext: str, command: List[str], output_lines: int = 20, | CODE |
| LOW | archive/kt-sft/merge_tensors/merge_safetensor_gguf.py | 15 | def read_safetensor_keys_from_folder(folder_path)->dict: | CODE |
| LOW | …kt-sft/csrc/ktransformers_ext/examples/test_sft_moe.py | 604 | def test_backward_one_vs_many_comparison(): | CODE |
| LOW | archive/kt-sft/csrc/custom_marlin/utils/format24.py | 21 | def _calculate_meta_reordering_scatter_offsets(m, meta_ncols, meta_dtype, | CODE |
| LOW | archive/kt-sft/csrc/custom_marlin/utils/format24.py | 52 | def sparse_semi_structured_from_dense_cutlass(dense): | CODE |
| LOW | archive/kt-sft/csrc/custom_marlin/utils/format24.py | 184 | def sparse_semi_structured_to_dense_cutlass(sparse, meta_reordered): | CODE |
| LOW | archive/kt-sft/ktransformers/local_chat.py | 239 | # def first_token_argmax_baseline(model, tokenizer, prompt_text, device): | COMMENT |
| LOW | archive/kt-sft/ktransformers/operators/cpuinfer.py | 328 | def update_importance_one_block( | CODE |
| LOW | archive/kt-sft/ktransformers/operators/cpuinfer.py | 473 | def clear_importance_all_layers( | CODE |
| LOW | archive/kt-sft/ktransformers/operators/cpuinfer.py | 704 | def get_all_kvcache_one_layer( | CODE |
| LOW | …ve/kt-sft/ktransformers/operators/dynamic_attention.py | 271 | def get_preselect_block_table_and_attn_score( | CODE |
| LOW | …ive/kt-sft/ktransformers/operators/triton_attention.py | 165 | def _decode_grouped_att_m_fwd( | CODE |
| LOW | …ive/kt-sft/ktransformers/operators/triton_attention.py | 313 | def _decode_softmax_reducev_fwd( | CODE |
| LOW | …ive/kt-sft/ktransformers/operators/triton_attention.py | 358 | def decode_attention_fwd_grouped( | CODE |
| LOW | archive/kt-sft/ktransformers/util/custom_gguf.py | 97 | def quant_shape_to_byte_shape(shape: Sequence[int], quant_type: GGMLQuantizationType): | CODE |
| LOW | archive/kt-sft/ktransformers/util/custom_gguf.py | 635 | def translate_name_to_gguf_mixtral(name): | CODE |
| LOW⚡ | archive/kt-sft/ktransformers/util/custom_gguf.py | 704 | def translate_adapter_name_to_gguf(name): | CODE |
| LOW | …chive/kt-sft/ktransformers/util/modeling_rope_utils.py | 29 | def _compute_default_rope_parameters( | CODE |
| LOW | …chive/kt-sft/ktransformers/util/modeling_rope_utils.py | 71 | def _compute_linear_scaling_rope_parameters( | CODE |
| LOW | …chive/kt-sft/ktransformers/util/modeling_rope_utils.py | 112 | def _compute_dynamic_ntk_parameters( | CODE |
| LOW | …chive/kt-sft/ktransformers/util/modeling_rope_utils.py | 259 | def _compute_longrope_parameters( | CODE |
| LOW | …chive/kt-sft/ktransformers/util/modeling_rope_utils.py | 407 | def _validate_default_rope_parameters(config: PretrainedConfig, ignore_keys: Optional[set] = None): | CODE |
| LOW | …chive/kt-sft/ktransformers/util/modeling_rope_utils.py | 415 | def _validate_linear_scaling_rope_parameters(config: PretrainedConfig, ignore_keys: Optional[set] = None): | CODE |
| LOW | …chive/kt-sft/ktransformers/util/modeling_rope_utils.py | 427 | def _validate_dynamic_scaling_rope_parameters(config: PretrainedConfig, ignore_keys: Optional[set] = None): | CODE |
| LOW | …chive/kt-sft/ktransformers/util/modeling_rope_utils.py | 441 | def _validate_yarn_parameters(config: PretrainedConfig, ignore_keys: Optional[set] = None): | CODE |
| LOW | …chive/kt-sft/ktransformers/util/modeling_rope_utils.py | 479 | def _validate_longrope_parameters(config: PretrainedConfig, ignore_keys: Optional[set] = None): | CODE |
| LOW | archive/kt-sft/ktransformers/util/custom_loader.py | 389 | def get_undequanted_tensor_and_ggml_type(self, name): | CODE |
| LOW | archive/kt-sft/ktransformers/util/utils.py | 527 | def prefill_and_generate_capture( | CODE |
| LOW | …/kt-sft/ktransformers/server/utils/create_interface.py | 38 | def get_thread_context_manager() -> GlobalContextManager: | CODE |
| LOW | …kt-sft/ktransformers/server/backend/context_manager.py | 29 | async def get_context_by_run_object(self, run: RunObject) -> ThreadContext: | CODE |
| LOW | archive/kt-sft/ktransformers/server/backend/base.py | 57 | def report_last_time_performance(self): | CODE |
| LOW | …transformers/server/backend/interfaces/transformers.py | 176 | def format_and_tokenize_input_ids(self, thread_id: ObjectID, messages: List): | CODE |
| LOW | …ransformers/server/backend/interfaces/balance_serve.py | 94 | def report_last_time_performance(profiler: Profiler): | CODE |
| LOW | …ransformers/server/backend/interfaces/balance_serve.py | 411 | def format_and_tokenize_input_ids(self, thread_id: ObjectID, messages: List): | CODE |
| LOW | …/ktransformers/server/schemas/assistants/assistants.py | 133 | def get_related_threads_objects(self) -> List: | CODE |
| LOW | …ft/ktransformers/server/schemas/assistants/messages.py | 160 | def stream_response_with_event(self, event: MessageBase.Status) -> MessageStreamResponse: | CODE |
| LOW | …t/ktransformers/server/schemas/assistants/streaming.py | 136 | def wrap_async_generator_into_queue(async_events: AsyncIterable) -> asyncio.Queue: | CODE |
| LOW | …kt-sft/ktransformers/server/schemas/assistants/runs.py | 105 | def stream_response_with_event(self,event:RunBase.Status)->RunStreamResponse: | CODE |
| LOW | …kt-sft/ktransformers/server/schemas/assistants/runs.py | 123 | def create_message_creation_step(self): | CODE |
| LOW | …kt-sft/ktransformers/server/balance_serve/sched_rpc.py | 179 | def get_inference_context_raw(self): | CODE |
| LOW | …/balance_serve/inference/distributed/parallel_state.py | 891 | def init_model_parallel_group( | CODE |
| LOW | …/balance_serve/inference/distributed/parallel_state.py | 967 | def init_distributed_environment( | CODE |
| LOW | …/balance_serve/inference/distributed/parallel_state.py | 1014 | def initialize_model_parallel( | CODE |
| LOW | …/balance_serve/inference/distributed/parallel_state.py | 1091 | def ensure_model_parallel_initialized( | CODE |
| LOW | …/balance_serve/inference/distributed/parallel_state.py | 1120 | def model_parallel_is_initialized(): | CODE |
| LOW | …/balance_serve/inference/distributed/parallel_state.py | 1129 | def patch_tensor_parallel_group(tp_group: GroupCoordinator): | CODE |
| 279 more matches not shown… | ||||
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | archive/setup.py | 238 | CODE | |
| LOW | archive/setup.py | 490 | CODE | |
| LOW | …chive/merge_tensors/merge_safetensor_gguf_for_qwen3.py | 27 | CODE | |
| LOW | …chive/merge_tensors/merge_safetensor_gguf_for_qwen3.py | 103 | CODE | |
| LOW | archive/merge_tensors/merge_safetensor_gguf.py | 15 | CODE | |
| LOW | archive/merge_tensors/merge_safetensor_gguf.py | 97 | CODE | |
| LOW | archive/csrc/ktransformers_ext/bench/bench_moe_torch.py | 80 | CODE | |
| LOW | archive/csrc/ktransformers_ext/bench/bench_moe.py | 31 | CODE | |
| LOW | archive/csrc/ktransformers_ext/bench/bench_moe_amx.py | 29 | CODE | |
| LOW | archive/csrc/ktransformers_ext/bench/bench_mlp.py | 28 | CODE | |
| LOW | archive/csrc/ktransformers_ext/bench/bench_linear.py | 28 | CODE | |
| LOW | …ive/csrc/ktransformers_ext/bench/bench_linear_torch.py | 26 | CODE | |
| LOW | archive/csrc/ktransformers_ext/bench/bench_mlp_torch.py | 47 | CODE | |
| LOW | archive/kt-sft/setup.py | 259 | CODE | |
| LOW | archive/kt-sft/setup.py | 509 | CODE | |
| LOW | archive/kt-sft/merge_tensors/merge_safetensor_gguf.py | 15 | CODE | |
| LOW | archive/kt-sft/merge_tensors/merge_safetensor_gguf.py | 97 | CODE | |
| LOW | …kt-sft/csrc/ktransformers_ext/bench/bench_moe_torch.py | 80 | CODE | |
| LOW | …chive/kt-sft/csrc/ktransformers_ext/bench/bench_moe.py | 31 | CODE | |
| LOW | …e/kt-sft/csrc/ktransformers_ext/bench/bench_moe_amx.py | 29 | CODE | |
| LOW | …chive/kt-sft/csrc/ktransformers_ext/bench/bench_mlp.py | 28 | CODE | |
| LOW | …ve/kt-sft/csrc/ktransformers_ext/bench/bench_linear.py | 28 | CODE | |
| LOW | …sft/csrc/ktransformers_ext/bench/bench_linear_torch.py | 26 | CODE | |
| LOW | …kt-sft/csrc/ktransformers_ext/bench/bench_mlp_torch.py | 47 | CODE | |
| LOW | …ft/csrc/ktransformers_ext/examples/test_sft_amx_moe.py | 476 | CODE | |
| LOW | …ft/csrc/ktransformers_ext/examples/test_sft_amx_moe.py | 501 | CODE | |
| LOW | …ft/csrc/ktransformers_ext/examples/test_sft_amx_moe.py | 536 | CODE | |
| LOW | …ft/csrc/ktransformers_ext/examples/test_sft_amx_moe.py | 551 | CODE | |
| LOW | archive/kt-sft/ktransformers/local_chat.py | 87 | CODE | |
| LOW | archive/kt-sft/ktransformers/optimize/optimize.py | 20 | CODE | |
| LOW | archive/kt-sft/ktransformers/optimize/optimize.py | 55 | CODE | |
| LOW | archive/kt-sft/ktransformers/operators/linear.py | 83 | CODE | |
| LOW | archive/kt-sft/ktransformers/operators/cpuinfer.py | 30 | CODE | |
| LOW | …ve/kt-sft/ktransformers/operators/dynamic_attention.py | 271 | CODE | |
| LOW | …ve/kt-sft/ktransformers/operators/dynamic_attention.py | 605 | CODE | |
| LOW | …sft/ktransformers/operators/balance_serve_attention.py | 327 | CODE | |
| LOW | archive/kt-sft/ktransformers/operators/experts.py | 88 | CODE | |
| LOW | archive/kt-sft/ktransformers/operators/experts.py | 353 | CODE | |
| LOW | archive/kt-sft/ktransformers/operators/experts.py | 799 | CODE | |
| LOW | archive/kt-sft/ktransformers/operators/experts.py | 1022 | CODE | |
| LOW | archive/kt-sft/ktransformers/operators/experts.py | 1069 | CODE | |
| LOW | archive/kt-sft/ktransformers/util/custom_gguf.py | 170 | CODE | |
| LOW | archive/kt-sft/ktransformers/util/vendors.py | 23 | CODE | |
| LOW | archive/kt-sft/ktransformers/util/vendors.py | 75 | CODE | |
| LOW | archive/kt-sft/ktransformers/util/custom_loader.py | 47 | CODE | |
| LOW | archive/kt-sft/ktransformers/util/custom_loader.py | 100 | CODE | |
| LOW | archive/kt-sft/ktransformers/util/custom_loader.py | 260 | CODE | |
| LOW | archive/kt-sft/ktransformers/util/custom_loader.py | 296 | CODE | |
| LOW | archive/kt-sft/ktransformers/util/custom_loader.py | 426 | CODE | |
| LOW | archive/kt-sft/ktransformers/util/custom_loader.py | 508 | CODE | |
| LOW | archive/kt-sft/ktransformers/util/utils.py | 166 | CODE | |
| LOW | archive/kt-sft/ktransformers/util/utils.py | 61 | CODE | |
| LOW | archive/kt-sft/ktransformers/util/weight_loader.py | 59 | CODE | |
| LOW | archive/kt-sft/ktransformers/util/weight_loader.py | 190 | CODE | |
| LOW | archive/kt-sft/ktransformers/tests/mmlu_test_multi.py | 115 | CODE | |
| LOW | archive/kt-sft/ktransformers/tests/test_speed.py | 48 | CODE | |
| LOW | archive/kt-sft/ktransformers/tests/test_client.py | 15 | CODE | |
| LOW | …chive/kt-sft/ktransformers/tests/humaneval/eval_api.py | 34 | CODE | |
| LOW | …/kt-sft/ktransformers/server/utils/create_interface.py | 19 | CODE | |
| LOW | …kt-sft/ktransformers/server/backend/context_manager.py | 29 | CODE | |
| 274 more matches not shown… | ||||
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | install.sh | 47 | # ─── Helpers ─────────────────────────────────────────────────────────────────── | COMMENT |
| MEDIUM | install.sh | 81 | # ─── Submodule init ──────────────────────────────────────────────────────────── | COMMENT |
| MEDIUM | install.sh | 97 | # ─── sglang install ─────────────────────────────────────────────────────────── | COMMENT |
| MEDIUM | install.sh | 126 | # ─── kt-kernel install ──────────────────────────────────────────────────────── | COMMENT |
| MEDIUM | install.sh | 145 | # ─── deps install ───────────────────────────────────────────────────────────── | COMMENT |
| MEDIUM | install.sh | 161 | # ─── "all" subcommand ───────────────────────────────────────────────────────── | COMMENT |
| MEDIUM | install.sh | 212 | # ─── Subcommand dispatcher ──────────────────────────────────────────────────── | COMMENT |
| MEDIUM | …/balance_serve/inference/distributed/parallel_state.py | 327 | # -------------------------------------------- | COMMENT |
| MEDIUM | archive/third_party/llamafile/tinyblas_cpu.h | 30 | // ╚═╝ ╚═╝╚═╝ ╚═╝ ╚══╝ ╚═════╝ ╚═══╝╚═╝ ╚═╝╚═════╝ | COMMENT |
| MEDIUM | …ive/ktransformers/operators/ascend/ascend_attention.py | 920 | # ------------------------------------------------------- | COMMENT |
| MEDIUM | …ive/ktransformers/operators/ascend/ascend_attention.py | 922 | # ------------------------------------------------------- | COMMENT |
| MEDIUM | …ive/ktransformers/operators/ascend/ascend_attention.py | 994 | # ------------------------------------------------------- | COMMENT |
| MEDIUM | …ive/ktransformers/operators/ascend/ascend_attention.py | 996 | # ------------------------------------------------------- | COMMENT |
| MEDIUM | archive/ktransformers/tests/UT/test_kdeepseek_ln_npu.py | 12 | # ========================== | COMMENT |
| MEDIUM | archive/ktransformers/tests/UT/test_kdeepseek_ln_npu.py | 14 | # ========================== | COMMENT |
| MEDIUM⚡ | …s/tests/UT/test_kdeepseek_attention_w8a8a2serve_npu.py | 221 | # ========================== | COMMENT |
| MEDIUM⚡ | …s/tests/UT/test_kdeepseek_attention_w8a8a2serve_npu.py | 223 | # ========================== | COMMENT |
| MEDIUM | …/balance_serve/inference/distributed/parallel_state.py | 327 | # -------------------------------------------- | COMMENT |
| MEDIUM⚡ | …sformers/models/ascend/custom_ascend_modeling_qwen3.py | 87 | # --------------------------------------------------- | COMMENT |
| MEDIUM⚡ | …sformers/models/ascend/custom_ascend_modeling_qwen3.py | 89 | # --------------------------------------------------- | COMMENT |
| MEDIUM | kt-kernel/setup.py | 63 | # ------------------------- | COMMENT |
| MEDIUM | kt-kernel/setup.py | 65 | # ------------------------- | COMMENT |
| MEDIUM | kt-kernel/bench/bench_write_buffer.py | 102 | # ============================================================================== | COMMENT |
| MEDIUM | kt-kernel/bench/bench_write_buffer.py | 104 | # ============================================================================== | COMMENT |
| MEDIUM | kt-kernel/bench/bench_write_buffer.py | 326 | # ============================================================================== | COMMENT |
| MEDIUM | kt-kernel/bench/bench_write_buffer.py | 328 | # ============================================================================== | COMMENT |
| MEDIUM | kt-kernel/bench/bench_write_buffer.py | 408 | # ============================================================================== | COMMENT |
| MEDIUM | kt-kernel/bench/bench_write_buffer.py | 410 | # ============================================================================== | COMMENT |
| MEDIUM⚡ | kt-kernel/test/test_native_moe_loader_auto_release.py | 79 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM⚡ | kt-kernel/test/test_native_moe_loader_auto_release.py | 81 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM | kt-kernel/test/test_native_moe_loader_auto_release.py | 199 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM | kt-kernel/test/test_native_moe_loader_auto_release.py | 201 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM⚡ | kt-kernel/python/experts.py | 303 | # ============================================================================= | COMMENT |
| MEDIUM⚡ | kt-kernel/python/experts.py | 305 | # ============================================================================= | COMMENT |
| MEDIUM | kt-kernel/python/cli/utils/model_registry.py | 377 | # ============================================================================ | COMMENT |
| MEDIUM | kt-kernel/python/cli/utils/model_registry.py | 379 | # ============================================================================ | COMMENT |
| MEDIUM⚡ | kt-kernel/python/sft/wrapper.py | 46 | # ============================================================================= | COMMENT |
| MEDIUM⚡ | kt-kernel/python/sft/wrapper.py | 48 | # ============================================================================= | COMMENT |
| MEDIUM⚡ | kt-kernel/python/sft/wrapper.py | 136 | # ============================================================================= | COMMENT |
| MEDIUM⚡ | kt-kernel/python/sft/wrapper.py | 138 | # ============================================================================= | COMMENT |
| MEDIUM⚡ | kt-kernel/python/sft/wrapper.py | 408 | # ============================================================================= | COMMENT |
| MEDIUM⚡ | kt-kernel/python/sft/wrapper.py | 410 | # ============================================================================= | COMMENT |
| MEDIUM⚡ | kt-kernel/python/sft/arch.py | 21 | # ============================================================================= | COMMENT |
| MEDIUM⚡ | kt-kernel/python/sft/arch.py | 23 | # ============================================================================= | COMMENT |
| MEDIUM | kt-kernel/python/sft/arch.py | 42 | # ============================================================================= | COMMENT |
| MEDIUM | kt-kernel/python/sft/arch.py | 44 | # ============================================================================= | COMMENT |
| MEDIUM⚡ | kt-kernel/python/sft/lora.py | 29 | # ============================================================================= | COMMENT |
| MEDIUM⚡ | kt-kernel/python/sft/lora.py | 31 | # ============================================================================= | COMMENT |
| MEDIUM⚡ | kt-kernel/python/sft/lora.py | 307 | # ============================================================================= | COMMENT |
| MEDIUM⚡ | kt-kernel/python/sft/lora.py | 309 | # ============================================================================= | COMMENT |
| MEDIUM⚡ | kt-kernel/python/sft/lora.py | 454 | # ============================================================================= | COMMENT |
| MEDIUM⚡ | kt-kernel/python/sft/lora.py | 456 | # ============================================================================= | COMMENT |
| MEDIUM⚡ | kt-kernel/python/sft/lora.py | 580 | # ============================================================================= | COMMENT |
| MEDIUM⚡ | kt-kernel/python/sft/lora.py | 582 | # ============================================================================= | COMMENT |
| MEDIUM | kt-kernel/python/sft/lora.py | 82 | # ============================================================================= | COMMENT |
| MEDIUM | kt-kernel/python/sft/lora.py | 84 | # ============================================================================= | COMMENT |
| MEDIUM | kt-kernel/python/sft/lora.py | 132 | # ============================================================================= | COMMENT |
| MEDIUM | kt-kernel/python/sft/lora.py | 134 | # ============================================================================= | COMMENT |
| MEDIUM | kt-kernel/python/sft/lora.py | 523 | # ============================================================================= | COMMENT |
| MEDIUM | kt-kernel/python/sft/lora.py | 525 | # ============================================================================= | COMMENT |
| 23 more matches not shown… | ||||
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | kt-kernel/operators/moe-sft-tp.hpp | 355 | // Step 1: For each NUMA, allocate and copy partitioned weights | COMMENT |
| LOW⚡ | kt-kernel/operators/moe-sft-tp.hpp | 394 | // Step 2: Set weight pointers BEFORE load_weights (Bug #24 fix) | COMMENT |
| LOW⚡ | kt-kernel/operators/moe-sft-tp.hpp | 402 | // Step 3: Prepare backward weights (this also clears weight pointers) | COMMENT |
| LOW⚡ | kt-kernel/operators/amx/sft_moe.hpp | 1108 | // Step 4: Quantize input | COMMENT |
| LOW⚡ | kt-kernel/operators/amx/sft_moe.hpp | 1114 | // Step 5: Gate + Up GEMM (base projection) | COMMENT |
| LOW⚡ | kt-kernel/operators/amx/sft_moe.hpp | 1274 | // Step 7: Quantize intermediate for down projection | COMMENT |
| LOW⚡ | kt-kernel/operators/amx/sft_moe.hpp | 1283 | // Step 8: Down GEMM | COMMENT |
| LOW⚡ | kt-kernel/operators/amx/sft_moe.hpp | 3751 | // Step 1: intermediate = input @ lora_A^T (optimized with T_BLOCK=4, R_BLOCK=4) | COMMENT |
| LOW⚡ | kt-kernel/operators/amx/sft_moe.hpp | 3757 | // Step 2: output += scale * (intermediate @ lora_B_transposed) | COMMENT |
| LOW⚡ | kt-kernel/operators/amx/sft_moe.hpp | 4223 | // Step 1: Zero per-expert grad_output buffers | COMMENT |
| LOW⚡ | kt-kernel/operators/amx/sft_moe.hpp | 4233 | // Step 2: Scatter grad_output to per-expert BF16 buffers | COMMENT |
| LOW⚡ | kt-kernel/operators/amx/sft_moe.hpp | 4368 | // Step 1: grad_output @ down_lora_B_transposed -> [local_num_tokens, rank] | COMMENT |
| LOW⚡ | kt-kernel/operators/amx/sft_moe.hpp | 4375 | // Step 2: grad_times_b @ down_lora_A -> [local_num_tokens, inter_size] (AVX512) | COMMENT |
| LOW⚡ | kt-kernel/operators/amx/sft_moe.hpp | 4385 | // Step 5: LoRA gradient computation (parallelized across blocks) | COMMENT |
| LOW | kt-kernel/operators/amx/sft_moe.hpp | 952 | // Step 1: Expert routing (reuse base class logic) | COMMENT |
| LOW | kt-kernel/operators/amx/sft_moe.hpp | 971 | // Step 2: Buffer pool allocation (reuse base class logic) | COMMENT |
| LOW | kt-kernel/operators/amx/sft_moe.hpp | 1073 | // Step 3: Copy input to expert buffers | COMMENT |
| LOW | kt-kernel/operators/amx/sft_moe.hpp | 1219 | // Step 6: Activation (silu(gate) * up) | COMMENT |
| LOW | kt-kernel/operators/amx/sft_moe.hpp | 1335 | // Step 9: Weighted merge | COMMENT |
| LOW | kt-kernel/operators/amx/sft_moe.hpp | 1549 | // Step 1: Down projection backward | COMMENT |
| LOW | kt-kernel/operators/amx/sft_moe.hpp | 1711 | // Step 4: Compute grad_weights (gradient for routing weights) | COMMENT |
| LOW | kt-kernel/operators/amx/sft_moe.hpp | 3368 | // Step 1: input @ lora_A^T -> lora_intermediate | COMMENT |
| LOW | kt-kernel/operators/amx/sft_moe.hpp | 3400 | // Step 2: Quantize lora_intermediate to BufferA | COMMENT |
| LOW | kt-kernel/operators/amx/sft_moe.hpp | 3533 | // Step 1: intermediate @ down_lora_A^T -> lora_intermediate | COMMENT |
| LOW | kt-kernel/operators/amx/sft_moe.hpp | 3560 | // Step 2: Quantize lora_intermediate to BufferA | COMMENT |
| LOW | kt-kernel/operators/amx/sft_moe.hpp | 3812 | // Step 1: intermediate = input @ lora_A^T (optimized with T_BLOCK=4, R_BLOCK=4) | COMMENT |
| LOW | kt-kernel/operators/amx/sft_moe.hpp | 3823 | // Step 2: output += scale * (intermediate @ lora_B_transposed) | COMMENT |
| LOW | kt-kernel/operators/amx/sft_moe.hpp | 4278 | // Step 3: Quantize scattered grad_output to BufferA | COMMENT |
| LOW | kt-kernel/operators/amx/sft_moe.hpp | 5383 | // Step 6: grad_A = G_B^T @ X | COMMENT |
| LOW | kt-kernel/operators/amx/test/test_lora_fused_add.cpp | 1657 | // Step 1: Reduce 512 -> 256 by adding high/low halves (8 ops) | COMMENT |
| LOW⚡ | kt-kernel/operators/amx/test/test_lora_fused_add.cpp | 1671 | // Step 2: Pack pairs into single 512-bit vectors | COMMENT |
| LOW⚡ | kt-kernel/operators/amx/test/test_lora_fused_add.cpp | 1679 | // Step 3: Reduce 256 -> 128 within each pair | COMMENT |
| LOW⚡ | kt-kernel/operators/amx/test/test_lora_fused_add.cpp | 1686 | // Step 4: Reduce 128 -> 64 -> 32 within each | COMMENT |
| LOW⚡ | kt-kernel/operators/amx/la/avx_kernels.hpp | 924 | // Step 1: Interleave 16-bit | COMMENT |
| LOW⚡ | kt-kernel/operators/amx/la/avx_kernels.hpp | 934 | // Step 2: Interleave 32-bit | COMMENT |
| LOW⚡ | kt-kernel/operators/amx/la/avx_kernels.hpp | 944 | // Step 3: Interleave 64-bit | COMMENT |
| LOW | kt-kernel/operators/amx/la/avx_kernels.hpp | 985 | // Step 1: Interleave 16-bit | COMMENT |
| LOW | kt-kernel/operators/amx/la/avx_kernels.hpp | 1003 | // Step 2: Interleave 32-bit | COMMENT |
| LOW | kt-kernel/operators/amx/la/avx_kernels.hpp | 1021 | // Step 3: Interleave 64-bit | COMMENT |
| LOW | kt-kernel/operators/amx/la/avx_kernels.hpp | 1039 | // Step 4: Permute 128-bit lanes | COMMENT |
| LOW | kt-kernel/python/cli/utils/quant_interactive.py | 245 | # Step 1: Select model | COMMENT |
| LOW⚡ | kt-kernel/python/cli/utils/quant_interactive.py | 260 | # Step 2: Configure quantization method | COMMENT |
| LOW⚡ | kt-kernel/python/cli/utils/quant_interactive.py | 263 | # Step 3: Configure CPU parameters | COMMENT |
| LOW⚡ | kt-kernel/python/cli/utils/quant_interactive.py | 266 | # Step 4: Configure output path | COMMENT |
| LOW | kt-kernel/python/cli/utils/quant_interactive.py | 288 | # Step 5: Calculate space requirements and check availability | COMMENT |
| LOW⚡ | kt-kernel/python/cli/utils/run_interactive.py | 893 | # Step 1: Select model | COMMENT |
| LOW⚡ | kt-kernel/python/cli/utils/run_interactive.py | 898 | # Step 2: Select inference method | COMMENT |
| LOW⚡ | kt-kernel/python/cli/utils/run_interactive.py | 993 | # Step 3: Configure NUMA and CPU | COMMENT |
| LOW⚡ | kt-kernel/python/cli/utils/run_interactive.py | 996 | # Step 4: Configure GPU experts | COMMENT |
| LOW⚡ | kt-kernel/python/cli/utils/run_interactive.py | 999 | # Step 5: Configure KV Cache (only for raw) | COMMENT |
| LOW⚡ | kt-kernel/python/cli/utils/run_interactive.py | 1003 | # Step 6: Select GPUs and TP | COMMENT |
| LOW⚡ | kt-kernel/python/cli/utils/run_interactive.py | 1008 | # Step 7: Configure parsers (optional) | COMMENT |
| LOW⚡ | kt-kernel/python/cli/utils/run_interactive.py | 1011 | # Step 8: Configure host and port | COMMENT |
| LOW | kt-kernel/python/cli/utils/run_interactive.py | 1035 | # Step 9: Save configuration | COMMENT |
| LOW⚡ | kt-kernel/python/cli/commands/run.py | 330 | # Step 2: Resolve model | COMMENT |
| LOW | kt-kernel/python/cli/commands/run.py | 390 | # Step 3: Check quantized weights (only if explicitly requested) | COMMENT |
| LOW | kt-kernel/python/cli/commands/run.py | 414 | # Step 4: Build command | COMMENT |
| LOW | kt-kernel/python/cli/commands/run.py | 514 | # Step 5: Show configuration summary | COMMENT |
| LOW | kt-kernel/python/cli/commands/run.py | 544 | # Step 6: Show or execute | COMMENT |
| LOW⚡ | kt-kernel/python/cli/commands/model.py | 2583 | # Step 1: Delete the corrupted/missing file if it exists | COMMENT |
| 65 more matches not shown… | ||||
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | docker/docker-utils.sh | 106 | # Check if image exists | COMMENT |
| LOW | docker/docker-utils.sh | 230 | # Check if Docker daemon is running | COMMENT |
| LOW | docker/docker-utils.sh | 240 | # Check if user is logged into Docker registry | COMMENT |
| LOW | docker/docker-utils.sh | 297 | # Check if file/directory exists and is writable | COMMENT |
| LOW | docker/build-docker-tar.sh | 373 | # Check if tar file already exists | COMMENT |
| LOW | docker/push-to-dockerhub.sh | 290 | # Check if we should skip build | COMMENT |
| LOW | docker/push-to-dockerhub.sh | 862 | # Check if we should skip build | COMMENT |
| LOW | archive/kt-sft/ktransformers/operators/experts.py | 470 | # Check if we need to allocate or expand buffers | COMMENT |
| LOW | archive/kt-sft/ktransformers/util/weight_loader.py | 177 | # Check if any safetensor files exist in the folder | COMMENT |
| LOW | archive/kt-sft/ktransformers/util/weight_loader.py | 197 | # Check if path exists | COMMENT |
| LOW | archive/kt-sft/ktransformers/util/weight_loader.py | 362 | # Check if any GGUF files exist in the folder | COMMENT |
| LOW | …-sft/ktransformers/server/api/openai/endpoints/chat.py | 203 | # Check if tools are present | STRING |
| LOW | …hive/kt-sft/ktransformers/sft/peft_utils/lora_layer.py | 571 | fan_in_fan_out: bool = False, # Set this to True if the layer to replace stores weight like (fan_in, fan_out) | CODE |
| LOW | …hive/kt-sft/ktransformers/sft/peft_utils/lora_layer.py | 1021 | fan_in_fan_out: bool = False, # Set this to True if the layer to replace stores weight like (fan_in, fan_out) | CODE |
| LOW | archive/ktransformers/util/weight_loader.py | 177 | # Check if any safetensor files exist in the folder | COMMENT |
| LOW | archive/ktransformers/util/weight_loader.py | 197 | # Check if path exists | COMMENT |
| LOW | archive/ktransformers/util/weight_loader.py | 362 | # Check if any GGUF files exist in the folder | COMMENT |
| LOW | …hive/ktransformers/server/api/openai/endpoints/chat.py | 203 | # Check if tools are present | STRING |
| LOW | kt-kernel/bench/bench_bf16_moe.py | 222 | # Print results | COMMENT |
| LOW | kt-kernel/bench/bench_fp8_perchannel_moe.py | 234 | # Print results | COMMENT |
| LOW | kt-kernel/bench/bench_fp8_moe.py | 243 | # Print results | COMMENT |
| LOW | kt-kernel/test/per_commit/test_moe_amx_bench_int8.py | 23 | # Check if dependencies are available | COMMENT |
| LOW | kt-kernel/test/per_commit/test_moe_amx_accuracy_int4.py | 19 | # Check if dependencies are available | COMMENT |
| LOW | …kernel/test/per_commit/test_moe_amx_accuracy_int4_1.py | 19 | # Check if dependencies are available | COMMENT |
| LOW | kt-kernel/test/per_commit/test_moe_amx_bench_int4.py | 23 | # Check if dependencies are available | COMMENT |
| LOW | kt-kernel/test/per_commit/test_basic_cpu.py | 17 | # Check if kt_kernel_ext is available | COMMENT |
| LOW | …ernel/test/per_commit/test_moe_amx_accuracy_int4_1k.py | 19 | # Check if dependencies are available | COMMENT |
| LOW | kt-kernel/test/per_commit/test_moe_amx_accuracy_int8.py | 19 | # Check if dependencies are available | COMMENT |
| LOW | kt-kernel/test/per_commit/test_moe_amx_bench_int4_1k.py | 24 | # Check if dependencies are available | COMMENT |
| LOW | kt-kernel/test/per_commit/test_moe_amx_bench_int4_1.py | 23 | # Check if dependencies are available | COMMENT |
| LOW | kt-kernel/python/_cpu_detect.py | 87 | # Check if all required flags are present | COMMENT |
| LOW | kt-kernel/python/utils/llamafile.py | 84 | # Check if intermediate_size is divisible by QK_K | COMMENT |
| LOW | kt-kernel/python/utils/loader.py | 217 | # Check if backward weights exist | COMMENT |
| LOW | kt-kernel/python/utils/loader.py | 345 | # Check if any key matches this format pattern | COMMENT |
| LOW | kt-kernel/python/cli/main.py | 373 | # Check if path exists or parent is writable | COMMENT |
| LOW | kt-kernel/python/cli/main.py | 380 | # Check if we can create it (parent writable) | COMMENT |
| LOW | kt-kernel/python/cli/main.py | 407 | # Check if already installed | COMMENT |
| LOW | kt-kernel/python/cli/main.py | 505 | # Check if this is first run | COMMENT |
| LOW | kt-kernel/python/cli/utils/console.py | 142 | # Check if response matches a choice directly | COMMENT |
| LOW | kt-kernel/python/cli/utils/quant_interactive.py | 226 | # Check if available space >= required * 1.2 (20% buffer) | COMMENT |
| LOW | kt-kernel/python/cli/utils/model_verifier.py | 28 | # Read file in chunks to handle large files | COMMENT |
| LOW | kt-kernel/python/cli/utils/model_verifier.py | 671 | # Check if already verified | COMMENT |
| LOW | kt-kernel/python/cli/utils/model_verifier.py | 683 | # Check if repo_id exists | COMMENT |
| LOW | kt-kernel/python/cli/utils/model_scanner.py | 94 | # Check if size meets minimum threshold | COMMENT |
| LOW | kt-kernel/python/cli/utils/model_scanner.py | 633 | # Check if this root is a parent of any already selected root | COMMENT |
| LOW | kt-kernel/python/cli/utils/kv_cache_calculator.py | 67 | # Check if it's MLA (Multi-head Latent Attention) model | COMMENT |
| LOW | kt-kernel/python/cli/utils/kv_cache_calculator.py | 96 | # Check if it's NSA (Native Sparse Attention) model | COMMENT |
| LOW | kt-kernel/python/cli/utils/model_discovery.py | 101 | # Check if already in registry | COMMENT |
| LOW | kt-kernel/python/cli/utils/model_discovery.py | 105 | # Check if already discovered in this session | COMMENT |
| LOW | kt-kernel/python/cli/utils/tuna_engine.py | 202 | # Check if process has output | COMMENT |
| LOW | kt-kernel/python/cli/utils/tuna_engine.py | 321 | # Check if we got a valid response | COMMENT |
| LOW | kt-kernel/python/cli/utils/tuna_engine.py | 432 | # Check if even 0 doesn't work | COMMENT |
| LOW | kt-kernel/python/cli/utils/download_helper.py | 77 | # Check if filename matches pattern | COMMENT |
| LOW | kt-kernel/python/cli/utils/environment.py | 117 | # Check if venv is available (built into Python) | COMMENT |
| LOW | kt-kernel/python/cli/utils/environment.py | 146 | # Check if env_name appears as a separate word in the output | COMMENT |
| LOW | kt-kernel/python/cli/utils/environment.py | 703 | # Check if writable | COMMENT |
| LOW | kt-kernel/python/cli/utils/environment.py | 742 | # Check if parent exists for paths that don't exist yet | COMMENT |
| LOW | kt-kernel/python/cli/utils/environment.py | 917 | # Check if this directory is a model | COMMENT |
| LOW⚡ | kt-kernel/python/cli/utils/model_registry.py | 276 | # Check if query is contained in name | COMMENT |
| LOW⚡ | kt-kernel/python/cli/utils/model_registry.py | 280 | # Check if query is contained in aliases | COMMENT |
| 41 more matches not shown… | ||||
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | archive/csrc/ktransformers_ext/examples/test_mlp.py | 39 | CODE | |
| LOW | archive/csrc/ktransformers_ext/examples/test_moe.py | 42 | CODE | |
| LOW | …ft/csrc/ktransformers_ext/examples/test_sft_amx_moe.py | 107 | CODE | |
| LOW | …ive/kt-sft/csrc/ktransformers_ext/examples/test_mlp.py | 39 | CODE | |
| LOW | …ive/kt-sft/csrc/ktransformers_ext/examples/test_moe.py | 42 | CODE | |
| LOW | …kt-sft/csrc/ktransformers_ext/examples/test_sft_moe.py | 66 | CODE | |
| LOW | archive/kt-sft/ktransformers/local_chat.py | 87 | CODE | |
| LOW | archive/kt-sft/ktransformers/operators/layernorm.py | 72 | CODE | |
| LOW | archive/kt-sft/ktransformers/operators/layernorm.py | 113 | CODE | |
| LOW | archive/kt-sft/ktransformers/operators/layernorm.py | 157 | CODE | |
| LOW | archive/kt-sft/ktransformers/operators/models.py | 215 | CODE | |
| LOW | archive/kt-sft/ktransformers/operators/models.py | 577 | CODE | |
| LOW | archive/kt-sft/ktransformers/operators/models.py | 1048 | CODE | |
| LOW | archive/kt-sft/ktransformers/operators/models.py | 1501 | CODE | |
| LOW | archive/kt-sft/ktransformers/operators/cpuinfer.py | 30 | CODE | |
| LOW | …ve/kt-sft/ktransformers/operators/dynamic_attention.py | 34 | CODE | |
| LOW | archive/kt-sft/ktransformers/operators/RoPE.py | 276 | CODE | |
| LOW | archive/kt-sft/ktransformers/util/utils.py | 344 | CODE | |
| LOW | archive/kt-sft/ktransformers/util/utils.py | 527 | CODE | |
| LOW | …kt-sft/ktransformers/server/balance_serve/sched_rpc.py | 181 | CODE | |
| LOW | …formers/server/balance_serve/inference/model_runner.py | 59 | CODE | |
| LOW | …ormers/server/balance_serve/inference/forward_batch.py | 198 | CODE | |
| LOW | …ive/kt-sft/ktransformers/models/configuration_llama.py | 143 | CODE | |
| LOW | archive/kt-sft/ktransformers/models/modeling_mixtral.py | 1124 | CODE | |
| LOW | archive/kt-sft/ktransformers/models/modeling_mixtral.py | 1373 | CODE | |
| LOW | archive/kt-sft/ktransformers/models/modeling_mixtral.py | 1563 | CODE | |
| LOW | archive/kt-sft/ktransformers/models/modeling_mixtral.py | 1686 | CODE | |
| LOW | …hive/kt-sft/ktransformers/models/modeling_qwen3_moe.py | 345 | CODE | |
| LOW | …hive/kt-sft/ktransformers/models/modeling_qwen3_moe.py | 679 | CODE | |
| LOW | …hive/kt-sft/ktransformers/models/modeling_qwen3_moe.py | 1074 | CODE | |
| LOW | …hive/kt-sft/ktransformers/models/modeling_qwen3_moe.py | 1217 | CODE | |
| LOW | …hive/kt-sft/ktransformers/models/modeling_qwen3_moe.py | 1328 | CODE | |
| LOW | …hive/kt-sft/ktransformers/models/modeling_qwen3_moe.py | 1405 | CODE | |
| LOW | …kt-sft/ktransformers/models/configuration_qwen2_moe.py | 115 | CODE | |
| LOW | …ve/kt-sft/ktransformers/models/modeling_deepseek_v3.py | 268 | CODE | |
| LOW | …ve/kt-sft/ktransformers/models/modeling_deepseek_v3.py | 1390 | CODE | |
| LOW | …ve/kt-sft/ktransformers/models/modeling_deepseek_v3.py | 1638 | CODE | |
| LOW | …ve/kt-sft/ktransformers/models/modeling_deepseek_v3.py | 1844 | CODE | |
| LOW | …hive/kt-sft/ktransformers/models/modeling_qwen2_moe.py | 1115 | CODE | |
| LOW | …hive/kt-sft/ktransformers/models/modeling_qwen2_moe.py | 1364 | CODE | |
| LOW | …hive/kt-sft/ktransformers/models/modeling_qwen2_moe.py | 1593 | CODE | |
| LOW | …hive/kt-sft/ktransformers/models/modeling_qwen2_moe.py | 1716 | CODE | |
| LOW | …kt-sft/ktransformers/models/configuration_qwen3_moe.py | 161 | CODE | |
| LOW | …chive/kt-sft/ktransformers/models/modeling_deepseek.py | 259 | CODE | |
| LOW | …chive/kt-sft/ktransformers/models/modeling_deepseek.py | 1424 | CODE | |
| LOW | …chive/kt-sft/ktransformers/models/modeling_deepseek.py | 1679 | CODE | |
| LOW | …chive/kt-sft/ktransformers/models/modeling_deepseek.py | 1899 | CODE | |
| LOW | archive/kt-sft/ktransformers/models/modeling_llama.py | 993 | CODE | |
| LOW | archive/kt-sft/ktransformers/models/modeling_llama.py | 1271 | CODE | |
| LOW | archive/kt-sft/ktransformers/models/modeling_llama.py | 1458 | CODE | |
| LOW | archive/kt-sft/ktransformers/models/modeling_llama.py | 1587 | CODE | |
| LOW | archive/kt-sft/ktransformers/models/modeling_llama.py | 1693 | CODE | |
| LOW | …-sft/ktransformers/models/configuration_deepseek_v3.py | 106 | CODE | |
| LOW | …/kt-sft/ktransformers/models/configuration_deepseek.py | 113 | CODE | |
| LOW | …formers/configs/model_config/configuration_deepseek.py | 115 | CODE | |
| LOW | …hive/kt-sft/ktransformers/sft/peft_utils/peft_model.py | 1403 | CODE | |
| LOW | …hive/kt-sft/ktransformers/sft/peft_utils/lora_layer.py | 475 | CODE | |
| LOW | …hive/kt-sft/ktransformers/sft/peft_utils/lora_layer.py | 564 | CODE | |
| LOW | …hive/kt-sft/ktransformers/sft/peft_utils/lora_layer.py | 1014 | CODE | |
| LOW | archive/ktransformers/local_chat_test.py | 55 | CODE | |
| 85 more matches not shown… | ||||
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | kt-kernel/operators/moe-sft-tp.hpp | 355 | // Step 1: For each NUMA, allocate and copy partitioned weights | COMMENT |
| LOW⚡ | kt-kernel/operators/moe-sft-tp.hpp | 394 | // Step 2: Set weight pointers BEFORE load_weights (Bug #24 fix) | COMMENT |
| LOW⚡ | kt-kernel/operators/moe-sft-tp.hpp | 402 | // Step 3: Prepare backward weights (this also clears weight pointers) | COMMENT |
| LOW⚡ | kt-kernel/operators/amx/sft_moe.hpp | 1108 | // Step 4: Quantize input | COMMENT |
| LOW⚡ | kt-kernel/operators/amx/sft_moe.hpp | 1114 | // Step 5: Gate + Up GEMM (base projection) | COMMENT |
| LOW⚡ | kt-kernel/operators/amx/sft_moe.hpp | 1274 | // Step 7: Quantize intermediate for down projection | COMMENT |
| LOW⚡ | kt-kernel/operators/amx/sft_moe.hpp | 1283 | // Step 8: Down GEMM | COMMENT |
| LOW⚡ | kt-kernel/operators/amx/sft_moe.hpp | 3751 | // Step 1: intermediate = input @ lora_A^T (optimized with T_BLOCK=4, R_BLOCK=4) | COMMENT |
| LOW⚡ | kt-kernel/operators/amx/sft_moe.hpp | 3757 | // Step 2: output += scale * (intermediate @ lora_B_transposed) | COMMENT |
| LOW⚡ | kt-kernel/operators/amx/sft_moe.hpp | 4223 | // Step 1: Zero per-expert grad_output buffers | COMMENT |
| LOW⚡ | kt-kernel/operators/amx/sft_moe.hpp | 4233 | // Step 2: Scatter grad_output to per-expert BF16 buffers | COMMENT |
| LOW⚡ | kt-kernel/operators/amx/sft_moe.hpp | 4368 | // Step 1: grad_output @ down_lora_B_transposed -> [local_num_tokens, rank] | COMMENT |
| LOW⚡ | kt-kernel/operators/amx/sft_moe.hpp | 4375 | // Step 2: grad_times_b @ down_lora_A -> [local_num_tokens, inter_size] (AVX512) | COMMENT |
| LOW⚡ | kt-kernel/operators/amx/sft_moe.hpp | 4385 | // Step 5: LoRA gradient computation (parallelized across blocks) | COMMENT |
| LOW | kt-kernel/operators/amx/sft_moe.hpp | 952 | // Step 1: Expert routing (reuse base class logic) | COMMENT |
| LOW | kt-kernel/operators/amx/sft_moe.hpp | 971 | // Step 2: Buffer pool allocation (reuse base class logic) | COMMENT |
| LOW | kt-kernel/operators/amx/sft_moe.hpp | 1073 | // Step 3: Copy input to expert buffers | COMMENT |
| LOW | kt-kernel/operators/amx/sft_moe.hpp | 1219 | // Step 6: Activation (silu(gate) * up) | COMMENT |
| LOW | kt-kernel/operators/amx/sft_moe.hpp | 1335 | // Step 9: Weighted merge | COMMENT |
| LOW | kt-kernel/operators/amx/sft_moe.hpp | 1549 | // Step 1: Down projection backward | COMMENT |
| LOW | kt-kernel/operators/amx/sft_moe.hpp | 1711 | // Step 4: Compute grad_weights (gradient for routing weights) | COMMENT |
| LOW | kt-kernel/operators/amx/sft_moe.hpp | 3368 | // Step 1: input @ lora_A^T -> lora_intermediate | COMMENT |
| LOW | kt-kernel/operators/amx/sft_moe.hpp | 3400 | // Step 2: Quantize lora_intermediate to BufferA | COMMENT |
| LOW | kt-kernel/operators/amx/sft_moe.hpp | 3533 | // Step 1: intermediate @ down_lora_A^T -> lora_intermediate | COMMENT |
| LOW | kt-kernel/operators/amx/sft_moe.hpp | 3560 | // Step 2: Quantize lora_intermediate to BufferA | COMMENT |
| LOW | kt-kernel/operators/amx/sft_moe.hpp | 3812 | // Step 1: intermediate = input @ lora_A^T (optimized with T_BLOCK=4, R_BLOCK=4) | COMMENT |
| LOW | kt-kernel/operators/amx/sft_moe.hpp | 3823 | // Step 2: output += scale * (intermediate @ lora_B_transposed) | COMMENT |
| LOW | kt-kernel/operators/amx/sft_moe.hpp | 4278 | // Step 3: Quantize scattered grad_output to BufferA | COMMENT |
| LOW | kt-kernel/operators/amx/sft_moe.hpp | 5383 | // Step 6: grad_A = G_B^T @ X | COMMENT |
| LOW | kt-kernel/operators/amx/test/test_lora_fused_add.cpp | 1657 | // Step 1: Reduce 512 -> 256 by adding high/low halves (8 ops) | COMMENT |
| LOW⚡ | kt-kernel/operators/amx/test/test_lora_fused_add.cpp | 1671 | // Step 2: Pack pairs into single 512-bit vectors | COMMENT |
| LOW⚡ | kt-kernel/operators/amx/test/test_lora_fused_add.cpp | 1679 | // Step 3: Reduce 256 -> 128 within each pair | COMMENT |
| LOW⚡ | kt-kernel/operators/amx/test/test_lora_fused_add.cpp | 1686 | // Step 4: Reduce 128 -> 64 -> 32 within each | COMMENT |
| LOW⚡ | kt-kernel/operators/amx/la/avx_kernels.hpp | 924 | // Step 1: Interleave 16-bit | COMMENT |
| LOW⚡ | kt-kernel/operators/amx/la/avx_kernels.hpp | 934 | // Step 2: Interleave 32-bit | COMMENT |
| LOW⚡ | kt-kernel/operators/amx/la/avx_kernels.hpp | 944 | // Step 3: Interleave 64-bit | COMMENT |
| LOW | kt-kernel/operators/amx/la/avx_kernels.hpp | 985 | // Step 1: Interleave 16-bit | COMMENT |
| LOW | kt-kernel/operators/amx/la/avx_kernels.hpp | 1003 | // Step 2: Interleave 32-bit | COMMENT |
| LOW | kt-kernel/operators/amx/la/avx_kernels.hpp | 1021 | // Step 3: Interleave 64-bit | COMMENT |
| LOW | kt-kernel/operators/amx/la/avx_kernels.hpp | 1039 | // Step 4: Permute 128-bit lanes | COMMENT |
| LOW | kt-kernel/python/cli/utils/quant_interactive.py | 245 | # Step 1: Select model | COMMENT |
| LOW⚡ | kt-kernel/python/cli/utils/quant_interactive.py | 260 | # Step 2: Configure quantization method | COMMENT |
| LOW⚡ | kt-kernel/python/cli/utils/quant_interactive.py | 263 | # Step 3: Configure CPU parameters | COMMENT |
| LOW⚡ | kt-kernel/python/cli/utils/quant_interactive.py | 266 | # Step 4: Configure output path | COMMENT |
| LOW | kt-kernel/python/cli/utils/quant_interactive.py | 288 | # Step 5: Calculate space requirements and check availability | COMMENT |
| LOW⚡ | kt-kernel/python/cli/utils/run_interactive.py | 893 | # Step 1: Select model | COMMENT |
| LOW⚡ | kt-kernel/python/cli/utils/run_interactive.py | 898 | # Step 2: Select inference method | COMMENT |
| LOW⚡ | kt-kernel/python/cli/utils/run_interactive.py | 993 | # Step 3: Configure NUMA and CPU | COMMENT |
| LOW⚡ | kt-kernel/python/cli/utils/run_interactive.py | 996 | # Step 4: Configure GPU experts | COMMENT |
| LOW⚡ | kt-kernel/python/cli/utils/run_interactive.py | 999 | # Step 5: Configure KV Cache (only for raw) | COMMENT |
| LOW⚡ | kt-kernel/python/cli/utils/run_interactive.py | 1003 | # Step 6: Select GPUs and TP | COMMENT |
| LOW⚡ | kt-kernel/python/cli/utils/run_interactive.py | 1008 | # Step 7: Configure parsers (optional) | COMMENT |
| LOW⚡ | kt-kernel/python/cli/utils/run_interactive.py | 1011 | # Step 8: Configure host and port | COMMENT |
| LOW | kt-kernel/python/cli/utils/run_interactive.py | 1035 | # Step 9: Save configuration | COMMENT |
| LOW⚡ | kt-kernel/python/cli/commands/run.py | 330 | # Step 2: Resolve model | COMMENT |
| LOW | kt-kernel/python/cli/commands/run.py | 390 | # Step 3: Check quantized weights (only if explicitly requested) | COMMENT |
| LOW | kt-kernel/python/cli/commands/run.py | 414 | # Step 4: Build command | COMMENT |
| LOW | kt-kernel/python/cli/commands/run.py | 514 | # Step 5: Show configuration summary | COMMENT |
| LOW | kt-kernel/python/cli/commands/run.py | 544 | # Step 6: Show or execute | COMMENT |
| LOW⚡ | kt-kernel/python/cli/commands/model.py | 2583 | # Step 1: Delete the corrupted/missing file if it exists | COMMENT |
| 8 more matches not shown… | ||||
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| HIGH | archive/csrc/custom_marlin/utils/format24.py | 142 | -1, idxs0.unsqueeze(-1)) # type: ignore[possibly-undefined] | CODE |
| HIGH | archive/csrc/custom_marlin/utils/format24.py | 149 | k // 2) # type: ignore[possibly-undefined] | CODE |
| HIGH | archive/csrc/custom_marlin/utils/format24.py | 172 | (m * meta_ncols, )) # type: ignore[possibly-undefined] | CODE |
| HIGH | archive/kt-sft/csrc/custom_marlin/utils/format24.py | 142 | -1, idxs0.unsqueeze(-1)) # type: ignore[possibly-undefined] | CODE |
| HIGH | archive/kt-sft/csrc/custom_marlin/utils/format24.py | 149 | k // 2) # type: ignore[possibly-undefined] | CODE |
| HIGH | archive/kt-sft/csrc/custom_marlin/utils/format24.py | 172 | (m * meta_ncols, )) # type: ignore[possibly-undefined] | CODE |
| HIGH | …xt/operators/custom_marlin/quantize/utils/format_24.py | 142 | -1, idxs0.unsqueeze(-1)) # type: ignore[possibly-undefined] | CODE |
| HIGH | …xt/operators/custom_marlin/quantize/utils/format_24.py | 149 | k // 2) # type: ignore[possibly-undefined] | CODE |
| HIGH | …xt/operators/custom_marlin/quantize/utils/format_24.py | 172 | (m * meta_ncols, )) # type: ignore[possibly-undefined] | CODE |
| HIGH | …hive/kt-sft/ktransformers/sft/peft_utils/peft_model.py | 1393 | trainable params: 1843200 || all params: 775873280 || trainable%: 0.23756456724479544 | STRING |
| HIGH | …xt/operators/custom_marlin/quantize/utils/format_24.py | 142 | -1, idxs0.unsqueeze(-1)) # type: ignore[possibly-undefined] | CODE |
| HIGH | …xt/operators/custom_marlin/quantize/utils/format_24.py | 149 | k // 2) # type: ignore[possibly-undefined] | CODE |
| HIGH | …xt/operators/custom_marlin/quantize/utils/format_24.py | 172 | (m * meta_ncols, )) # type: ignore[possibly-undefined] | CODE |
| HIGH | kt-kernel/python/cli/i18n.py | 306 | "sglang_recommend_source": "Recommend reinstalling with the kvcache-ai fork: pip uninstall sglang -y && pip inst | CODE |
| HIGH | kt-kernel/python/cli/i18n.py | 926 | "sglang_recommend_source": "建议重新安装 kvcache-ai 分支: pip uninstall sglang -y && pip install sglang-kt", | CODE |
| HIGH | kt-kernel/python/cli/commands/doctor.py | 426 | kt_kernel_hint = "Reinstall SGLang: pip uninstall sglang -y && pip install sglang-kt (or run ./install.sh fr | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | …chive/kt-sft/ktransformers/models/modeling_deepseek.py | 165 | CODE | |
| MEDIUM | …chive/kt-sft/ktransformers/models/modeling_deepseek.py | 166 | CODE | |
| MEDIUM | …chive/kt-sft/ktransformers/models/modeling_deepseek.py | 195 | CODE | |
| MEDIUM | …chive/kt-sft/ktransformers/models/modeling_deepseek.py | 196 | CODE | |
| MEDIUM | archive/ktransformers/models/modeling_deepseek.py | 164 | CODE | |
| MEDIUM | archive/ktransformers/models/modeling_deepseek.py | 165 | CODE | |
| MEDIUM | archive/ktransformers/models/modeling_deepseek.py | 194 | CODE | |
| MEDIUM | archive/ktransformers/models/modeling_deepseek.py | 195 | CODE | |
| MEDIUM | kt-kernel/python/cli/commands/bench.py | 131 | CODE | |
| MEDIUM | kt-kernel/python/cli/commands/bench.py | 133 | CODE | |
| MEDIUM | kt-kernel/python/cli/commands/bench.py | 137 | CODE | |
| MEDIUM | kt-kernel/python/cli/commands/bench.py | 140 | CODE | |
| MEDIUM | kt-kernel/python/cli/commands/bench.py | 148 | CODE | |
| MEDIUM | kt-kernel/python/cli/commands/bench.py | 149 | CODE | |
| MEDIUM | kt-kernel/python/cli/commands/bench.py | 154 | CODE | |
| MEDIUM | kt-kernel/python/cli/commands/bench.py | 155 | CODE | |
| MEDIUM | kt-kernel/python/cli/commands/bench.py | 160 | CODE | |
| MEDIUM | kt-kernel/python/cli/commands/bench.py | 173 | CODE | |
| MEDIUM | kt-kernel/python/cli/commands/bench.py | 176 | CODE | |
| MEDIUM | kt-kernel/python/cli/commands/bench.py | 177 | CODE | |
| MEDIUM | kt-kernel/python/cli/commands/bench.py | 179 | CODE | |
| MEDIUM | kt-kernel/examples/test_mla.py | 298 | CODE | |
| MEDIUM | kt-kernel/examples/test_mla.py | 300 | CODE | |
| MEDIUM | kt-kernel/examples/test_mla.py | 301 | CODE | |
| MEDIUM | kt-kernel/examples/test_mla.py | 302 | CODE | |
| MEDIUM | kt-kernel/examples/test_mla.py | 307 | CODE | |
| MEDIUM | kt-kernel/examples/test_mla.py | 309 | CODE | |
| MEDIUM | kt-kernel/examples/test_mla.py | 310 | CODE | |
| MEDIUM | kt-kernel/examples/test_mla.py | 311 | CODE | |
| MEDIUM | kt-kernel/examples/test_gate.py | 40 | CODE | |
| MEDIUM | kt-kernel/examples/test_gate.py | 42 | CODE | |
| MEDIUM | kt-kernel/examples/test_gate.py | 43 | CODE | |
| MEDIUM | kt-kernel/examples/test_gate.py | 44 | CODE | |
| MEDIUM | kt-kernel/examples/test_mla_quant.py | 32 | CODE | |
| MEDIUM | kt-kernel/examples/test_mla_quant.py | 34 | CODE | |
| MEDIUM | kt-kernel/examples/test_mla_quant.py | 35 | CODE | |
| MEDIUM | kt-kernel/examples/test_mla_quant.py | 36 | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | archive/csrc/balance_serve/kvc2/test/pytest_load.py | 8 | # Create a kvc2 instance | COMMENT |
| MEDIUM | …/balance_serve/kvc2/test/pytest_raw_insert_and_read.py | 8 | # Create a kvc2 instance | COMMENT |
| MEDIUM | archive/csrc/balance_serve/kvc2/test/pytest_mem_read.py | 8 | # Create a kvc2 instance | COMMENT |
| MEDIUM | …csrc/balance_serve/kvc2/test/pytest_mem_prefix_test.py | 8 | # Create a kvc2 instance | COMMENT |
| MEDIUM | archive/csrc/custom_marlin/utils/quant_utils.py | 41 | # Create a tensor for bitwise right shift operation | COMMENT |
| MEDIUM | archive/kt-sft/csrc/custom_marlin/utils/quant_utils.py | 41 | # Create a tensor for bitwise right shift operation | COMMENT |
| MEDIUM⚡ | archive/kt-sft/ktransformers/util/custom_loader.py | 552 | # Create the appropriate loader based on detected file types | COMMENT |
| MEDIUM | archive/kt-sft/ktransformers/util/utils.py | 266 | # This function is to check if we run this model on XPU with FP16 dtype | COMMENT |
| MEDIUM | …/balance_serve/inference/distributed/pynccl_wrapper.py | 1 | # This file is a pure Python wrapper for the NCCL library. | COMMENT |
| MEDIUM⚡ | archive/ktransformers/util/custom_loader.py | 579 | # Create the appropriate loader based on detected file types | COMMENT |
| MEDIUM | archive/ktransformers/util/utils.py | 324 | # This function is to check if we run this model on XPU with FP16 dtype | COMMENT |
| MEDIUM | …/balance_serve/inference/distributed/pynccl_wrapper.py | 1 | # This file is a pure Python wrapper for the NCCL library. | COMMENT |
| MEDIUM | kt-kernel/python/experts.py | 82 | # Create a mask where experts 0, 2, 5 are on GPU | STRING |
| MEDIUM | kt-kernel/python/experts_base.py | 288 | # Create a new pinned tensor and copy data into it | COMMENT |
| MEDIUM | kt-kernel/python/utils/llamafile.py | 122 | # Initialize base class | COMMENT |
| MEDIUM | kt-kernel/python/utils/moe_kernel.py | 86 | # Initialize base class | COMMENT |
| MEDIUM | kt-kernel/python/utils/amx.py | 281 | # Initialize base class | COMMENT |
| MEDIUM | kt-kernel/python/cli/main.py | 47 | # Create main app with dynamic help | COMMENT |
| MEDIUM | kt-kernel/python/cli/utils/user_model_registry.py | 88 | self.save() # Create the file | CODE |
| MEDIUM | kt-kernel/python/cli/commands/model.py | 899 | # Create a sub-row with empty cells except for the first column (7 columns total with #) | COMMENT |
| MEDIUM | kt-kernel/python/cli/commands/model.py | 948 | # Create a sub-row with empty cells except for the first column | COMMENT |
| MEDIUM | kt-kernel/python/sft/weights.py | 171 | # Create a CPU tensor with the correct shape but NO physical memory. | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| HIGH | archive/kt-sft/ktransformers/util/custom_loader.py | 509 | Create a model loader for the given path by detecting the model format. The function checks for the pre | STRING |
| HIGH | …-sft/ktransformers/ktransformers_ext/triton/fp8gemm.py | 86 | Dequantizes the given weight tensor using the provided scale tensor. Args: x (torch.Tensor): The quant | STRING |
| HIGH | …hive/kt-sft/ktransformers/sft/peft_utils/peft_model.py | 935 | Get the status of each adapter layer in the model. This method returns a list of `TunerLayerStatus` dataclass i | STRING |
| HIGH | …hive/kt-sft/ktransformers/sft/peft_utils/peft_model.py | 965 | Get the status of tuners of the model. This method returns a `TunerModelStatus` dataclass instance, which conta | STRING |
| HIGH | …hive/kt-sft/ktransformers/sft/peft_utils/peft_model.py | 1663 | Get the status of each adapter layer in the model. This function returns a list of `TunerLayerStatus` dataclass ins | STRING |
| HIGH | …hive/kt-sft/ktransformers/sft/peft_utils/peft_model.py | 1781 | Get the status of tuners of the model. This function returns a `TunerModelStatus` dataclass instance, which contain | STRING |
| HIGH | archive/ktransformers/util/custom_loader.py | 536 | Create a model loader for the given path by detecting the model format. The function checks for the pre | STRING |
| HIGH | …hive/ktransformers/ktransformers_ext/triton/fp8gemm.py | 86 | Dequantizes the given weight tensor using the provided scale tensor. Args: x (torch.Tensor): The quant | STRING |
| HIGH | kt-kernel/python/_cpu_detect.py | 166 | Load the appropriate kt_kernel_ext variant. Tries to import the specified variant, with automatic fallback to | STRING |
| HIGH | kt-kernel/python/experts.py | 157 | Factory method to create the appropriate backend implementation. Args: layer_idx: Layer in | STRING |
| HIGH | kt-kernel/python/cli/utils/tuna_engine.py | 21 | Get the number of experts per layer from model config. Args: model_path: Path to the model directory | STRING |
| HIGH | kt-kernel/python/cli/utils/tuna_engine.py | 397 | Run tuna auto-tuning to find optimal num_gpu_experts. Args: model_path: Path to the model tens | STRING |
| HIGH | kt-kernel/python/sft/arch.py | 63 | Get MoE architecture configuration based on model type. Args: config: HuggingFace model configuration | STRING |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | …hive/kt-sft/ktransformers/sft/peft_utils/peft_model.py | 831 | # TODO: consider replacing this patching of methods with a more robust mechanism: setting a flag and | COMMENT |
| LOW | …hive/kt-sft/ktransformers/sft/peft_utils/lora_model.py | 128 | # model, just add a `peft_config` dict attribute to your model. | COMMENT |
| LOW | …ive/ktransformers/operators/ascend/ascend_attention.py | 215 | # FIXME this is wrong in random choose pages for sched, currently just use kv without history | COMMENT |
| MEDIUM | archive/ktransformers/models/modeling_smallthinker.py | 1051 | # "unexpected if using padding tokens in conjunction with `inputs_embeds.`" | COMMENT |
| MEDIUM | kt-kernel/bench/compare_moe_performance.py | 291 | """Get comprehensive system information""" | STRING |
| MEDIUM | kt-kernel/operators/amx/sft_moe.hpp | 93 | // Check BF16 buffer for NaN/Inf (using robust v != v check) | COMMENT |
| MEDIUM | kt-kernel/operators/amx/sft_moe.hpp | 98 | // Use val != val for robust NaN detection | COMMENT |
| MEDIUM | kt-kernel/operators/amx/sft_moe.hpp | 120 | // Check FP32 buffer for NaN/Inf (using robust v != v check) | COMMENT |
| MEDIUM | kt-kernel/operators/amx/sft_moe.hpp | 125 | // Use val != val for robust NaN detection | COMMENT |
| MEDIUM | kt-kernel/operators/amx/sft_moe.hpp | 1437 | // Use v != v for robust NaN detection | COMMENT |
| MEDIUM | kt-kernel/operators/amx/sft_moe.hpp | 1789 | // Use v != v for robust NaN detection | COMMENT |
| MEDIUM | kt-kernel/operators/amx/sft_moe.hpp | 1829 | // Use fv != fv for robust NaN detection | COMMENT |
| MEDIUM | kt-kernel/operators/amx/sft_moe.hpp | 1949 | // Use v != v for robust NaN detection | COMMENT |
| MEDIUM | kt-kernel/operators/amx/test/mmq.cpp | 689 | // pack again with 128 to fully utilize vector length | COMMENT |
| MEDIUM | kt-kernel/operators/amx/test/mmq.cpp | 731 | // pack again with 128 to fully utilize vector length | COMMENT |
| MEDIUM | kt-kernel/operators/amx/test/mmq.cpp | 833 | // pack again with 128 to fully utilize vector length | COMMENT |
| MEDIUM | kt-kernel/operators/amx/test/mmq-test.cpp | 693 | // pack again with 128 to fully utilize vector length | COMMENT |
| MEDIUM | kt-kernel/operators/amx/test/mmq-test.cpp | 735 | // pack again with 128 to fully utilize vector length | COMMENT |
| MEDIUM | kt-kernel/operators/amx/test/mmq-test.cpp | 837 | // pack again with 128 to fully utilize vector length | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| CRITICAL⚡ | …sformers/models/ascend/custom_ascend_modeling_qwen3.py | 70 | self.model.embed_tokens.weight.data = self.model.embed_tokens.weight.data.to(torch.float16) | CODE |
| CRITICAL⚡ | …sformers/models/ascend/custom_ascend_modeling_qwen3.py | 73 | self.model.norm.weight.data = self.model.norm.weight.data.to(torch.float16) | CODE |
| CRITICAL⚡ | …sformers/models/ascend/custom_ascend_modeling_qwen3.py | 75 | self.model.norm.bias.data = self.model.norm.bias.data.to(torch.float16) | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | ktransformers.py | 35 | __all__ = ["__version__", "has_sft_support"] | CODE |
| LOW | archive/kt-sft/ktransformers/operators/layernorm.py | 40 | logger = logging.getLogger(__name__) | CODE |
| LOW | …serve/inference/distributed/custom_all_reduce_utils.py | 266 | __all__ = ["gpu_p2p_access_check"] | CODE |
| LOW | …/balance_serve/inference/distributed/pynccl_wrapper.py | 273 | __all__ = [ | CODE |
| LOW | …ers/server/balance_serve/inference/sampling/sampler.py | 18 | logger = logging.getLogger(__name__) | CODE |
| LOW | …alance_serve/inference/sampling/penaltylib/__init__.py | 7 | __all__ = [ | CODE |
| LOW | …hive/kt-sft/ktransformers/models/modeling_qwen3_moe.py | 1466 | __all__ = [ | STRING |
| LOW | …kt-sft/ktransformers/models/configuration_qwen3_moe.py | 233 | __all__ = ["Qwen3MoeConfig"] | CODE |
| LOW | …hive/kt-sft/ktransformers/sft/peft_utils/peft_model.py | 1268 | def set_adapter(self, adapter_name: str) -> None: | CODE |
| LOW | …hive/kt-sft/ktransformers/sft/peft_utils/lora_layer.py | 168 | def set_adapter(self, adapter_names: str | list[str]) -> None: | CODE |
| LOW | …hive/kt-sft/ktransformers/sft/peft_utils/lora_model.py | 38 | logger = logging.getLogger(__name__) | CODE |
| LOW | …hive/kt-sft/ktransformers/sft/peft_utils/lora_model.py | 375 | def _set_adapter_layers(self, enabled: bool = True) -> None: | STRING |
| LOW | …hive/kt-sft/ktransformers/sft/peft_utils/lora_model.py | 397 | # def set_adapter(self, adapter_names: str | list[str]) -> None: | STRING |
| LOW | archive/ktransformers/operators/layernorm.py | 43 | logger = logging.getLogger(__name__) | CODE |
| LOW | …serve/inference/distributed/custom_all_reduce_utils.py | 266 | __all__ = ["gpu_p2p_access_check"] | CODE |
| LOW | …/balance_serve/inference/distributed/pynccl_wrapper.py | 273 | __all__ = [ | CODE |
| LOW | …ers/server/balance_serve/inference/sampling/sampler.py | 23 | logger = logging.getLogger(__name__) | CODE |
| LOW | …alance_serve/inference/sampling/penaltylib/__init__.py | 7 | __all__ = [ | CODE |
| LOW | archive/ktransformers/models/modeling_smallthinker.py | 1214 | __all__ = [ | CODE |
| LOW | archive/ktransformers/models/modeling_qwen3_moe.py | 1465 | __all__ = [ | STRING |
| LOW | archive/ktransformers/models/modeling_glm4_moe.py | 649 | __all__ = ["Glm4MoePreTrainedModel", "Glm4MoeModel", "Glm4MoeForCausalLM"] | CODE |
| LOW | archive/ktransformers/models/configuration_glm4_moe.py | 242 | __all__ = ["Glm4MoeConfig"] | CODE |
| LOW | …chive/ktransformers/models/configuration_qwen3_next.py | 263 | __all__ = ["Qwen3NextConfig"] | STRING |
| LOW | archive/ktransformers/models/configuration_qwen3_moe.py | 233 | __all__ = ["Qwen3MoeConfig"] | CODE |
| LOW | …ive/ktransformers/models/configuration_smallthinker.py | 180 | __all__ = ["SmallthinkerConfig"] | CODE |
| LOW | archive/ktransformers/models/modeling_qwen3_next.py | 1280 | __all__ = [ | CODE |
| LOW | kt-kernel/bench/compare_moe_performance.py | 26 | logger = logging.getLogger(__name__) | CODE |
| LOW | kt-kernel/python/__init__.py | 96 | __all__ = ["KTMoEWrapper", "AMXSFTMoEWrapper", "generate_gpu_experts_masks", "kt_kernel_ext", "__cpu_variant__", "__vers | CODE |
| LOW | kt-kernel/python/utils/__init__.py | 11 | __all__ = [ | CODE |
| LOW | kt-kernel/python/utils/amx.py | 8 | logger = logging.getLogger(__name__) | CODE |
| LOW | kt-kernel/python/cli/i18n.py | 1336 | def set_lang(lang: str) -> None: | CODE |
| LOW | kt-kernel/python/cli/main.py | 57 | def _update_help_texts() -> None: | CODE |
| LOW | kt-kernel/python/cli/config/__init__.py | 7 | __all__ = ["Settings", "get_settings"] | CODE |
| LOW⚡ | kt-kernel/python/sft/wrapper.py | 32 | logger = logging.getLogger(__name__) | CODE |
| LOW⚡ | kt-kernel/python/sft/arch.py | 18 | logger = logging.getLogger(__name__) | CODE |
| LOW | kt-kernel/python/sft/__init__.py | 48 | __all__ = [ | CODE |
| LOW | kt-kernel/python/sft/autograd.py | 21 | logger = logging.getLogger(__name__) | CODE |
| LOW | kt-kernel/python/sft/layer.py | 32 | logger = logging.getLogger(__name__) | CODE |
| LOW⚡ | kt-kernel/python/sft/lora.py | 26 | logger = logging.getLogger(__name__) | CODE |
| LOW | kt-kernel/python/sft/weights.py | 19 | logger = logging.getLogger(__name__) | CODE |
| LOW | kt-kernel/python/sft/base.py | 226 | def update_lora_weights(self) -> None: | CODE |
| LOW | kt-kernel/python/sft/amx.py | 467 | def update_lora_weights(self) -> None: | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | archive/kt-sft/ktransformers/operators/experts.py | 969 | # the current expert. We need to make sure to multiply the output hidden | COMMENT |
| LOW | archive/kt-sft/ktransformers/operators/experts.py | 1126 | # the current expert. We need to make sure to multiply the output hidden | COMMENT |
| LOW | archive/kt-sft/ktransformers/operators/experts.py | 1475 | # the current expert. We need to make sure to multiply the output hidden | COMMENT |
| LOW | archive/kt-sft/ktransformers/operators/experts.py | 1771 | # the current expert. We need to make sure to multiply the output hidden | COMMENT |
| LOW | archive/kt-sft/ktransformers/models/modeling_mixtral.py | 878 | # the current expert. We need to make sure to multiply the output hidden | COMMENT |
| LOW | archive/kt-sft/ktransformers/models/modeling_mixtral.py | 1465 | loss += self.router_aux_loss_coef * aux_loss.to(loss.device) # make sure to reside in the same device | CODE |
| LOW | …hive/kt-sft/ktransformers/models/modeling_qwen3_moe.py | 292 | # the current expert. We need to make sure to multiply the output hidden | COMMENT |
| LOW | …hive/kt-sft/ktransformers/models/modeling_qwen3_moe.py | 1166 | loss += self.router_aux_loss_coef * aux_loss.to(loss.device) # make sure to reside in the same device | CODE |
| LOW | …hive/kt-sft/ktransformers/models/modeling_qwen2_moe.py | 848 | # the current expert. We need to make sure to multiply the output hidden | COMMENT |
| LOW | …hive/kt-sft/ktransformers/models/modeling_qwen2_moe.py | 1455 | loss += self.router_aux_loss_coef * aux_loss.to(loss.device) # make sure to reside in the same device | CODE |
| LOW | archive/ktransformers/operators/experts.py | 547 | # the current expert. We need to make sure to multiply the output hidden | COMMENT |
| LOW | archive/ktransformers/operators/experts.py | 665 | # the current expert. We need to make sure to multiply the output hidden | COMMENT |
| LOW | archive/ktransformers/operators/experts.py | 863 | # the current expert. We need to make sure to multiply the output hidden | COMMENT |
| LOW | archive/ktransformers/operators/experts.py | 1161 | # the current expert. We need to make sure to multiply the output hidden | COMMENT |
| LOW | archive/ktransformers/models/modeling_smallthinker.py | 116 | # the current expert. We need to make sure to multiply the output hidden | COMMENT |
| LOW | archive/ktransformers/models/modeling_smallthinker.py | 956 | loss += self.router_aux_loss_coef * aux_loss.to(loss.device) # make sure to reside in the same device | CODE |
| LOW | archive/ktransformers/models/modeling_mixtral.py | 877 | # the current expert. We need to make sure to multiply the output hidden | COMMENT |
| LOW | archive/ktransformers/models/modeling_mixtral.py | 1464 | loss += self.router_aux_loss_coef * aux_loss.to(loss.device) # make sure to reside in the same device | CODE |
| LOW | archive/ktransformers/models/modeling_qwen3_moe.py | 291 | # the current expert. We need to make sure to multiply the output hidden | COMMENT |
| LOW | archive/ktransformers/models/modeling_qwen3_moe.py | 1165 | loss += self.router_aux_loss_coef * aux_loss.to(loss.device) # make sure to reside in the same device | CODE |
| LOW | archive/ktransformers/models/modeling_qwen2_moe.py | 847 | # the current expert. We need to make sure to multiply the output hidden | COMMENT |
| LOW | archive/ktransformers/models/modeling_qwen2_moe.py | 1454 | loss += self.router_aux_loss_coef * aux_loss.to(loss.device) # make sure to reside in the same device | CODE |
| MEDIUM | archive/ktransformers/models/custom_cache.py | 372 | # you can use following code as check | COMMENT |
| LOW | archive/ktransformers/models/modeling_qwen3_next.py | 853 | # the current expert. We need to make sure to multiply the output hidden | COMMENT |
| LOW | archive/ktransformers/models/modeling_qwen3_next.py | 1255 | loss += self.router_aux_loss_coef * aux_loss.to(loss.device) # make sure to reside in the same device | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | …c/ktransformers_ext/operators/kvcache/kvcache_attn.cpp | 2248 | // window_size=(-1, -1), # -1 means infinite context window | COMMENT |
| MEDIUM | …ive/csrc/ktransformers_ext/operators/kvcache/kvcache.h | 708 | // window_size=(-1, -1), # -1 means infinite context window | COMMENT |
| MEDIUM | …c/ktransformers_ext/operators/kvcache/kvcache_attn.cpp | 2248 | // window_size=(-1, -1), # -1 means infinite context window | COMMENT |
| MEDIUM | …sft/csrc/ktransformers_ext/operators/kvcache/kvcache.h | 708 | // window_size=(-1, -1), # -1 means infinite context window | COMMENT |
| MEDIUM⚡ | archive/kt-sft/ktransformers/util/custom_gguf.py | 710 | # NOT fine-tun embedding model | COMMENT |
| MEDIUM⚡ | archive/kt-sft/ktransformers/util/custom_gguf.py | 710 | # NOT fine-tun embedding model | COMMENT |
| MEDIUM | kt-kernel/operators/kvcache/kvcache_attn.cpp | 1602 | // window_size=(-1, -1), # -1 means infinite context window | COMMENT |
| MEDIUM | kt-kernel/operators/kvcache/kvcache.h | 619 | // window_size=(-1, -1), # -1 means infinite context window | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| HIGH | archive/setup.py | 551 | # In this example, we pass in the version to C++. You might not need to. | COMMENT |
| HIGH | archive/kt-sft/setup.py | 568 | # In this example, we pass in the version to C++. You might not need to. | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| HIGH | kt-kernel/examples/test_moe_amx.py | 428 | # Only test BF16 and INT8 as requested | COMMENT |
| HIGH | kt-kernel/examples/test_moe_amx.py | 486 | # Only test BF16 and INT8 as requested | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | docker/build-docker-tar.sh | 15 | # Usage: | COMMENT |
| LOW | docker/push-to-dockerhub.sh | 16 | # Usage: | COMMENT |
| LOW | docker/push-to-dockerhub.sh | 588 | # Usage: | COMMENT |
| LOW | …hive/csrc/balance_serve/kvc2/test/test_cuda_stream.cpp | 86 | // Example usage | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | …chive/kt-sft/ktransformers/tests/function_call_test.py | 12 | api_key="placeholder", | CODE |
| LOW | archive/ktransformers/tests/function_call_test.py | 12 | api_key="placeholder", | CODE |