Initialization
Call
ggml_backend_load_all() before using ggml_backend_init_best() or ggml_backend_init_by_type() so that all compiled-in backends are registered.Thread configuration
The CPU backend parallelises operations across threads. You control the thread count after initialization:Custom thread pool
For finer control — including thread affinity and NUMA-awareness — create aggml_threadpool and attach it:
NUMA support
On systems with multiple NUMA nodes, initialise ggml’s NUMA support before creating backends:SIMD optimisations
ggml detects CPU features at runtime and selects the most capable implementation for each operation. You can query which extensions are available:- x86
- ARM
- Other
Abort callback
You can register a callback that the CPU backend will call periodically during graph compute. Returntrue to abort execution:
