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
E["embedding<br/>always source 0"] --> SM{"softmax over<br/>every source"}
B1["block 1<br/>output"] --> SM
B2["block 2<br/>output"] --> SM
NOW["running prefix<br/>this block"] --> SM
SM --> H["new h<br/>replaces the old"]
NOW -.->|"every 12 layers:<br/>snapshot and clear"| B2
style E fill:#ECE8E0,stroke:#8C8477,color:#3B372F
style B1 fill:#E4ECF3,stroke:#5C7C9B,color:#3B372F
style B2 fill:#F2E9D4,stroke:#C0913E,color:#3B372F
style NOW fill:#F4E7D3,stroke:#C07A42,color:#3B372F
style SM fill:#EAE4F1,stroke:#7E6E9C,color:#3B372F
style H fill:#E7ECDD,stroke:#6E9160,color:#3B372F