A 2.78-trillion-parameter Kimi K3 running inference on a single CPU in 8.24 GB of RAM. Portable C99: no BLAS, no framework, no GPU.
C avx2c99cpu-inferencedeep-learningfrom-scratchinference-enginekimi-k3linear-attentionllmllm-inferencemachine-learningmemory-efficientmixture-of-expertsmoemxfp4quantizationsimdsystems-programmingtransformerzero-dependencies
flowchart LR
OP["op fixtures<br/>22 kernels, no weights"] --> TOY["13-layer oracle<br/>3 gates, exact ids"]
TOY --> REAL["93 real layers<br/>stages A, B and C"]
REAL --> LG["163,840 logits<br/>against torch"]
LG --> V["max diff<br/>7.9e-06"]
TOY -.->|"a toy model,<br/>not the 2.8T one"| WARN["proves the code,<br/>not the checkpoint"]
style OP fill:#ECE8E0,stroke:#8C8477,color:#3B372F
style TOY fill:#E4ECF3,stroke:#5C7C9B,color:#3B372F
style REAL fill:#F2E9D4,stroke:#C0913E,color:#3B372F
style LG fill:#F4E7D3,stroke:#C07A42,color:#3B372F
style V fill:#E7ECDD,stroke:#6E9160,color:#3B372F
style WARN fill:#F5E2DB,stroke:#B75845,color:#3B372F