4.7 KiB
4.7 KiB
name, description
| name | description |
|---|---|
| radiance-w4-campaign | Run a radiance GPTQ-w4 quantization campaign on dankserver: calibration → protected experts → convert → KLD gate → deploy, with the engine-pin and MNBT laws. |
Pipeline for quantizing a BF16 Qwen3.8-Flash-Next checkpoint into a servable qwen4exp .rad on dankserver (frank-primary). Reference run: serverAppConfigs-docs/LLM/Quantization Production.md + scripts/ (calib-push.py, qwen38-calib-window.sh, run-qwen38-bf16.sh, derive-protected-experts.py, apply-protected-cast.sh, the convert script, the KLD gate, the fleet probes).
Sequence:
- Fetch checkpoint with per-shard LFS sha256 verification (
-f, byte counts, no token on argv). - BF16 container:
rad-convertno-recipe (pure copy) — the KLD reference engine and the calibration rig. - KLD reference: record logits on the serving shape, corpus ≤ the per-slot window. Writes atomically at completion (
rows:line = receipt). - Calibration: see the pin law below. Push the corpus through prefill; per-expert down-proj Grams land as
RADGRAM2files (gram.r<rank>.<tensor>.<e>.bin). - Protected experts: derive from gram energy (share ≥3 % AND ≥3× routing share), splice between the recipe's
# PROTECTED-BEGIN/ENDmarkers. One encoding per expert table; only whole bf16 experts legal beside it — no gate_up/down split. - Final convert on the serving pin (CPU GPTQ, hours; disk gate ≥146 GiB free first).
- KLD gate: MNBT ≤ 2048 when a w4 container streams in place at 32768 (
DID NOT FIT … stored form is not the container's), pool 40960, KV dtype matching production. Gate: mean KL ≤ 0.03, top-1 ≥ 95 %. - Deploy
./scripts/deploy.sh dankserver --service frank-archon; verify/v1/modelsid, boot ledger, a streamed ≥128-token decode probe, and fleet probes (vision needs ≥512 budget on a thinking model +reasoning_contentfallback).
The calibration pin law, and how a tap dies silently (measured 2026-10-30)
calibMUST boot the 1.2.0 pin (digestsha256:665775ed…), never the production pin. SettingRADIANCE_CALIB_DIR+RADIANCE_CALIB_TOKENSon 1.8.1 looks accepted and writes nothing: 17 h and 7.3 M prompt tokens produced zero bytes, with/healthgreen, 118 tok/s and no error line. The tap code (CalibExperts,RADGRAM2, the seal linecalibration wrote layer Hessians after %lld tokens) is present in every plugin from 1.2.4 through 1.8.1 — string presence is not the arm. Only the 1.2.0 plugin arms on the env pair, which is why swift15's runner pinsIMAGEper mode (calib→PIN_120) and the qwen38 runner's singleFRANK_ARCHON_IMAGEport was a silent regression.- The boot ledger's
ENVIRONMENT -- the RADIANCE_* variables set, by nameblock is a dump, not acceptance. It lists names the engine may ignore. /statshas no calibration counter and the tap dir stays empty until the floor is reached, so a dead tap is indistinguishable from a slow one for hours. Therefore every tap run needs an engagement gate: push 2–3 documents, then refuse to continue unless the tap dir holds bytes. Put it in the runner, not in an operator's memory.- Calibration at
--tp 2is legal (expert_tiered+--weights-disk-tierstreams whole experts); the plugin refuses only when a rank would hold a slice of every expert ("calibration runs at one rank … its Hessians would be of the slice"). - The reported gain from a wide calib step is small: MNBT 2,048 → 8,192 cut steps/doc 2.5 → 1.0 and moved 118 tok/s vs ~94, ≈1.2×, because the tap's cost is bytes read from the disk tier, not steps. Size the token floor from a counter measurement (
total_requestsdeltas × corpus mean tokens/doc); never fromprefill_tps, which is a rolling gauge (it manufactured a false 4.5× / 320 tok/s figure).
Ops laws that bite
systemctlon the system units needssudoin scripts and over ssh. Baresystemctl stop frank-archonpasses one day and returnsAccess denied … requires interactive authenticationthe next, and a runner that ignores the failure boots the rig beside live production. Checksystemctl is-activeafter every stop/start and fail closed.- Stopping the unit leaves it
failed(the engine exits non-zero on SIGTERM);systemctl reset-failedafter the stop keeps a deliberate drain from reading as a fault. - A probe container started with
--rmdeletes its own log on exit; capturepodman logsbefore cleanup, and never redirectpodman run -dto a file expecting the engine's output — that file only receives the container id. - Stop the production service for every GPU phase (relinked unit: stop, mask fails); verify shapes against
podman inspect <name> --format {{join .Config.Cmd " "}}(rootless, as dank) before writing them down.