You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This commit introduces a CPU reference implementation for GGML,
designed primarily for testing and validation purposes.
The motivation for this addition is to have a pure C CPU backend
implementation that does not use any hardware-specific optimizations
or intrinsics. This will allow for testing the CPU backend variants
against the reference implementation to ensure correctness
Building:
```console
$ cmake -B build \
-DGGML_CPU_REF_BACKEND=ON
-DGGML_BACKEND_DL=ON \
-DGGML_CPU_ALL_VARIANTS=ON
```
List availble cpu architectures/variants:
```console
$ ./build/bin/test-backend-ops cpu-variants --list
CPU variants:
CPU-haswell - 12th Gen Intel(R) Core(TM) i7-1260P
CPU-sse42 - 12th Gen Intel(R) Core(TM) i7-1260P
CPU-x64 - 12th Gen Intel(R) Core(TM) i7-1260P
CPU-alderlake - 12th Gen Intel(R) Core(TM) i7-1260P
CPU-sandybridge - 12th Gen Intel(R) Core(TM) i7-1260P
```
Run tests:
```console
./build-ref/bin/test-backend-ops cpu-variants --variant CPU-alderlake -o ADD
CPU-ref features:
SSE2 = 1
CPU-alderlake features:
SSE2 = 1
SSE3 = 1
SSSE3 = 1
AVX = 1
AVX_VNNI = 1
AVX2 = 1
F16C = 1
FMA = 1
BMI2 = 1
LLAMAFILE = 1
OPENMP = 1
REPACK = 1
Testing CPU variant 'CPU-alderlake' against 'CPU-ref' backend...
ADD(type=f16,ne=[1,1,8,1],nr=[1,1,1,1],nf=1): OK
ADD(type=f16,ne=[1,1,1,1],nr=[32,1,1,1],nf=1): OK
...
```
0 commit comments