K3-Stuff / scripts /PREP_REPORT.md
TessaCoil's picture
Upload folder using huggingface_hub
ddf8c5b verified
|
Raw
History Blame Contribute Delete
6.04 kB

K3 Rental Test β€” Prep Report (2026-08-25)

Offline preparation for k3-rental-test-plan.md Β§3 pre-flight. Verdict: ready to rent, with two deltas to internalize first (Β§3 below).

1. Pre-flight checklist β€” verified

Plan Β§3 item Status Evidence
K3 artifacts downloadable βœ… direct GGUF path, no conversion phase unsloth/Kimi-K3-GGUF: UD-Q4_K_XL = 32 shards, 1508.7 GB (~49 GB/shard), matching the plan's 1.5 TB assumption. Also IQ1_S 594 GB / IQ2_XXS 711 GB / Q8_K_XL 1560 GB (=lossless). Optional mmproj-BF16.gguf for vision. Official weights: moonshotai/Kimi-K3.
Runtime KDA support βœ… llama.cpp mainline PR #26185 "model: add Kimi-K3 text model" merged 2026-08-15, first released in b10448. KDA + Gated-MLA + AttnRes + latent-MoE + SiTU all implemented; MXFP4 experts repacked losslessly (no dequantβ†’BF16 hours). Vision needs unsloth fork PR #48 β€” text-only plan β‡’ mainline OK. Pinned in config.env: d222767 (2026-08-25 master).
Smoke model staged βœ… Qwen/Qwen3-30B-A3B-GGUF Q4_K_M (~18.6 GB).
Scripts repo βœ… k3-test/ β€” see README. bash -n clean; flags verified against pinned source.
Plan + review HTML accessible βœ… in /Users/danielleensign/prog/chat/ β€” rsync with the repo.
Rental offers live ❌ can't verify offline Vast offer IDs are ephemeral & need an API key β€” day-of check via the web console (Β§4 below).

Flags verified in llama.cpp source @ d222767

--cpu-moe (-cmoe), --n-cpu-moe N (-ncmoe), -ot "<regex>=<buffer>" (first matching pattern wins; buffer names CPU, CUDA0..3), --numa distribute, --load-mode mmap|mlock|dio|none, prompt-lookup spec via --lookup-cache-static / --lookup-cache-dynamic, --single-turn, --no-conversation. Expert tensor naming confirmed in src/llama-arch.cpp: blk.N.ffn_{gate,up,down}_exps.weight β€” the pattern .ffn_(up|gate|down)_exps.=CPU is exactly what --cpu-moe injects internally.

config.json (replaces plan's estimates)

93 layers = 69 KDA + 24 Gated-MLA (full-attn layers 4,8,…,92,93); hidden 7168; 96 heads; MLA kv_lora_rank 512, q_lora_rank 1536; 896 routed experts (moe_ff 3072, latent-compressed) + 2 shared; vocab 163840; ctx 1 048 576; AttnRes block size 12; KDA gate_lower_bound βˆ’5.0.

2. Budget re-check

Q4 download at the box's measured 6.4 Gbps β‰ˆ 32–39 min β‰ˆ $1.30 @ $2.278/hr β€” on plan. Disk need 1508.7 + 18.6 + logs β‰ˆ 1.56 TB < 2.74 TB β€” fine with the plan's headroom.

3. ⚠ Two deltas from the plan to internalize BEFORE renting

(a) Trunk VRAM reality. UD-Q4_K_XL keeps the dense trunk mostly Q8_0 (Unsloth: "the remaining tensors … are Q8_0"). Dense trunk β‰ˆ 56B params β‡’ ~55–60 GB, which does not fit 2Γ—24 GB. On the rental the default is trunk split across 3 GPUs (TSPLIT=1,1,1, leaving GPU 3 for E6), with E0b/E0c measuring the 2-GPU / 1-GPU CPU-spill penalty. On the home build (1Γ—3090) the trunk cannot be VRAM-resident at all: ~35 GB of trunk lives in RAM and is re-read every token (CPU side total then ~50–60 GB/token β‡’ ~2.5–3.5 tok/s at 150–180 GB/s, below the plan's 5–6 prediction), unless the trunk is separately re-quantized (Q4 trunk β‰ˆ 29 GB β€” still >24 GB; Q3 borderline). The rental test must quantify this spill penalty (E0) β€” it is now the home build's central unknown.

(b) "RAM-resident" is physically impossible on the rental (1508.7 GB model vs ~612 GB RAM+VRAM) β€” but that's fine: mmap page-cache streaming is the reference-4-bit-streaming architecture. The experiments map plan-terms onto kernel reality:

  • E1 "experts fully RAM-resident" β†’ E1b warm page cache (hot set resident); E1a cold = SSD streaming for the same workload. The pair measures plan E1+E2.
  • E3 "prefetch OFF" β†’ --load-mode dio (every expert read hits NVMe β€” no llama.cpp expert-prefetch engine exists; readahead knob read_ahead_kb 128β†’4096 is E2's "ON").
  • E4 cache-size sweep β†’ RAM filler (/dev/shm) shrinks effective page cache to emulate 200/320/450-expert hot sets.
  • E8: llama.cpp has no router top-k override for kimi-k3 @ d222767 β€” script probes and logs UNSUPPORTED rather than failing. (Can patch llm-graph if it matters β€” ~5 lines; decide on-box.)
  • Hot-set arithmetic: expert mass β‰ˆ 1449 GB Γ· 896 β‰ˆ 1.6 GB/expert β‡’ 490 GB usable RAM caches **300 experts**, slightly under the plan's 320–360. E4 measures the knee directly, so plan Β§6's hit-rate criteria still apply.

4. Day-of-rental checklist (cannot be done offline)

  1. Open vast.ai console β†’ verify offer #18138411 live; else fallbacks in plan Β§2 (#43104468 β†’ #12239073). Reject anything <1 Gbps down.
  2. rsync -a k3-test/ root@box: && ssh, tmux new -s k3, ./run_all.sh.
  3. Watch download rate for 15 min (tail -f logs/download_k3.log); <2 Gbps effective β‡’ kill, re-rent #43104468 (plan Β§7).
  4. After experiments: ./30_teardown.sh, pull tarball off-box (7.6 Gbps up), destroy instance in the console.

5. Sources