K3-Stuff / scripts /README.md
TessaCoil's picture
Upload folder using huggingface_hub
ddf8c5b verified
|
Raw
History Blame Contribute Delete
2.94 kB
# k3-test β€” rental validation scripts for Kimi K3 local-inference
Companion to `../k3-rental-test-plan.md` (Β§4 runbook). Read **`PREP_REPORT.md` first**
β€” it contains the pre-flight verification results and two important deltas from the plan
(trunk VRAM reality + how "RAM-resident" is reinterpreted under mmap streaming).
## Box setup (vast.ai, ~15 min)
```bash
# rent per plan Β§2, ssh in, then:
git clone <this-repo or rsync the dir> k3-test && cd k3-test
tmux new -s k3 # everything long-running inside tmux
./run_all.sh # setup β†’ K3 download (bg) β†’ recon β†’ smoke gate β†’ E0–E8 β†’ pack
```
Useful variants:
```bash
SKIP_DOWNLOAD=1 ./run_all.sh # model already on disk
EXP_LIST="E1 E2 E3" ./20_k3_experiments.sh # subset of experiments
K3_INCLUDE="*UD-IQ1_S*" K3_SUBDIR=UD-IQ1_S ./01_download_k3.sh # 610 GB fallback quant
```
## File map
| file | what it does |
|---|---|
| `config.env` | all knobs: paths, pinned llama.cpp commit, quant selector, TSPLIT, filler list |
| `setup.sh` | apt deps, hf CLI + hf_transfer, clone+build llama.cpp (pinned, CUDA) |
| `00_recon.sh` | dmidecode/lscpu/NUMA/fio/sysbench RAM bw/GPU topo β€” free home-build data |
| `01_download_k3.sh` | K3 GGUF download w/ retries + verification (backgroundable) |
| `02_download_smoke.sh` | Qwen3-30B-A3B Q4_K_M (~18.6 GB) |
| `10_smoke.sh` | 5-case pipeline gate (GPU-resident, -cmoe, -ncmoe, NUMAΓ—2, CPU-only bw) |
| `20_k3_experiments.sh` | E0–E8 per plan Β§4 Phase 2 (see header comment for mmap reinterpretation) |
| `30_teardown.sh` | tar logs; prints off-box copy + destroy reminders (never destroys itself) |
| `run_all.sh` | the full Β§4 runbook with smoke gate |
| `prompts/` | fixed chat / agentic-coding / long-doc prompts (reproducibility) |
| `lib/common.sh` | monitors (free/iostat/nvidia-smi dmon), drop_caches, RAM filler, runner+parser |
## Results
All runs land under `logs/<name>/` with `cmd.txt`, `run.log` (full llama.cpp output),
`summary.txt` (exit code, wall time, pp/tg timings), `mem.log`, `iostat.log`, `nvidia.log`.
`30_teardown.sh` tars everything; score it against plan Β§6 success criteria.
## Interpreting the headline numbers
- `k3_E1b_warm` tokens/s β‰ˆ **dual-socket DDR4 ceiling** for hot-set-resident decode.
Home (8ch, ~150–180 GB/s) β‰ˆ 55–70% of the rental's dual-socket number β€” see plan Β§5 note.
- `k3_E1a_cold vs k3_E1b_warm` = SSD streaming penalty with default readahead.
- `k3_E4_filler*_warm` sweep = hit-rate/cache-size curve (the E4 knee).
- `iostat.log` bytes-read delta Γ· tokens decoded = **real bytes/token** β€” check it
against the plan's ~40–45 GB/token estimate; it re-derives every speed prediction.
## Never-destroy-automatically
Billing is per-minute and the script will never destroy the instance.
`30_teardown.sh` prints the exact manual steps. Disk does not persist β€” pull the
tarball off-box **before** destroying.