Spent the last few days refactoring ggml-cpu.c
in ggml. The ggml-cpu.c
file is currently a monolith with around 15,000 lines of code, and needs to be refactored into separate files and de-duplicated using C++ function templates.
The first part of that refactoring was pushed earlier today - https://github.com/ggml-org/ggml/pull/1144
I also worked on the next two PRs - one that splits SIMD Mapping definitions and vectorized functions into separate files, and another that moves all the operator functions (except mul_mat
) into a separate C++ file. I tested the combined effect of these two PRs, and it successfully passed the runners on ggml-ci
. These two PRs will shrink ggml-cpu.c
to around 5k lines (down from 15k lines right now).
The next step is to test these two PRs a lot more, and read the diff again with a very fine comb, to ensure that this doesn't mess up any CPU extension or scenario.