{"slug": "kimi-k3-in-c-on-old-hardware", "title": "Kimi-k3-in-c on old hardware", "summary": "A developer ran Moonshot's 2.78-trillion-parameter Kimi-K3 mixture-of-experts model on a GPU-less dual Xeon E5-2697 v2 server with 192 GB of DDR3 RAM, using the plain C99 kimi-k3-in-c engine and streaming experts from spinning HDDs. After a 67-hour, 1.56 TB checkpoint download and a six-minute trunk pack, the model generated eight tokens in 5,219 seconds — roughly 11 minutes per token — with peak RSS of 127.91 GB and zero true cache hits on experts, meaning every token re-read from disk. The developer said the run was meant to counter YouTube clips that 'look generated' by publishing real timings, RSS and console logs.", "body_md": "*AI translation of the original Russian article: [Kimi-k3-in-c на старом железе](https://dev.to/ua3mqj/kimi-k3-in-c-na-starom-zhieliezie-4fj2).*\n\nStill poking at aging home servers — on CPU again, because we still don't have GPUs. Same story as [running a 32B model on an old Xeon](https://dev.to/ua3mqj/32b-llm-on-a-2008-xeon-when-ram-matters-more-than-vram-28e2) and [half a terabyte of GGUFs with no GPU](https://dev.to/ua3mqj/skachal-poltierabaita-lokalnykh-llm-no-biez-gpu-zhizni-niet-213f).\n\nYouTube is full of Kimi K3 clips (2.78T parameters, MoE). Almost all of them look generated. I haven't seen a real run there with timings, RSS, and console output. Below is one: my server, my disks, my logs. Date: 27 November 2026.\n\nOfficial checkpoint [`moonshotai/Kimi-K3`](https://huggingface.co/moonshotai/Kimi-K3), engine [kimi-k3-in-c](https://github.com/FareedKhan-dev/kimi-k3-in-c) — plain C99, no BLAS, no GPU.\n\nSame ibm host as in the previous post, but the RAM is different. It used to be 64 GiB; then I stuck in six more 32 GB DDR3-1866 ECC Samsung sticks — about 192 GB total, 188.8 GiB visible in the OS. Without that headroom the `server` preset (~128 GB plan) simply wouldn't fit.\n\n| CPU | 2× Xeon E5-2697 v2 @ 2.70 GHz, 48 threads | \n| SIMD | AVX yes, AVX2 no | \n| GPU | none | \n| Disk | ZFS on six 2.2 T HDDs (not NVMe) | \n\nProxmox screenshots from that day (download → Hello → GForth):\n\nDuring generation: CPU ~45% / load ~25 (k3 holds ~24 threads), memory in two plateaus around 152 GiB, network 6–7 MB/s only while downloading. IO stall — spikes on the download, then a long plateau while experts are read from HDD.\n\n| Stage | Wait | \n|---|---|\n| Download checkpoint 1.56 TB (96 shards) | three days (67 h 17 min), ~6.4 MB/s | \n| Verify checksums | another full pass over the same 1.56 TB | \n| `pack-trunk` →`trunk.bin` 108.81 GB | **~6 minutes** | \n\nI started downloading the evening of Nov 23/24 and finished the morning of the 27th. From the `hf` log: `Fetching 119 files … [67:17:02]`.\n\nThen `pack-trunk`: the dense part of the model (the trunk) is packed into one file by layer — 93 layers here, largest 2.341 GB. Experts (~1.45 TB) stay on disk; the engine streams them as it goes. This is not GGUF and not “download and plug into llama.cpp”: it runs through its own console client. The README assumes NVMe. I have spinning rust (not even SSD — proper platter drives, though server-grade: 6× EXOS 2.4 Tb) and a CPU without AVX2, so of course it wasn't going to be fast. Even compiling the binary for this CPU didn't work out of the box. Luckily there are tests, and with some AI help, around attempt #25, I finally found the right build flags.\n\nI typed `Hello`. It answered `, I am a 20 year old`. So basically it just continued my phrase.\n\n```\n./bin/k3 /ibm_bulk/k3model --trunk /ibm_bulk/k3trunk --preset server \\\n  --tok /ibm_bulk/k3model --prompt 'Hello' --incremental\n```\n\n24 threads, `server` preset. Memory plan ~128 GB; 89 of 93 layers pinned in RAM. The model answered: `, I am a 20 year old`. Eight tokens took 5219 seconds — about an hour and a half. Average almost 11 minutes per token. First (cold) token: 833 seconds; the rest a flat 625–629. Peak RSS 127.91 GB. Disk read for the run: ~207 GB experts and ~132 GB trunk. I/O was only 13.8% of wall time; the rest was the CPU grinding.\n\nWhile the engine was pinning the trunk, it took about fifteen minutes to the first token: RSS climbed from zero to ~119 GiB and then barely moved. The log shows 100% cache hit, but true resident hits on experts already in RAM: zero. Every token is read from disk again.\n\nFull tmux output below — pack plus the run. You don't usually get this in those YouTube clips.\n\n``` php\npacking trunk from 96 shards -> /ibm_bulk/k3trunk\nindexing 96 safetensors shards...\nindexed 2628 trunk tensors; skipped 494592 routed-expert metadata entries\n  packed 10/93 layers, 12.90 GB, 38 s (339 MB/s)\n  packed 20/93 layers, 24.31 GB, 77 s (315 MB/s)\n  packed 30/93 layers, 36.14 GB, 116 s (312 MB/s)\n  packed 40/93 layers, 47.55 GB, 154 s (308 MB/s)\n  packed 50/93 layers, 59.38 GB, 193 s (308 MB/s)\n  packed 60/93 layers, 70.79 GB, 231 s (307 MB/s)\n  packed 70/93 layers, 82.62 GB, 272 s (304 MB/s)\n  packed 80/93 layers, 94.02 GB, 310 s (303 MB/s)\n  packed 90/93 layers, 105.86 GB, 350 s (303 MB/s)\n  packed 93/93 layers, 108.81 GB, 359 s (303 MB/s)\n\nwrote /ibm_bulk/k3trunk/.../trunk.bin: 108.81 GB across 93 layers\nlargest layer run: 2.341 GB  <- the streaming slot size\npublished packed trunk in /ibm_bulk/k3trunk\n\nroot@ibm:/ibm_bulk/kimi-k3-in-c# ./bin/k3 /ibm_bulk/k3model --trunk /ibm_bulk/k3trunk --preset server --tok /ibm_bulk/k3model --prompt 'Hello' --incremental\nthreads: 24\nconfig: /ibm_bulk/k3model/config.json (nested shape) | hidden=7168 layers=93 vocab=163840 | 24 MLA + 69 KDA | experts 896 top16 shared2 | latent=3584\n[TOK] 163584 ranks (max id 163583) + 16 added tokens | kimi=1 rankbpe=1\n  tokenized: 5 bytes -> 1 ids\n  KV cache : 23.70 MB for 10 positions (2.37 MB/position)\nKimi K3, pure C, released checkpoint\n  model    : /ibm_bulk/k3model\n  prompt   : 1 tokens, generating 8\n  preset   : server (trunk 110.00 GB / expert cache 13.00 GB)\n\nindexed 497220 tensors from 96 shards in 1.82 s\ntrunk on disk : 110.00 GB total (STREAMED from /ibm_bulk/k3trunk, not held in RAM)\n\nmemory plan\n  trunk (STREAMED) 110.00 GB\n  embed + lm_head  4.70 GB (resident)\n  expert cache     13.00 GB\n  recurrent state  626.25 MB\n  buffers          8.02 MB\n  KV cache         23.65 MB\n  TOTAL            128.36 GB\n  available        166.11 GB\n\ntrunk stream: 108.81 GB packed, 89/93 layers PINNED (107.74 GB), ring 2 x 0.87 GB\n              pinned LARGEST FIRST; the ring slot is sized to the largest UNPINNED layer (0.84 GB\n              of a 2.34 GB maximum)\n              reads use O_DIRECT (page cache bypassed), pread in parallel 64 MiB chunks\n              deterministic hit rate 95.7% (a cyclic scan defeats LRU, so a pinned SET is used instead)\ntrunk streaming enabled from /ibm_bulk/k3trunk in 0.0 s\nembedding, final norm and lm_head: 4.70 GB in 7.0 s\n\npeak RSS after loading weights: 4.80 GB  (the plan above is a forecast, this is measured)\nexpert cache: 740 slots x 17.56 MB = 12.99 GB (0.90% of the 1.45 TB expert pool)\n\nrecurrent state for 93 layers: 626.25 MB\n\nincremental decode: KV cache 23.65 MB for 24 MLA layers at 10 positions\n\nSTEP   TOKEN      SECONDS      CACHE HIT  READ GB    TOK/S\n--------------------------------------------------------------------\n0      11         833.25       100.0      25.83      0.001\n1      374        627.03       100.0      25.83      0.002\n2      1491       626.62       100.0      25.83      0.002\n3      261        626.86       100.0      25.83      0.002\n4      220        625.41       100.0      25.83      0.002\n5      577        625.67       100.0      25.83      0.002\n6      1389       625.58       100.0      25.83      0.002\n7      3410       628.91       100.0      25.83      0.002\n--------------------------------------------------------------------\n8 tokens in 5219.3 s, 652.42 s/token average\n\n--- generated text ---\n, I am a 20 year old\n----------------------\n\nPEAK RSS for the whole run: 127.91 GB   <- quote this, not the plan\nlayers completed: 93/93; routed expert drops: 0\n\ncache [final step]\n  slots        : 740 of 17.56 MB = 12.99 GB arena (740 resident, 0 pinned)\n  requests     : 1472  hits 1472 (100.00%)  misses 0  evictions 1472\n  of those hits : 1472 came from the batch prefetch, i.e. read from disk\n                  this token; TRUE resident hit rate 0.00%\n  read from disk: 25.83 GB in 58.18 s (444 MB/s while loading)\n\nwrote k3_run.json\nI/O share of wall clock: 13.8%  (trunk 255.4 s + experts 467.1 s + model tables 0.0 s of 5219.3 s)\n  both figures are WHOLE-RUN totals over 8 steps\n  experts, whole run: 206.64 GB read | 740 of 11776 requests retained in RAM (6.28%) | 11036 evictions\n    (retention = requests - evictions; the raw `hits` counter includes\n     experts the prefetcher had just read from disk, so it is not a\n     measure of avoided I/O)\n\ntrunk [final]\n  pinned 89/93 layers, ring 2 slots\n  binds 744, hits 623 (83.7%), reads 121\n  read 132.45 GB in 255.39 s (519 MB/s)\n  reads 121 against 121 the walk owes (8 passes, 89 pinned)  -- exact\n  bind wall 210.78 s over 744 binds; read 255.39 + widen 5.50 = 260.89 s of device work,\n                    of which 50.11 s (19%) overlapped compute on the reader thread\n```\n\nSimple takeaway: it runs. Using it as a chat on this hardware — no.\n\nIn the [first Xeon post](https://dev.to/ua3mqj/32b-llm-on-a-2008-xeon-when-ram-matters-more-than-vram-28e2), DeepSeek-R1-Distill-Qwen-32B on 2× E5440 spent six hours “writing” a factorial for gforth and produced broken code. Same idea here, different format: not a long chat, but a continuation with a hard `--gen 28` cap (at most 28 new tokens).\n\nPrompt:\n\n```\n\\ GForth. Finish this word only. No text after the definition.\n: factorial ( n -- n! )\n./bin/k3 /ibm_bulk/k3model --trunk /ibm_bulk/k3trunk --preset server \\\n  --tok /ibm_bulk/k3model --prompt-file /tmp/gforth-fac.txt --gen 28 --incremental\n```\n\nThe model finished a recursive definition that actually makes sense:\n\n```\n: factorial ( n -- n! )\n  dup 1 > if\n    dup 1- recurse *\n  else\n    drop 1\n  then ;\n```\n\nAfter the semicolon it wandered into markdown. The 28-token limit cut the tail off, but the word itself was already done.\n\nRan from about 02:13 to 10:54 Moscow time — 31053 seconds, eight hours thirty-seven minutes. The first token ate four hours (14404 s, 277 GB read from disk). After that, a steady ~10 minutes per token. Peak RSS 128.03 GB; experts read nearly a terabyte over the whole run.\n\nI copied the definition onto my laptop and ran it in gforth 0.7.9:\n\n```\n: factorial ( n -- n! )\n  dup 1 > if\n    dup 1- recurse *\n  else\n    drop 1\n  then ;  ok\n1 factorial .s   \\ <1> 1\n10 factorial .s  \\ <2> 1 3628800\n```\n\n`1 factorial` → 1, `10 factorial` → 3628800. It compiles and gives the right answer. I'll call that a win.\n\nOn the old XEON with R1 it was long and wrong. Here it's long too — but the code works. The Forth claim isn't empty this time: there's an `ok` in real gforth.\n\n`Hello` took a bit over an hour. The Forth factorial — almost nine, four of them on the first token. Useless speed for real work: no AVX2, plain spinning disks.\n\nBut the punchline is simple and nice: **on the same benchmark where the old Xeon + R1 spent six hours producing dead code, Kimi K3 on a much heavier model produced working Forth** — `10 factorial` in gforth is 3628800. Slow, but correct.", "url": "https://wpnews.pro/news/kimi-k3-in-c-on-old-hardware", "canonical_source": "https://dev.to/ua3mqj/-kimi-k3-in-c-on-old-hardware-42ag", "published_at": "2026-11-29 21:37:15+00:00", "updated_at": "2026-11-29 21:45:21.048623+00:00", "lang": "en", "topics": ["large-language-models", "ai-infrastructure", "ai-tools", "mlops"], "entities": ["Moonshot AI", "Kimi-K3", "kimi-k3-in-c", "Intel Xeon E5-2697 v2", "Hugging Face", "Proxmox", "ZFS"], "also_reported_by": [], "takeaway": "Streaming a 2.78T-parameter MoE from HDDs on AVX-only CPUs yielded about 11 minutes per token with zero true expert cache hits, so every token re-read experts from disk even though the log reported 100% cache hits.", "recommendation": {"advice": "Budget RAM to pin the dense trunk and verify true expert cache residency rather than trusting reported cache-hit logs before attempting disk-streamed MoE inference on CPU-only hardware.", "playbook": "inference-serving", "playbook_url": "https://wpnews.pro/playbooks/inference-serving"}, "alternates": {"html": "https://wpnews.pro/news/kimi-k3-in-c-on-old-hardware", "markdown": "https://wpnews.pro/news/kimi-k3-in-c-on-old-hardware.md", "text": "https://wpnews.pro/news/kimi-k3-in-c-on-old-hardware.txt", "jsonld": "https://wpnews.pro/news/kimi-k3-in-c-on-old-hardware.jsonld"}}