ggml-org/ggml
Tensor library for machine learning
The score is jscpd's own --health model: markup, data and text left out, tests kept. The numbers below are the trending scan's.
Most complex files
- src/ggml-vulkan/ggml-vulkan.cpp4774 cx
- src/ggml-hexagon/htp-kparams.cpp2016 cx
- tests/test-backend-ops.cpp2016 cx
- src/ggml-cpu/ops.cpp1863 cx
- examples/stb_image.h1746 cx
- src/ggml-sycl/ggml-sycl.cpp1736 cx
- src/ggml-quants.c1204 cx
- src/ggml.c1161 cx
- src/ggml-cpu/llamafile/sgemm.cpp964 cx
- src/ggml-cpu/repack.cpp911 cx
Dead code 0% unused · 0 findings
No dead code found — everything here is reachable.
The code number leaves out tests, fixtures, docs, examples, data files, styles, translations and vendored code, and 47 generated files: examples/python/ggml/cffi.py, src/ggml-sycl/template-instances/fattn-tile-instance-dkq112-dv112.cpp, src/ggml-sycl/template-instances/fattn-tile-instance-dkq128-dv128.cpp, src/ggml-sycl/template-instances/fattn-tile-instance-dkq256-dv256.cpp, src/ggml-sycl/template-instances/fattn-tile-instance-dkq40-dv40.cpp, src/ggml-sycl/template-instances/fattn-tile-instance-dkq512-dv512.cpp, src/ggml-sycl/template-instances/fattn-tile-instance-dkq576-dv512.cpp, src/ggml-sycl/template-instances/fattn-tile-instance-dkq64-dv64.cpp, src/ggml-sycl/template-instances/fattn-tile-instance-dkq72-dv72.cpp, src/ggml-sycl/template-instances/fattn-tile-instance-dkq80-dv80.cpp, src/ggml-sycl/template-instances/fattn-tile-instance-dkq96-dv96.cpp, src/ggml-sycl/template-instances/fattn-vec-instance-f16-f16.cpp, src/ggml-sycl/template-instances/fattn-vec-instance-f16-q4_0.cpp, src/ggml-sycl/template-instances/fattn-vec-instance-f16-q4_1.cpp, src/ggml-sycl/template-instances/fattn-vec-instance-f16-q5_0.cpp, src/ggml-sycl/template-instances/fattn-vec-instance-f16-q5_1.cpp, src/ggml-sycl/template-instances/fattn-vec-instance-f16-q8_0.cpp, src/ggml-sycl/template-instances/fattn-vec-instance-q4_0-f16.cpp, src/ggml-sycl/template-instances/fattn-vec-instance-q4_0-q4_0.cpp, src/ggml-sycl/template-instances/fattn-vec-instance-q4_0-q4_1.cpp and 27 more.
Largest clones in the code
- 51 lines in 4 placesc2,676 tokenssrc/ggml-cpu/arch/arm/quants.c:3597–3647src/ggml-cpu/arch/loongarch/quants.c:1576–1626src/ggml-cpu/arch/powerpc/quants.c:1387–1437src/ggml-cpu/arch/x86/quants.c:2687–2737
3597#if defined (__ARM_NEON) 3598static const int8_t keven_signs_q2xs[1024] = { 3599 1, 1, 1, 1, 1, 1, 1, 1, -1, 1, 1, 1, 1, 1, 1, -1, 1, -1, 1, 1, 1, 1, 1, -1, -1, -1, 1, 1, 1, 1, 1, 1, 3600 1, 1, -1, 1, 1, 1, 1, -1, -1, 1, -1, 1, 1, 1, 1, 1, 1, -1, -1, 1, 1, 1, 1, 1, -1, -1, -1, 1, 1, 1, 1, -1, 3601 1, 1, 1, -1, 1, 1, 1, -1, -1, 1, 1, -1, 1, 1, 1, 1, 1, -1, 1, -1, 1, 1, 1, 1, -1, -1, 1, -1, 1, 1, 1, -1, 3602 1, 1, -1, -1, 1, 1, 1, 1, -1, 1, -1, -1, 1, 1, 1, -1, 1, -1, -1, -1, 1, 1, 1, -1, -1, -1, -1, -1, 1, 1, 1, 1, 3603 1, 1, 1, 1, -1, 1, 1, -1, -1, 1, 1, 1, -1, 1, 1, 1, 1, -1, 1, 1, -1, 1, 1, 1, -1, -1, 1, 1, -1, 1, 1, -1, 3604 1, 1, -1, 1, -1, 1, 1, 1, -1, 1, -1, 1, -1, 1, 1, -1, 1, -1, -1, 1, -1, 1, 1, -1, -1, -1, -1, 1, -1, 1, 1, 1, 3605 1, 1, 1, -1, -1, 1, 1, 1, -1, 1, 1, -1, -1, 1, 1, -1, 1, -1, 1, -1, -1, 1, 1, -1, -1, -1, 1, -1, -1, 1, 1, 1, 3606 1, 1, -1, -1, -1, 1, 1, -1, -1, 1, -1, -1, -1, 1, 1, 1, 1, -1, -1, -1, -1, 1, 1, 1, -1, -1, -1, -1, -1, 1, 1, -1,First 10 of 51 lines.
- 186 lines in 2 placeslisp4,446 tokenssrc/ggml-opencl/kernels/gemv_noshuffle_q4_k_f32.cl:37–222src/ggml-opencl/kernels/gemv_noshuffle_q4_k_f32_o4.cl:29–214
37 *d = (q[(j+4)*stride] & mask_d4) | ((q[(j-4)*stride] & mask_hi2) >> 2); 38 *m = ((q[(j+4)*stride] >> 4) & mask_d4) | ((q[j*stride] & mask_hi2) >> 2); 39 } 40} 41 42#define dequantizeBlockAccum_ns_sgbroadcast_1_hi(total_sums, bits4, scale, minv, y) \ 43 float shared_y; \ 44 shared_y = sub_group_broadcast(y.s0, 0); \ 45 total_sums.s0 += ((bits4.s0 & 0x000F) * scale.s0 - minv.s0) * shared_y; \ 46 total_sums.s1 += ((bits4.s1 & 0x000F) * scale.s1 - minv.s1) * shared_y; \First 10 of 186 lines.
- 194 lines in 2 placeslisp4,204 tokenssrc/ggml-opencl/kernels/gemv_noshuffle_q4_0_f32.cl:15–208src/ggml-opencl/kernels/gemv_noshuffle_q4_0_f32_spec.cl:7–200
15#define MATERIALIZE_WG(x) 16#endif 17 18// assume 19#define QK4_0 32 20#define N_SIMDGROUP 4 21 22#define dequantizeBlockAccum_ns_sgbroadcast_1_hi(total_sums, bits4, scale, y) \ 23 float shared_y; \ 24 shared_y = sub_group_broadcast(y.s0, 0); \First 10 of 194 lines.
7 more
- 116 lines in 3 placeslisp1,952 tokens
- 116 lines in 3 placeslisp1,943 tokens
- 21 lines in 36 placeslisp111 tokens
- 9 lines in 48 placesc73 tokens
- 300 lines in 2 placescpp3,238 tokens
- 266 lines in 2 placescpp3,143 tokens
- 38 lines in 11 placescpp290 tokens
Largest clones over all files, tests and data included
- 51 lines in 4 placesc2,676 tokenssrc/ggml-cpu/arch/arm/quants.c:3597–3647src/ggml-cpu/arch/loongarch/quants.c:1576–1626src/ggml-cpu/arch/powerpc/quants.c:1387–1437src/ggml-cpu/arch/x86/quants.c:2687–2737
3597#if defined (__ARM_NEON) 3598static const int8_t keven_signs_q2xs[1024] = { 3599 1, 1, 1, 1, 1, 1, 1, 1, -1, 1, 1, 1, 1, 1, 1, -1, 1, -1, 1, 1, 1, 1, 1, -1, -1, -1, 1, 1, 1, 1, 1, 1, 3600 1, 1, -1, 1, 1, 1, 1, -1, -1, 1, -1, 1, 1, 1, 1, 1, 1, -1, -1, 1, 1, 1, 1, 1, -1, -1, -1, 1, 1, 1, 1, -1, 3601 1, 1, 1, -1, 1, 1, 1, -1, -1, 1, 1, -1, 1, 1, 1, 1, 1, -1, 1, -1, 1, 1, 1, 1, -1, -1, 1, -1, 1, 1, 1, -1, 3602 1, 1, -1, -1, 1, 1, 1, 1, -1, 1, -1, -1, 1, 1, 1, -1, 1, -1, -1, -1, 1, 1, 1, -1, -1, -1, -1, -1, 1, 1, 1, 1, 3603 1, 1, 1, 1, -1, 1, 1, -1, -1, 1, 1, 1, -1, 1, 1, 1, 1, -1, 1, 1, -1, 1, 1, 1, -1, -1, 1, 1, -1, 1, 1, -1, 3604 1, 1, -1, 1, -1, 1, 1, 1, -1, 1, -1, 1, -1, 1, 1, -1, 1, -1, -1, 1, -1, 1, 1, -1, -1, -1, -1, 1, -1, 1, 1, 1, 3605 1, 1, 1, -1, -1, 1, 1, 1, -1, 1, 1, -1, -1, 1, 1, -1, 1, -1, 1, -1, -1, 1, 1, -1, -1, -1, 1, -1, -1, 1, 1, 1, 3606 1, 1, -1, -1, -1, 1, 1, -1, -1, 1, -1, -1, -1, 1, 1, 1, 1, -1, -1, -1, -1, 1, 1, 1, -1, -1, -1, -1, -1, 1, 1, -1,First 10 of 51 lines.
- 186 lines in 2 placeslisp4,446 tokenssrc/ggml-opencl/kernels/gemv_noshuffle_q4_k_f32.cl:37–222src/ggml-opencl/kernels/gemv_noshuffle_q4_k_f32_o4.cl:29–214
37 *d = (q[(j+4)*stride] & mask_d4) | ((q[(j-4)*stride] & mask_hi2) >> 2); 38 *m = ((q[(j+4)*stride] >> 4) & mask_d4) | ((q[j*stride] & mask_hi2) >> 2); 39 } 40} 41 42#define dequantizeBlockAccum_ns_sgbroadcast_1_hi(total_sums, bits4, scale, minv, y) \ 43 float shared_y; \ 44 shared_y = sub_group_broadcast(y.s0, 0); \ 45 total_sums.s0 += ((bits4.s0 & 0x000F) * scale.s0 - minv.s0) * shared_y; \ 46 total_sums.s1 += ((bits4.s1 & 0x000F) * scale.s1 - minv.s1) * shared_y; \First 10 of 186 lines.
- 194 lines in 2 placeslisp4,204 tokenssrc/ggml-opencl/kernels/gemv_noshuffle_q4_0_f32.cl:15–208src/ggml-opencl/kernels/gemv_noshuffle_q4_0_f32_spec.cl:7–200
15#define MATERIALIZE_WG(x) 16#endif 17 18// assume 19#define QK4_0 32 20#define N_SIMDGROUP 4 21 22#define dequantizeBlockAccum_ns_sgbroadcast_1_hi(total_sums, bits4, scale, y) \ 23 float shared_y; \ 24 shared_y = sub_group_broadcast(y.s0, 0); \First 10 of 194 lines.
- 116 lines in 3 placeslisp1,952 tokens
- 116 lines in 3 placeslisp1,943 tokens
By format, code only
| Format | Files | Lines | Clones | Duplicated lines | Duplication |
|---|---|---|---|---|---|
| cpp | 223 | 202,874 | 2,897 | 34,428 | 16.97% |
| lisp | 275 | 59,842 | 1,853 | 35,574 | 59.45% |
| c | 98 | 91,014 | 1,745 | 21,742 | 23.89% |
| c-header | 200 | 48,603 | 433 | 5,416 | 11.14% |
| cpp-header | 43 | 20,546 | 221 | 2,469 | 12.02% |
| wgsl | 47 | 7,403 | 71 | 749 | 10.12% |
| objectivec | 2 | 3,588 | 3 | 32 | 0.89% |
| python | 5 | 1,075 | 3 | 73 | 6.79% |
| bash | 13 | 1,708 | 0 | 0 | 0% |
By format, all files
| Format | Files | Lines | Clones | Duplicated lines | Duplication |
|---|---|---|---|---|---|
| cpp | 258 | 233,852 | 3,212 | 40,299 | 17.23% |
| lisp | 275 | 59,842 | 1,853 | 35,574 | 59.45% |
| c | 105 | 92,397 | 1,767 | 22,064 | 23.88% |
| c-header | 210 | 59,409 | 461 | 5,734 | 9.65% |
| glsl | 181 | 26,073 | 417 | 5,147 | 19.74% |
| cpp-header | 43 | 20,546 | 221 | 2,469 | 12.02% |
| wgsl | 47 | 7,403 | 71 | 749 | 10.12% |
| python | 26 | 5,539 | 24 | 350 | 6.32% |
| cmake | 39 | 5,851 | 13 | 119 | 2.03% |
| yaml | 6 | 876 | 13 | 160 | 18.26% |
Trending appearances
| Day | Rank | Stars | Files | Lines | Clones | All files | Code | Health | Commit |
|---|---|---|---|---|---|---|---|---|---|
| Nov 16, 2026 | #8 | 15,979 (+43) | 1,243 | 520,693 | 8,062 | 21.7% | 23.01% | E 24.9 | 417a024 |
Want this for your own project? Install jscpd and run jscpd ., or measure it the way the baselines were measured.