Archived
radiance 1.7.0
- every model serves without a GPU: libavx covers every op, so `--kernels libavx` alone serves every shipped container - Qwen3-ASR (zivius): speech to text on /v1/audio/transcriptions and live over /v1/realtime - /v1/messages works with Claude Code as it ships (gearwave00001) - a long agent conversation keeps its cached history when the client rewrites its last turn (manueloverride) - a stream's first event goes out with the first token, so llama-benchy measures prefill right - opt-in --prefill-interleave (Smellyyyy, baKon) and --prefill-span (keptn42) - four-rank TP releases the link early; four-rank selftests and docs/TP4.md (goodman-b) - NVFP4 and FP8 compressed-tensors imports (devmilan); tools/rad-export for finetunes and LoRA adapters (baKon) - many fixes, among them lost tokens on stop strings under concurrency, keep-alive, MiniCPM5 tool arguments and the CPU's vision and audio encoders - plugin ABI 17 and changed op schemas: out-of-tree plugins must be rebuilt
This commit is contained in:
1 parent
b068190326
commit
1e968f6e1d
739 files changed
+128447
-84632
No files matched your search
+42
-66
@@ -1,30 +1,21 @@
|
||||
#!/bin/sh
|
||||
# tierident.sh -- does a session that left VRAM come back BYTE FOR BYTE, both halves of it?
|
||||
# tierident.sh -- checks that a session that left VRAM comes back byte for byte, attention blocks
|
||||
# and recurrent state both.
|
||||
#
|
||||
# This is the acceptance test for the idle session tiers (core/mem/kvtier.h). It is a byte
|
||||
# comparison because CORRUPT KV DOES NOT READ AS BABBLE -- it reads as fluent, deterministic,
|
||||
# coherent, plausible text that simply is not the text the model would have produced, and nothing
|
||||
# that looks at the engine from outside notices it. Only a byte comparison against a known-good
|
||||
# arm sees it.
|
||||
# Acceptance test for the idle session tiers (core/mem/kvtier.h). Corrupt KV produces fluent,
|
||||
# deterministic, plausible text that is simply not what the model would have produced, so only a
|
||||
# byte comparison against a known-good arm detects it.
|
||||
#
|
||||
# THE CONTROL IS THE WHOLE TEST. Arm 2 asks the same prompt again while the session is still in
|
||||
# VRAM. If that does not reproduce arm 1 exactly, then this model at this temperature is not
|
||||
# reproducible across requests at all and every later comparison is meaningless -- a differing sha
|
||||
# would prove nothing, because a cache hit COULD have been legitimately tie-divergent. Run the
|
||||
# control or do not run the test.
|
||||
# The control is essential: arm 2 asks the same prompt while the session is still in VRAM. If it
|
||||
# does not reproduce arm 1 exactly, the server is not reproducible across requests and every later
|
||||
# comparison is meaningless, so the script stops.
|
||||
#
|
||||
# ============================== AND ON A HYBRID MODEL, HALF THE TEST IS INVISIBLE ===============
|
||||
#
|
||||
# A session on a hybrid model is attention blocks AND a recurrent-state snapshot. The two are
|
||||
# stored separately and can be lost separately -- and losing the snapshot IS NOT VISIBLE IN THE
|
||||
# TEXT. The engine simply replays the linear layers from an older checkpoint, or from token zero,
|
||||
# and produces exactly the same answer, slower. So byte identity proves the blocks came back and
|
||||
# says nothing whatever about the state.
|
||||
#
|
||||
# That is why every snapshot assertion below is a counter and not a sha. A run where the blocks
|
||||
# moved and the snapshots did not is a PASS by text and a FAILURE here, and it is the failure that
|
||||
# matters: it is the difference between a restored 200K session costing a second and costing a
|
||||
# minute of linear replay.
|
||||
# On a hybrid model a session is attention blocks plus a recurrent-state snapshot, stored and lost
|
||||
# separately. A lost snapshot does not change the text: the engine replays the linear layers from
|
||||
# an older checkpoint or token zero and gives the same answer, slower. Byte identity therefore
|
||||
# proves only the blocks, and every snapshot assertion is a counter. Blocks moving without the
|
||||
# snapshot is a failure here: for a restored 200K session it is the difference between a second
|
||||
# and a minute of linear replay.
|
||||
#
|
||||
# scripts/tierident.sh # against a server already up on $P (default 8100)
|
||||
#
|
||||
@@ -47,17 +38,12 @@ trap 'rm -rf "$work"' EXIT INT TERM
|
||||
|
||||
command -v jq >/dev/null || { echo "tierident: jq is required" >&2; exit 2; }
|
||||
|
||||
# A PROMPT LONG ENOUGH TO BE WORTH TIERING, AND LONGER THAN A CHECKPOINT INTERVAL. The unit of the
|
||||
# attention half is the block, so a prompt of a few tokens occupies one and exercises nothing. The
|
||||
# unit of the linear half is the checkpoint interval -- 2048 tokens by default -- and a prompt
|
||||
# shorter than that produces NO snapshot at all, so every snapshot assertion below would be
|
||||
# vacuously satisfied by a server where snapshot tiering is entirely broken.
|
||||
# The prompt must span many blocks and exceed a checkpoint interval (2048 tokens by default):
|
||||
# shorter, it produces no snapshot and every snapshot assertion passes vacuously.
|
||||
#
|
||||
# AND IT HAS TO ASK FOR SOMETHING. A wall of repeated sentences with no question at the end is a
|
||||
# passage an instruction-tuned model can answer with a single EOS, and every arm would then compare
|
||||
# an empty string to an empty string and report the control green. That is the same failure this
|
||||
# whole script is built around -- a comparison that passes because neither side has any content --
|
||||
# so the answer length is checked below as well.
|
||||
# It must also ask a question. An instruction-tuned model may answer a wall of repeated sentences
|
||||
# with a single EOS, and empty answers would pass the control, so the answer length is checked
|
||||
# below.
|
||||
: > "$work/p.txt"
|
||||
i=0
|
||||
while [ $i -lt 300 ]; do
|
||||
@@ -65,10 +51,9 @@ while [ $i -lt 300 ]; do
|
||||
i=$((i + 1))
|
||||
done
|
||||
printf '\nUsing only the passage above, write three sentences about it.\n\nAnswer: ' >> "$work/p.txt"
|
||||
# THE FILE IS THE PROMPT, READ VERBATIM, through jq's --rawfile. Escaping it by hand into a shell
|
||||
# variable doubles the backslash jq adds before every quote, and flattening its newlines welds the
|
||||
# question onto the passage ("...why it matters.Answer:" on one line), which this model answers
|
||||
# with an immediate EOS -- the empty-completion failure described above.
|
||||
# The file is sent verbatim through jq's --rawfile. Escaping it into a shell variable doubles the
|
||||
# backslash jq adds before every quote, and flattening newlines joins the question to the passage
|
||||
# ("...why it matters.Answer:"), which gets an immediate EOS.
|
||||
|
||||
ask() { # ask <label> -> writes $work/<label>.txt, echoes its sha
|
||||
jq -n --rawfile p "$work/p.txt" --argjson n "$N" \
|
||||
@@ -80,11 +65,10 @@ ask() { # ask <label> -> writes $work/<label>.txt, echoes
|
||||
sha1sum < "$work/$1.txt" | cut -d' ' -f1
|
||||
}
|
||||
# ---- pushing a session out of host memory --------------------------------------------------------
|
||||
# A FULL HOST TIER DROPS ITS LEAST RECENTLY USED ENTRIES, so the way to push a session 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-mib 512 holds about 27K tokens on Qwen3.8-Flash-Next, and the default
|
||||
# FILL is about 30K.
|
||||
# A full host tier drops its least recently used entries, so the session is pushed out by a
|
||||
# prompt that shares no prefix with it and exceeds the arena's free room. The host tier must be
|
||||
# small enough for FILL sections to overflow it: --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
|
||||
@@ -100,10 +84,9 @@ fill_arena() {
|
||||
}
|
||||
snap() { curl -sS --fail "http://$H:$P/sessions" > "$work/s.json"; }
|
||||
q() { jq -r "$1" < "$work/s.json"; }
|
||||
# PROMPT TOKENS A LOOKUP COVERED WITH RECURRENT STATE. Moving a snapshot and moving it back proves
|
||||
# the bytes travelled and nothing more; this is the number that says a hit then SERVED one. They
|
||||
# are not the same claim -- a restore that puts the state back somewhere the chain cannot reach
|
||||
# scores perfectly on the first and zero on this.
|
||||
# Prompt tokens a lookup covered with recurrent state. A snapshot moving out and back only proves
|
||||
# the bytes travelled; this counter shows a hit actually served it. A restore to a place the chain
|
||||
# cannot reach passes the first and scores zero here.
|
||||
lin() { jq -r ".linear.cached_tokens" < "$work/s.json"; }
|
||||
|
||||
where() { # where -> "vram=N ram=N [+ snapshots]" for the whole server
|
||||
@@ -124,9 +107,8 @@ note() { echo " FAIL $1"; fail=$((fail + 1)); }
|
||||
|
||||
echo "tierident: $H:$P, ${TO_HOST}s for VRAM to go, $FILL filler sections to push host memory out"
|
||||
|
||||
# IS THERE A LINEAR HALF AT ALL. A pure-attention model has no snapshots and must not be failed
|
||||
# for having none; a hybrid one with a snapshot store of zero slots is a real misconfiguration and
|
||||
# is named as one rather than skipped.
|
||||
# A pure-attention model has no snapshots and is not failed for it; a hybrid model with zero
|
||||
# snapshot slots is a misconfiguration and is reported.
|
||||
snap
|
||||
HYBRID=0
|
||||
[ "$(q .snapshot_store.bytes_each)" != "0" ] && HYBRID=1
|
||||
@@ -141,8 +123,7 @@ fi
|
||||
COLD=$(ask cold)
|
||||
echo " cold $COLD [$(where)]"
|
||||
|
||||
# AN EMPTY ANSWER MAKES EVERY COMPARISON BELOW VACUOUS, and it is the easiest way for this script
|
||||
# to report a confident green having tested nothing: three identical shas of the empty string.
|
||||
# An empty answer would make every comparison below pass vacuously.
|
||||
CN=$(wc -c < "$work/cold.txt")
|
||||
if [ "$CN" -lt 32 ]; then
|
||||
echo "tierident: the model answered $CN bytes. Every sha below would match for that reason" >&2
|
||||
@@ -165,19 +146,15 @@ echo " waiting $((TO_HOST + 8))s for the session to leave VRAM..."
|
||||
sleep $((TO_HOST + 8))
|
||||
W=$(where)
|
||||
echo " after the host threshold [$W]"
|
||||
# A RUN THAT MOVED NOTHING IS A FAILURE, NOT A PASS. This is the trap the whole script exists to
|
||||
# avoid, turned on itself: if the session never left VRAM then every arm below is an ordinary
|
||||
# device hit, the shas match for a reason that has nothing to do with tiering, and reporting PASS
|
||||
# would be exactly the false confidence a byte comparison is supposed to replace.
|
||||
# A run that moved nothing is a failure: every arm below would be an ordinary device hit.
|
||||
snap
|
||||
# A MISSING FIELD IS THE SAME FAILURE AS A ZERO: if the /sessions layout changes, this guard reads
|
||||
# `null`, and treating that as a pass would pass vacuously.
|
||||
# A missing field counts as zero, so a changed /sessions layout (`null`) fails rather than passes.
|
||||
case "$(q .blocks_sum_overlapping.host)" in 0|null|"") false ;; *) true ;; esac || note "the session never left VRAM -- nothing below would test anything
|
||||
(--prefix-cache-mib set? is the maintenance pass running?)"
|
||||
if [ "$HYBRID" = 1 ]; then
|
||||
snap
|
||||
# A SNAPSHOT IS IN HOST MEMORY FROM THE MOMENT IT IS SAVED (the checkpoint store), so the
|
||||
# session's state must be there -- nowhere else is a place it can be.
|
||||
# Snapshots live in host memory (the checkpoint store) from the moment they are saved, so the
|
||||
# session's state must be there.
|
||||
case "$(q .snapshots_sum_overlapping)" in 0|null|"") false ;; *) true ;; esac || \
|
||||
note "the session holds no linear-state snapshot, so the restore below tests the blocks only"
|
||||
fi
|
||||
@@ -188,8 +165,8 @@ 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 NEEDS NO READ: it is restored straight out of its slot in the store. Whether it was
|
||||
# SERVED is the check.
|
||||
# A snapshot is restored straight from its slot in the store; the check is whether it was
|
||||
# served.
|
||||
if [ "$(lin)" -gt "$LIN0" ]; then
|
||||
echo " ok and the restored state was SERVED ($(( $(lin) - LIN0 )) prompt tokens covered by it)"
|
||||
else
|
||||
@@ -199,10 +176,9 @@ if [ "$HYBRID" = 1 ]; then
|
||||
fi
|
||||
|
||||
# ---- a full host tier ---------------------------------------------------------------------------
|
||||
# THE FILLER OVERFLOWS THE ARENA, and the arena drops its least recently used entries -- this
|
||||
# session's -- to make room. What comes back then is a recompute, or a restore of what survived; the
|
||||
# answer is the cold one either way, and an entry the arena dropped that the cache went on serving
|
||||
# would show here as another conversation's context.
|
||||
# The filler overflows the arena, which drops this session's entries as least recently used. The
|
||||
# next answer is a recompute or a partial restore, and must equal the cold one either way; a dropped
|
||||
# entry the cache kept serving would show as another conversation's context.
|
||||
echo " filling host memory with $FILL sections of something else..."
|
||||
snap
|
||||
DROP0=$(q .moved.host_drops)
|
||||
@@ -234,7 +210,7 @@ if [ "$TTL" -gt 0 ]; then
|
||||
check "a session asked again after it expired reproduces the cold answer" "$EXPIRED" "$COLD"
|
||||
fi
|
||||
|
||||
# ---- and the text itself, so a failure says WHERE ----------------------------------------------
|
||||
# ---- the differing text, to locate a failure ---------------------------------------------------
|
||||
if [ "$fail" -ne 0 ]; then
|
||||
echo
|
||||
echo "The first differing line, cold vs the failing arm:"
|
||||
|
||||
Reference in new issue
Block a user