radiance 1.1.0

- The VRAM split has no ratio: --expert-vs-cache-ratio is gone (now an unknown option). The
  experts keep what the pinned host pool cannot hold, the KV cache takes the rest and lends idle
  blocks to the experts. Flash-Next at tp2: 7.9 GiB of KV a card, up from 4.7. Startup, /stats,
  /metrics and the dashboard report the most the cache can hold.
- Linear-state snapshots live in pinned host memory, not VRAM (--checkpoint-slots sizes the
  store). Prefix-cache misses on agent sessions fixed; a published conversation is no longer
  trimmed away.
- Any world size from the shipped container (baKon): --tp 3 on Flash-Next with no padded
  checkpoint -- the attention world, uneven delta-net heads, the fill op.
- Kernels (keptn42): moe_gemm_q decode loads and one-trip run search, hc_read's prefill form
  (+3.7% prefill at 18K), hc_up row groups up to eight, the fused router launch. Each is the rule
  where it was measured faster; no environment switches.
- Tool calls: a typed argument is always JSON (Python True/None no longer leak into arguments --
  Codeberg #21); nine further reply-parser fixes; the reply path inside a call is ~12x cheaper on
  the host.
- The kernel changes: prefill +2-3% and decode -2% a step on 2x R9700 at tp2, identical text.
This commit is contained in:
Deadcode committed 2026-10-06 14:04:49 +02:00
1 parent 9f5feb24ee
commit 82b5835c02
101 files changed
+5105 -3767

No files matched your search

+1 -1
View File
@@ -17,7 +17,7 @@ header lists its own). The ones that only attach to a live server need nothing b
| | |
|---|---|
| `mcserve.sh` | MiniCPM5-2B with its DSpark drafter (`minicpm5-2b-dspark.v2.rad`), left running on :8100. Records why `--max-model-len` is the container's `n_ctx_train` and why a dense model of this size needs no explicit VRAM split. |
| `fnserve.sh` | Qwen3.8-Flash-Next, the production container `w4nl64-i8lm.rad`, same contract. Records the production flags and why: the 200K context and the 0.82 expert/cache ratio that keeps the prefix cache useful at it, the 2048-token chunk, the prefix-cache tiers and the lossy `wht6` cross-rank wire. |
| `fnserve.sh` | Qwen3.8-Flash-Next, the production container `w4nl64-i8lm.rad`, same contract. Records the production flags and why: the 200K context and how the expert/cache split sizes the prefix cache at it, the 2048-token chunk, the prefix-cache tiers and the lossy `wht6` cross-rank wire. |
| `fnstop.sh` | Stops whichever is running and waits for the process to go. |
| `convdspark.sh` | Rebuilds the container `mcserve.sh` serves, with the drafter merged. The conversion of record. |
| `convfn.sh` | Rebuilds the container `fnserve.sh` serves from `data/recipes/qwen4exp-w4nl64-i8-hc8m.recipe`. Needs `CALIB=<dir>`: the recipe's expert rule runs GPTQ against the calibration Grams there (`docs/MOE-W4.md`). |
+2 -2
View File
@@ -74,8 +74,8 @@ while True:
print(f"diskstall: the session never left RAM and VRAM for disk: {s}", file=sys.stderr)
sys.exit(1)
time.sleep(1)
print(f"on disk {s['on_disk']} blocks, snapshots device/host/disk "
f"{s['snap_device']}/{s['snap_host']}/{s['snap_disk']}, after {time.time()-t0:.0f}s")
print(f"on disk {s['on_disk']} blocks, snapshots host/disk "
f"{s['snap_host']}/{s['snap_disk']}, after {time.time()-t0:.0f}s")
# ---- the bystander: a stream that only decodes ----------------------------------------------------
stamps = []
+16 -17
View File
@@ -4,26 +4,25 @@
# production one, w4nl64-i8lm.rad, built by data/recipes/qwen4exp-w4nl64-i8-hc8m.recipe
# (scripts/convfn.sh).
#
# 200K CONTEXT, AND WHY THE RATIO IS 0.82 RATHER THAN 0.75. --max-model-len reserves nothing per
# request; it sets the WORST CASE that --expert-vs-cache-ratio sizes the paged pool against. At
# 200000 x 8 sequences the default 0.75 binds: the cache takes its full quarter of the elastic pool,
# and the routed experts it displaces fit in neither VRAM nor the host pool, so without
# --weights-disk-tier the planner refuses at load ("DID NOT FIT").
# 200K CONTEXT. --max-model-len reserves nothing per request; it sets the WORST CASE the paged
# pool is sized against. Under expert_tiered the cache lends: the routed experts keep on the card
# exactly what the host pool cannot hold, and the cache takes the rest of the elastic pool, up to
# --max-num-seqs x --max-model-len, lending every block no live request holds back to the expert
# slab. --host-pool-mib is what moves that split: a larger pool takes experts off the card and
# gives the cache more, in pinned host RAM.
#
# The pool is a CAPACITY, not a per-request cap. A token costs 7.31 KiB across the two paged
# groups (kv_attn 26.00 KiB and kv_qsa_bkey 3.25 KiB per 4-token block), so one 200K sequence is
# 1.43 GiB. 0.87 is enough for one-shot requests (a 200K and a 120K sequence at once) but not
# for multi-turn ones: with prefix caching a finished sequence's blocks stay HELD so the next turn
# can reuse them, so the demand is the live SESSIONS, and a context of T tokens occupies about
# 1.8 x T pool tokens. At 0.87 two ~184K sessions do not fit, the cache evicts exactly what the
# next turn asks for, and every turn re-prefills its whole context (0% prefix hit; minutes per
# turn instead of seconds). 0.82 holds about two concurrent 200K sessions (99% hit on the second
# turn) for about 1.4% of decode step time, since the experts lose 5% of the elastic pool; 0.84
# holds one. Watch kv_util: the hit rate falls off a cliff between 0.75 and 0.81 of the pool.
# 1.43 GiB. A one-shot request needs its own context; a multi-turn one needs more: with prefix
# caching a finished sequence's blocks stay HELD so the next turn can reuse them, so the demand is
# the live SESSIONS, and a context of T tokens occupies about 1.8 x T pool tokens. When the pool
# cannot hold the live sessions, the cache evicts exactly what the next turn asks for, and every
# turn re-prefills its whole context (0% prefix hit; minutes per turn instead of seconds). Watch
# kv_util: the hit rate falls off a cliff as the pool fills.
#
# Defaults are the production shape (gpu-headroom-mib 96, expert-vs-cache-ratio 0.82,
# kv-cache-dtype fp8, max-num-batched-tokens 2048, tp 2, speculation depth 3), with the prefix
# cache on and --checkpoint-slots at its default, because multi-turn chat wants both.
# Defaults are the production shape (gpu-headroom-mib 96, kv-cache-dtype fp8,
# max-num-batched-tokens 2048, tp 2, speculation depth 3), with the prefix cache on and
# --checkpoint-slots at its default, because multi-turn chat wants both.
#
# THE CHUNK IS 2048. `--max-num-batched-tokens` is the prefill chunk when checkpoints are off, and
# it sets how many routed rows the MoE GEMM sees at once. Part of the expert weight is not in
@@ -98,7 +97,7 @@ nohup ./bin/radiance --model "$M" \
--host 0.0.0.0 --port "$P" \
--max-num-seqs ${SEQS:-8} --max-model-len ${MLEN:-200000} \
--tp ${TP:-2} --placement expert_tiered --host-pool-mib ${HOSTPOOL:-12288} \
--gpu-headroom-mib ${HR:-96} --expert-vs-cache-ratio ${RATIO:-0.82} --kv-cache-dtype ${KVD:-fp8} \
--gpu-headroom-mib ${HR:-96} --kv-cache-dtype ${KVD:-fp8} \
--prefix-cache-host-mib ${KVHOST:-4096} \
--prefix-cache-dir ${KVDIR:-$HOME/kvcache} --prefix-cache-disk-mib ${KVDISK:-131072} \
--num-speculative-tokens ${NS:-3} \
+1 -1
View File
@@ -44,7 +44,7 @@ env GPU_MAX_ALLOC_PERCENT=100 GPU_MAX_HEAP_SIZE=100 $EXTRA_ENV \
--host 127.0.0.1 --port "$P" \
--max-num-seqs ${SEQS:-8} --max-model-len ${MLEN:-200000} \
--tp ${TP:-2} --placement expert_tiered --host-pool-mib ${HOSTPOOL:-12288} \
--gpu-headroom-mib ${HR:-96} --expert-vs-cache-ratio ${RATIO:-0.82} --kv-cache-dtype ${KVD:-fp8} \
--gpu-headroom-mib ${HR:-96} --kv-cache-dtype ${KVD:-fp8} \
--num-speculative-tokens ${NS:-3} \
--max-num-batched-tokens ${MNBT:-2048} \
$EXTRA > "$HOME/fntrace.log" 2>&1 &
+2 -2
View File
@@ -5,8 +5,8 @@
# /health, print the endpoints, exit with the server still up. Stop it with scripts/fnstop.sh.
#
# WHY THE VRAM FLAGS ARE ABSENT. This is a DENSE model, so every weight is static and the
# planner takes it off the top as a floor; --expert-vs-cache-ratio then divides an elastic pool
# that has no expert side to claim it, and the slack crosses over to the cache. Stating
# planner takes it off the top as a floor; the elastic pool left after it has no expert side to
# claim it, so all of it goes to the cache. Stating
# --vram-weights-mib here would only cap what does not need capping.
#
# WHY 131072 AND NOT 200000. n_ctx_train is 131072 for this checkpoint; the 200K context
+1 -1
View File
@@ -192,7 +192,7 @@ cmp_arm "B restored from disk is still B" "$B2" "$BH" "$(hit b2)" "$(hit bh)"
curl -sS --fail "http://$H:$P/sessions" > "$work/s.json"
echo " moved: blocks to_host=$(jq -r .moved.to_host < "$work/s.json") to_disk=$(jq -r .moved.to_disk < "$work/s.json") promoted=$(jq -r .moved.promoted < "$work/s.json")"
if [ "$CKS" != "0" ]; then
echo " state: to_host=$(jq -r .snapshots_moved.to_host < "$work/s.json") to_disk=$(jq -r .snapshots_moved.to_disk < "$work/s.json") promoted=$(jq -r .snapshots_moved.promoted < "$work/s.json") dropped=$(jq -r .snapshots_moved.drops < "$work/s.json")"
echo " state: to_disk=$(jq -r .snapshots_moved.to_disk < "$work/s.json") fetched=$(jq -r .snapshots_moved.fetched < "$work/s.json") dropped=$(jq -r .snapshots_moved.drops < "$work/s.json")"
# A RUN WITH NO CONTENTION TESTED THE EASY CASE. Two stores have to run out for the paths this
# script exists for to execute, and they are sized by different flags: --checkpoint-slots is
# the DEVICE pool the retention policy spends, and a share of --prefix-cache-host-mib (startup
+20 -18
View File
@@ -122,7 +122,7 @@ where() { # where -> "vram=N ram=N disk=N [+ snapshots]" for
snap
w="vram=$(q .blocks_sum_overlapping.device) ram=$(q .blocks_sum_overlapping.host) disk=$(q .blocks_sum_overlapping.disk)"
if [ "$(q .snapshots_moved.bytes_each)" != "0" ]; then
w="$w state: vram=$(q .snapshots.device) ram=$(q .snapshots.host) disk=$(q .snapshots.disk)"
w="$w state: ram=$(q .snapshots.host) disk=$(q .snapshots.disk)"
fi
echo "$w"
}
@@ -188,26 +188,28 @@ case "$(q .blocks_sum_overlapping.host)" in 0|null|"") false ;; *) true ;; esac
(--prefix-cache-host-mib set? is the maintenance pass running?)"
if [ "$HYBRID" = 1 ]; then
snap
[ "$(q .snapshots_moved.to_host)" = "0" ] && \
note "no linear-state snapshot reached RAM, so the restore below tests the blocks only
(starved: $(q .snapshots_moved.starved), dropped: $(q .snapshots_moved.drops))"
# A SNAPSHOT IS IN HOST MEMORY FROM THE MOMENT IT IS SAVED (the checkpoint store), so the
# session's state must be there or on disk -- nowhere else is a place it can be.
case "$(q .snapshots.host)/$(q .snapshots.disk)" in 0/0|null/*|*/null) false ;; *) true ;; esac || \
note "the session holds no linear-state snapshot, so the restore below tests the blocks only
(dropped: $(q .snapshots_moved.drops))"
fi
snap
PROM0=$([ "$HYBRID" = 1 ] && q .snapshots_moved.promoted || echo 0)
FET0=$([ "$HYBRID" = 1 ] && q .snapshots_moved.fetched || echo 0)
LIN0=$([ "$HYBRID" = 1 ] && lin || echo 0)
DEV0=$([ "$HYBRID" = 1 ] && q .snapshots.device || echo 0)
RAM0=$([ "$HYBRID" = 1 ] && q .snapshots.host || echo 0)
FROMHOST=$(ask fromhost)
echo " restored from RAM $FROMHOST [$(where)]"
check "a session restored from RAM reproduces the cold answer" "$FROMHOST" "$COLD"
if [ "$HYBRID" = 1 ]; then
snap
# A SNAPSHOT STILL IN ITS DEVICE SLOT NEEDS NO PROMOTION: it stays there when the blocks go,
# and only the checkpoint pool's own pressure detaches it. Whether it was SERVED is the check
# below either way; this one only says which path served it.
if [ "$(q .snapshots_moved.promoted)" -gt "$PROM0" ]; then
echo " ok its linear state came back with it ($(( $(q .snapshots_moved.promoted) - PROM0 )) snapshot(s))"
elif [ "$DEV0" -gt 0 ]; then
echo " -- its linear state never left its device slot ($DEV0 there), so nothing was promoted"
# A SNAPSHOT IN THE STORE NEEDS NO READ: it is restored straight out of its slot, and only
# the store's own pressure sends it to disk. Whether it was SERVED is the check below either
# way; this one only says which path served it.
if [ "$(q .snapshots_moved.fetched)" -gt "$FET0" ]; then
echo " ok its linear state was read back off disk ($(( $(q .snapshots_moved.fetched) - FET0 )) snapshot(s))"
elif [ "$RAM0" -gt 0 ]; then
echo " -- its linear state stayed in the snapshot store ($RAM0 there), so nothing was read"
else
note "the blocks came back and the linear state did not -- the answer is right and the
session will replay every recurrent layer from an older checkpoint to produce it"
@@ -238,25 +240,25 @@ if [ "$HYBRID" = 1 ]; then
(disk snapshot slots: $(q .snapshots_moved.disk_slots))"
fi
snap
PROM1=$([ "$HYBRID" = 1 ] && q .snapshots_moved.promoted || echo 0)
FET1=$([ "$HYBRID" = 1 ] && q .snapshots_moved.fetched || echo 0)
LIN1=$([ "$HYBRID" = 1 ] && lin || echo 0)
FROMDISK=$(ask fromdisk)
echo " restored from disk $FROMDISK [$(where)]"
check "a session restored from disk reproduces the cold answer" "$FROMDISK" "$COLD"
if [ "$HYBRID" = 1 ]; then
snap
if [ "$(q .snapshots_moved.promoted)" -gt "$PROM1" ]; then
if [ "$(q .snapshots_moved.fetched)" -gt "$FET1" ]; then
echo " ok its linear state came back from disk too"
else
note "nothing promoted a snapshot out of disk -- the filler's snapshots did not push the
session's out of the device pool (--checkpoint-slots 2?), so the disk path never ran"
note "no snapshot was read off disk -- the filler's snapshots did not push the session's
out of the snapshot store (--checkpoint-slots 2?), so the disk path never ran"
fi
if [ "$(lin)" -gt "$LIN1" ]; then
echo " ok and the state restored from disk was SERVED ($(( $(lin) - LIN1 )) prompt tokens)"
else
note "a snapshot came back from disk and no lookup used it"
fi
echo " snapshots: to_host=$(q .snapshots_moved.to_host) to_disk=$(q .snapshots_moved.to_disk) promoted=$(q .snapshots_moved.promoted) dropped=$(q .snapshots_moved.drops) starved=$(q .snapshots_moved.starved)"
echo " snapshots: to_disk=$(q .snapshots_moved.to_disk) fetched=$(q .snapshots_moved.fetched) dropped=$(q .snapshots_moved.drops)"
fi
# ---- and the text itself, so a failure says WHERE ----------------------------------------------