radiance 1.5.0

- Gemma 4 31B (PRs #74, #75, #81, #86; sfjes, keptn42): sliding and global attention with their
  own kernels, the assistant head as a drafter that reads the trunk's cache, the vision tower, a
  fused w4a8 decode step, bf16 and compressed-tensors int4 checkpoints, and window snapshots so a
  prefix hit on a sliding-window model resumes instead of prefilling again.
  deploy/compose/gemma4-31b-w4a8.yaml serves keptn42's container on two cards
- ParoQuant (PRs #65, #66, #67; malic): Qwen3.8-27B checkpoints with learned Givens rotations,
  as int4, int5 and MXFP4, imported without re-quantising, the prefill's rotations on the matrix
  cores. deploy/compose/qwen3.8-27b-paro.yaml serves them on one card. A ParoQuant container made
  with the PR builds is refused: convert it again with --reuse <old container>
- Gemma 4 26B-A4B with z-lab's DFlash drafter (PR #88; Perire): arch/gemma4 serves Google's bf16
  checkpoint with the routed experts in block fp8 or bf16 (data/recipes/gemma4-26b-a4b-df*.recipe),
  and libr4d gains its windowed paged attention, the fused sandwich-norm joins, expert_scale and
  the sharded draft head's pair_argmax. A prefill chunk runs as two slices with its all-reduces
  beside the compute, bit-exact with the whole step. The 31B's global layers take the windowed
  attention too: an 11.5K-token prefill on two R9700s in 3.1 s instead of 4.9
- a startup that logs nothing for two minutes says where it waits (#89): the system call (a KFD
  request by name), the library that made it, and its stack, which addr2line resolves against the
  binary
- the prefix cache is kept in VRAM and host memory only (#70): the disk tier wrote every block and
  snapshot a prompt produced, and its copies never outlived the process. --prefix-cache-host-mib
  is renamed --prefix-cache-mib; --prefix-cache-dir and --prefix-cache-disk-mib are removed, and
  startup refuses all three with what replaced them. The compose files no longer mount /data, and
  .env no longer needs RADIANCE_STATE
- --prefix-cache-ttl S (default 3600, 0 never): a conversation no request has used for that long
  leaves the cache, whichever tier holds it; radiance:prefix_cache_expired_total counts them. A
  full host tier now drops its least recently used conversations
- --vision-tower-placement vram|ram (#84): ram keeps an encoder tower in pinned host memory and
  gives its VRAM to the KV cache, read over the link once an image
- timings carry ttft_ms and total_ms (#85): the server's own time from the request body's arrival
  to the first and the last token, queueing and tokenisation included
- a KV-cache recall that found a moved expert with nowhere to go stopped halfway and leaked the
  slots it had already freed: after it every recall failed, the cache stayed short until a
  restart, and requests failed with HTTP 500. A recall now waits for the slots it is owed and
  always finishes
- a tool result or tool-call arguments that are not JSON are no longer refused as nesting past
  1024 levels for their unmatched brackets (#90): only text that parses as JSON is held to the
  bound, since nothing else is parsed into a tree
- the host-pool refusal names the limit that applies to pinned memory (RAM less 1/64 and
  1.5 GiB), not ttm.pages_limit
- --embedding-placement auto, removed in 1.3.0, is refused with what replaced it
- for out-of-tree kernel libraries: gemm_nt_q gains two operands (pb1, pb2, the part bounds), and
  the loader requires identical op schemas, so a library built against 1.4.0 must be rebuilt. For
  architecture plugins, rad_op_declared(b, op) asks whether an op is in the loaded vocabulary
  without declaring it
This commit is contained in:
Deadcode committed 2026-10-13 19:35:16 +02:00
commit b93b531f63
127 files changed
+9609 -4796

No files matched your search

+24 -36
View File
@@ -8,12 +8,14 @@
# cache can have -- an entry holding reassigned block ids, a checkpoint slot freed by one session
# and still named by another -- need two sessions in flight to show up at all.
#
# THE SCARCE RESOURCE IS THE CHECKPOINT SLOT, so run this with --checkpoint-slots low enough that
# the two sessions fight over it. That is what makes the retention policy and the victim scan run,
# which is what makes a snapshot get retired underneath a record that still names its slot:
# A HOST TIER THE FILLER OVERFLOWS, so the arena's drops run as well as its restores:
#
# --checkpoint-slots 2 --prefix-cache-host-mib 512 --prefix-cache-disk-mib 16384 \
# --prefix-cache-dir <dir>
# --prefix-cache-mib 512
#
# AND ENOUGH SNAPSHOT SLOTS FOR BOTH SESSIONS. On a hybrid model a hit is clamped to the deepest
# snapshot it reaches, and a store too small for both makes each session retire the other's: every
# arm then re-prefills from zero and restores nothing, so the device arm's reuse is checked below.
# The default --checkpoint-slots holds both.
#
# EACH SESSION IS COMPARED ONLY TO ITSELF. A and B are different prompts and their answers differ
# for ordinary reasons; what must hold is that A's restored answer is A's cold answer. Corrupt
@@ -23,7 +25,6 @@ set -e
P=${P:-8100}
H=${H:-127.0.0.1}
TO_HOST=${TO_HOST:-10}
TO_DISK=${TO_DISK:-180}
FILL=${FILL:-1200}
N=${N:-48}
work=$(mktemp -d "${TMPDIR:-/tmp}/tiercross.XXXXXX")
@@ -108,12 +109,11 @@ cmp_arm() { # cmp_arm <label> <sha> <ref sha> <reuse> <ref reu
fi
}
# ---- pushing a session out of host memory --------------------------------------------------------
# NOTHING LEAVES HOST MEMORY ON A CLOCK. Every host copy is written on to disk as soon as it lands
# and keeps its host slot until another entry needs one, so the way to put a session on disk is to
# A FULL HOST TIER DROPS ITS LEAST RECENTLY USED ENTRIES, so the way to push the sessions out is to
# give the arena something else to hold: a prompt that shares no prefix with anything here and is
# bigger than the room the arena has left. The server must be started with a host tier FILL
# sections of it overflow; --prefix-cache-host-mib 512 holds about 27K tokens on
# Qwen3.8-Flash-Next, and the default FILL is about 30K.
# sections of it overflow; --prefix-cache-mib 512 holds about 27K tokens on Qwen3.8-Flash-Next, and
# the default FILL is about 30K.
fill_arena() {
: > "$work/fill.txt"
i=0
@@ -127,19 +127,8 @@ fill_arena() {
curl -sS --fail -X POST "http://$H:$P/v1/completions" -H 'Content-Type: application/json' \
--data @"$work/fill.json" > /dev/null
}
# Until some blocks are on the disk tier, or TO_DISK seconds. The filler's copies are what take the
# slots, and they land after its request finishes.
wait_disk() {
t=0
while [ $t -lt "$TO_DISK" ]; do
curl -sS --fail "http://$H:$P/sessions" > "$work/w.json"
case "$(jq -r .blocks_sum_overlapping.disk < "$work/w.json")" in 0|null|"") ;; *) return 0 ;; esac
sleep 2; t=$((t + 2))
done
return 1
}
echo "tiercross: $H:$P, two sessions, ${TO_HOST}s for VRAM to go, $FILL filler sections"
CKS=$(curl -sS --fail "http://$H:$P/sessions" | jq -r .snapshots_moved.bytes_each)
CKS=$(curl -sS --fail "http://$H:$P/sessions" | jq -r .snapshot_store.bytes_each)
[ "$CKS" = "0" ] && echo " (no recurrent state in this model; the attention half is still tested)"
A0=$(ask A a0); B0=$(ask B b0)
@@ -165,6 +154,11 @@ done
AH=$(ask A ah); BH=$(ask B bh)
echo " device A $AH reuse $(hit ah)"
echo " B $BH reuse $(hit bh)"
# A DEVICE HIT THAT REUSED NOTHING TESTS NOTHING: every arm below would be a fresh prefill.
for f in ah bh; do
case "$(hit $f)" in 0|null|"") echo " FAIL the $f arm reused nothing -- no hit, so no restore below can be tested
(a snapshot store too small for both sessions? --checkpoint-slots)"; fail=$((fail + 1)) ;; esac
done
if [ "$AH" != "$A0" ] || [ "$BH" != "$B0" ]; then
echo " note: a device hit does not reproduce the cold answer. That is not necessarily wrong --"
echo " the hit reuses $(hit ah)/$(hit bh) tokens where the cold run reused nothing -- but every"
@@ -181,25 +175,19 @@ cmp_arm "B restored from RAM is still B" "$B1" "$BH" "$(hit b1)" "$(hit bh)"
echo " filling host memory with $FILL sections of something else..."
fill_arena
wait_disk || echo " note: nothing reached the disk tier within ${TO_DISK}s; the arm below may be a RAM restore"
sleep $((TO_HOST + 8))
A2=$(ask A a2); B2=$(ask B b2)
echo " from disk A $A2 reuse $(hit a2)"
echo " after a full host tier"
echo " A $A2 reuse $(hit a2)"
echo " B $B2 reuse $(hit b2)"
cmp_arm "A restored from disk is still A" "$A2" "$AH" "$(hit a2)" "$(hit ah)"
cmp_arm "B restored from disk is still B" "$B2" "$BH" "$(hit b2)" "$(hit bh)"
cmp_arm "A after the arena's drops is still A" "$A2" "$AH" "$(hit a2)" "$(hit ah)"
cmp_arm "B after the arena's drops 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_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
# says how many snapshots) is the snapshot store the tiers spend. `drops` counts the second.
[ "$(jq -r .snapshots_moved.drops < "$work/s.json")" = "0" ] && \
echo " note: the snapshot store never overflowed -- lower --prefix-cache-host-mib to make the two sessions contend for it"
fi
echo " moved: blocks to_host=$(jq -r .moved.to_host < "$work/s.json") promoted=$(jq -r .moved.promoted < "$work/s.json") host_drops=$(jq -r .moved.host_drops < "$work/s.json")"
# A RUN WITH NO CONTENTION TESTED THE EASY CASE: the arena has to run out for its drop path to run.
[ "$(jq -r .moved.host_drops < "$work/s.json")" = "0" ] && \
echo " note: the host tier never overflowed -- lower --prefix-cache-mib or raise FILL"
if [ "$fail" -ne 0 ]; then
echo