include header files/source file in ggml
include file in ggml distribute in different dirs, as a library include
expose to the user, other header file use internel.
includes
ggml-alloc.h
: about tensor and compute graph allocation, also include define of backend buffer and talloc.ggml-backend.h
: about all of backend, dev/buffer type/buffer/graph and so on. Also include some api can register some event and do schedule.ggml-cpp.h
: include some cpp helper define.ggml.h
: include all the basic of ggml. aboutr macro, helper, data type, log, kernel op, all you want in this file.ggml-opt.h
: include some api about backend train.ggml-gguf.h
: something about gguf format design.ggml-cpu.h
: something about cpu backend api.
src include
the src include is internel ggml use.
ggml-backend-impl.h
: direct how the backend implement, also include buffer type/buffer struct and so on.ggml-impl.h
: direct how the kernel op and compute implement, also include some fp convert function.ggml-quants.h
: include some quantize api.ggml-threads.h
: include some threads api, just barrier.ggml-common.h
: quantize data type struct define in this.
src/ggml-cpu include
binary-ops.h
,unary-ops.h
andops.h
: different type kernel ops api define.vec.h
: some vec op and vec helper.simd-mapping.h
: abstract different arch's simd, risc-v not in it.ggml-cpu-traits.h
: extra traits define for cpu, use for extension such like amx.ggml-cpu-quants.h
: cpu quantize function define, include normal quantize and vector.ggml-cpu-impl.h
: some arch specific data type define, some vector type abstract, and cpu computer param struct define there.commom.h
: some fp converter function.
src
ggml-alloc.c
: alloc inplemention, internel struct include galloc/tdynalloc define here.ggml-backend.cpp
: backend api implement, it is strange cpu backend buffer implement in here, maybe because cpu backend seen as default backend.ggml-backend-reg.cpp
: aboue backend device register.ggml-opt.cpp
: something about model opt.ggml-quants.c
: quants implement.ggml.c
: general function implement.
src/ggml-cpu
ggml-cpu.c
: all cpu compute implement here, about forward compute and so on.ggml-cpu.cpp
: cpu backend implement, not include buffer, include device compute and so on.ggml-cpu-traits.cpp
: extra traits detect and use, include extra buffer and work size.ops.cpp
andbinary-ops.cpp
: op implement.vec.cpp
: vec implement.ggml-cpu-quants
: also quants implement.