From 0258ae08975e99f2a31b15327713329b1ad95511 Mon Sep 17 00:00:00 2001 From: Frank Date: Tue, 6 Oct 2026 20:31:46 -0700 Subject: [PATCH] frank-primary: pin radiance v1.2.0, translate expert-vs-cache-ratio to vram knobs Engine v1.2.0 (Codeberg e95d397, Docker Hub tag 1.2.0, index digest 665775ed...) removes --expert-vs-cache-ratio. The explicit --vram-weights-mib 26071 / --vram-kv-mib 3543 pair transcribes the live 1.0.13 boot ledger at ratio 0.82 (weights 25.46 GiB, KV 3.46 GiB per card); bracket arms scale KV linearly in (1-r): 0.90 -> 1968, 0.95 -> 984. Serve script, autoresearch harness, and bats gates follow; the bats shape asserts are realigned to the deployed seqs=3/spec=2 sweep result (95923d3, df6b5bb) they failed to track. --- scripts/autoresearch-frank-primary.sh | 3 ++- scripts/frank-primary.env | 24 +++++++++++++++++++----- scripts/serve-frank-primary.sh | 6 ++++-- tests/frank_primary_unit.bats | 15 +++++++++------ 4 files changed, 34 insertions(+), 14 deletions(-) diff --git a/scripts/autoresearch-frank-primary.sh b/scripts/autoresearch-frank-primary.sh index 44dcc2a..9d9f857 100755 --- a/scripts/autoresearch-frank-primary.sh +++ b/scripts/autoresearch-frank-primary.sh @@ -87,7 +87,8 @@ podman run -d --name "$SCRATCH" \ --placement "$FRANK_PRIMARY_PLACEMENT" \ --host-pool-mib "$FRANK_PRIMARY_HOST_POOL_MIB" \ --gpu-headroom-mib "$FRANK_PRIMARY_GPU_HEADROOM_MIB" \ - --expert-vs-cache-ratio "$FRANK_PRIMARY_EXPERT_VS_CACHE" \ + --vram-weights-mib "$FRANK_PRIMARY_VRAM_WEIGHTS_MIB" \ + --vram-kv-mib "$FRANK_PRIMARY_VRAM_KV_MIB" \ --kv-cache-dtype "$FRANK_PRIMARY_KV_DTYPE" \ --prefix-cache-host-mib "$FRANK_PRIMARY_PREFIX_HOST_MIB" \ --prefix-cache-dir "/data/kvcache/$SCRATCH" \ diff --git a/scripts/frank-primary.env b/scripts/frank-primary.env index 298e625..a042f30 100644 --- a/scripts/frank-primary.env +++ b/scripts/frank-primary.env @@ -50,8 +50,16 @@ # publisher's throughput peak for this model. Stated explicitly with # --num-speculative-tokens 3. # - The fused TP all-reduce is declared over max-num-seqs x -# (1 + --num-speculative-tokens) rows; 2 x 4 = 8 rows fits either wire. -FRANK_PRIMARY_IMAGE=stilldeadcode/radiance@sha256:4c3f484564bb2872784e46b0a59cbd71becc9c1e746e301a3596ffae253c322e +# (1 + --num-speculative-tokens) rows; 3 x 3 = 9 rows fits either wire. +# Engine pin: Codeberg tag v1.2.0 (commit e95d397), Docker Hub tag 1.2.0 +# (no `v` prefix on tags), index digest below, pushed 2026-10-06. 1.2.0 +# REMOVED --expert-vs-cache-ratio in favour of the explicit +# --vram-weights-mib / --vram-kv-mib pair (core/config.cpp), and added +# MXFP4 dense kernels, --p2p host twins, a stop-string fix, a DFlash2 +# fix, and a MoE weight-rotation change (92b8aaf). Prior pin +# sha256:4c3f484564bb2872784e46b0a59cbd71becc9c1e746e301a3596ffae253c322e +# = tag 1.0.13, the rollback engine. +FRANK_PRIMARY_IMAGE=stilldeadcode/radiance@sha256:665775ed1d90de6dbb25558e07fc60d20328f1346f96f3c6e00845eb763f01fa # The .rad container FILE (mounted under /models) and the state dir for the # prefix-cache disk tier (mounted rw at /data). The model dir holds ONLY # .rad files; the raw HF download and its staging dir live beside it and @@ -106,9 +114,15 @@ FRANK_PRIMARY_PLACEMENT=expert_tiered FRANK_PRIMARY_HOST_POOL_MIB=40960 # VRAM left unclaimed per card (publisher default 96 MiB). FRANK_PRIMARY_GPU_HEADROOM_MIB=96 -# Weights share of claimed VRAM (publisher production value; higher = more -# prefix-cache hit rate, less KV headroom). -FRANK_PRIMARY_EXPERT_VS_CACHE=0.82 +# VRAM split of claimed memory per card, MiB (0 = derive from the card). +# Engine 1.2.0 REMOVED --expert-vs-cache-ratio; these two knobs replace +# it. The values transcribe the live 1.0.13 boot ledger at ratio 0.82: +# vram_weights 25.46 GiB, vram_kv 3.46 GiB per card -> 26071 / 3543. +# Bracket arms scale the KV term linearly in (1-r) from the 0.82 anchor +# with weights fixed: ratio 0.90 -> KV 1968, ratio 0.95 -> KV 984. The +# boot ledger arbitrates; re-derive after any payload change. +FRANK_PRIMARY_VRAM_WEIGHTS_MIB=26071 +FRANK_PRIMARY_VRAM_KV_MIB=3543 # KV cache in FP8 (7.32 KiB/token at this model's 12 full-attention layers, # 2 KV heads, 256 head_dim, K+V). FRANK_PRIMARY_KV_DTYPE=fp8 diff --git a/scripts/serve-frank-primary.sh b/scripts/serve-frank-primary.sh index a0bf8a2..d30a1b2 100755 --- a/scripts/serve-frank-primary.sh +++ b/scripts/serve-frank-primary.sh @@ -50,7 +50,8 @@ set +a : "${FRANK_PRIMARY_PLACEMENT:?FRANK_PRIMARY_PLACEMENT must be set}" : "${FRANK_PRIMARY_HOST_POOL_MIB:?FRANK_PRIMARY_HOST_POOL_MIB must be set}" : "${FRANK_PRIMARY_GPU_HEADROOM_MIB:?FRANK_PRIMARY_GPU_HEADROOM_MIB must be set}" -: "${FRANK_PRIMARY_EXPERT_VS_CACHE:?FRANK_PRIMARY_EXPERT_VS_CACHE must be set}" +: "${FRANK_PRIMARY_VRAM_WEIGHTS_MIB:?FRANK_PRIMARY_VRAM_WEIGHTS_MIB must be set}" +: "${FRANK_PRIMARY_VRAM_KV_MIB:?FRANK_PRIMARY_VRAM_KV_MIB must be set}" : "${FRANK_PRIMARY_KV_DTYPE:?FRANK_PRIMARY_KV_DTYPE must be set}" : "${FRANK_PRIMARY_SPEC_TOKENS:?FRANK_PRIMARY_SPEC_TOKENS must be set}" : "${FRANK_PRIMARY_MAX_BATCHED_TOKENS:?FRANK_PRIMARY_MAX_BATCHED_TOKENS must be set}" @@ -186,7 +187,8 @@ podman run -d --name "$FRANK_PRIMARY_CONTAINER" \ --placement "$FRANK_PRIMARY_PLACEMENT" \ --host-pool-mib "$FRANK_PRIMARY_HOST_POOL_MIB" \ --gpu-headroom-mib "$FRANK_PRIMARY_GPU_HEADROOM_MIB" \ - --expert-vs-cache-ratio "$FRANK_PRIMARY_EXPERT_VS_CACHE" \ + --vram-weights-mib "$FRANK_PRIMARY_VRAM_WEIGHTS_MIB" \ + --vram-kv-mib "$FRANK_PRIMARY_VRAM_KV_MIB" \ --kv-cache-dtype "$FRANK_PRIMARY_KV_DTYPE" \ --prefix-cache-host-mib "$FRANK_PRIMARY_PREFIX_HOST_MIB" \ --prefix-cache-dir /data/kvcache/frank-primary \ diff --git a/tests/frank_primary_unit.bats b/tests/frank_primary_unit.bats index 61a09ed..2ae72ec 100755 --- a/tests/frank_primary_unit.bats +++ b/tests/frank_primary_unit.bats @@ -118,19 +118,21 @@ TEMPLATE="$REPO_ROOT/scripts/qwen38-froggeric-v22.5.jinja" grep -q '^FRANK_PRIMARY_MAX_MODEL_LEN=200000$' "$ENV_FILE" ml=$(awk -F= '/^FRANK_PRIMARY_MAX_MODEL_LEN=/{print $2}' "$ENV_FILE") [ "$ml" -ge 177356 ] - # First-boot conservative shape (Frank's call): 2 decode slots. The - # fused TP all-reduce is declared over seqs x (1 + spec) rows = 8. - grep -q '^FRANK_PRIMARY_MAX_SEQS=2$' "$ENV_FILE" + # Decode-sweep shape (2026-10-06): 3 slots, spec depth 2 — the measured + # optimum (33.06 t/s). The fused TP all-reduce is declared over + # seqs x (1 + spec) rows = 9. + grep -q '^FRANK_PRIMARY_MAX_SEQS=3$' "$ENV_FILE" grep -q '^FRANK_PRIMARY_TP=2$' "$ENV_FILE" grep -q '^FRANK_PRIMARY_TP_WIRE=wht6$' "$ENV_FILE" - grep -q '^FRANK_PRIMARY_SPEC_TOKENS=3$' "$ENV_FILE" + grep -q '^FRANK_PRIMARY_SPEC_TOKENS=2$' "$ENV_FILE" # Native-precision economics: the expert pool is per rank (56.4 GiB # slice per rank at TP2), the PLE ngram table is pinned in host RAM per # Frank's law, KV is fp8, the ratio is the publisher's production # value. grep -q '^FRANK_PRIMARY_PLACEMENT=expert_tiered$' "$ENV_FILE" grep -q '^FRANK_PRIMARY_HOST_POOL_MIB=40960$' "$ENV_FILE" - grep -q '^FRANK_PRIMARY_EXPERT_VS_CACHE=0.82$' "$ENV_FILE" + grep -q '^FRANK_PRIMARY_VRAM_WEIGHTS_MIB=[1-9]' "$ENV_FILE" + grep -q '^FRANK_PRIMARY_VRAM_KV_MIB=[1-9]' "$ENV_FILE" grep -q '^FRANK_PRIMARY_KV_DTYPE=fp8$' "$ENV_FILE" grep -q '^FRANK_PRIMARY_NGRAM_PLACEMENT=ram$' "$ENV_FILE" # Prefix cache tiers (publisher pattern; disk tier sized for 2 slots). @@ -162,7 +164,8 @@ TEMPLATE="$REPO_ROOT/scripts/qwen38-froggeric-v22.5.jinja" grep -q -- '--max-model-len "$FRANK_PRIMARY_MAX_MODEL_LEN"' "$SERVE" grep -q -- '--placement "$FRANK_PRIMARY_PLACEMENT"' "$SERVE" grep -q -- '--host-pool-mib "$FRANK_PRIMARY_HOST_POOL_MIB"' "$SERVE" - grep -q -- '--expert-vs-cache-ratio "$FRANK_PRIMARY_EXPERT_VS_CACHE"' "$SERVE" + grep -q -- '--vram-weights-mib "$FRANK_PRIMARY_VRAM_WEIGHTS_MIB"' "$SERVE" + grep -q -- '--vram-kv-mib "$FRANK_PRIMARY_VRAM_KV_MIB"' "$SERVE" grep -q -- '--kv-cache-dtype "$FRANK_PRIMARY_KV_DTYPE"' "$SERVE" grep -q -- '--prefix-cache-host-mib "$FRANK_PRIMARY_PREFIX_HOST_MIB"' "$SERVE" grep -q -- '--prefix-cache-disk-mib "$FRANK_PRIMARY_PREFIX_DISK_MIB"' "$SERVE"