diff --git a/agent/managed-skills/radiance-pinned-ram-ledger-pricing/SKILL.md b/agent/managed-skills/radiance-pinned-ram-ledger-pricing/SKILL.md new file mode 100644 index 0000000..334666d --- /dev/null +++ b/agent/managed-skills/radiance-pinned-ram-ledger-pricing/SKILL.md @@ -0,0 +1,37 @@ +--- +name: radiance-pinned-ram-ledger-pricing +description: "Price any .rad tensor-group dtype change (e.g. fp8_e4m3 - plain bf16) against a radiance host's pinned-RAM / ttm ledger before agreeing it is possible; answers \"can we afford this encoding\" rather than \"does the engine support it\"." +--- + +# Price a dtype change against the pinned-RAM ledger + +Two separate questions, never merge them: **(a) does the runtime represent this encoding?** and **(b) does the host's pinned-RAM ledger have room?** A "yes" to (a) plus a "no" to (b) is the usual answer. + +## 1. Does the runtime represent it? +Read the pinned source for the tensor group, not the recipe docs. For a PLE n-gram table, `arch/common/rad_block_ple.h` shows the encoding is *derived from the tensor*, not requested: + +``` +table_bf16 = weight_enc(...) && rad_enc_is(&te, "plain") && te.n_planes == 1 +... RAD_W(w_table), table_bf16 ? RAD_NONE : RAD_W(w_scale), ... +``` + +Consequences worth stating out loud: +- One tensor group = **one** encoding. You cannot hold bf16 and e4m3 side by side in one container; two encodings means two artifacts. +- Replication rules differ per table. The n-gram table is shared under TP (`need = align_up(ngram_bytes, 2 MiB)`, "all ranks gather through one shared row cache over the same file") while the token embedding charges `emb_pin = tp * align_up(shard, MiB)`. Reading one formula and applying it to the other doubles or halves the bill. +- Check whether the existing encoding is **lossless** against the source before calling a wider one an upgrade. A stacked-official-fp8 staging note can prove the e4m3 codes are restored exactly (code grid 2^-3 vs bf16 rounding 2^-9), in which case bf16 costs bytes and buys nothing for that payload. +- Compare the constant already baked into the tooling. `FRANK_ARCHON_TTM_MIN_MIB` / the preflight's floor term is an accounting of what the *current* payload pins; matching it to `elements x bytes_per_element` identifies exactly which groups it covers and which it does not. + +## 2. Does the ledger have room? +``` +bytes = rows x width x bytes_per_element # fp8/u8/int8 = 1, bf16/fp16 = 2 +MiB = bytes / 1048576 +ceiling = cat /sys/module/ttm/parameters/pages_limit x 4096 / 1048576 +floor = (tp x HOST_POOL_MIB) + prefix_cache_MiB + MNBT + store + table_MiB +delta = new_table_MiB - old_table_MiB # this is the real cost of a dtype flip +feasible = floor_with_new_table <= ceiling +``` +- Cross-check `ceiling` against `FRANK_ARCHON_TTM_TARGET_MIB` and `MemTotal`; a target recorded as the host ceiling means the kernel already refused higher, so a raise is a test (reversible sysfs write, re-read and refuse by name) and not an assumption. +- Compute the cheapest concession that closes the gap, in order: shrink the prefix-cache host tier, shrink the host pool per rank, then surrender the payload being planned. Say which one it costs; never present a dtype change as free when the pool is what pays. + +## 3. Report shape +State (a), (b), the arithmetic table (old MiB, new MiB, ceiling, floor both ways), the concession required, and the confound it adds to any existing comparison. Keep the recommendation to one line; the numbers carry it. diff --git a/agent/memories/sharpshooter/wt-20261027-142335-6d1fc1f-1hpiehxnq73s0/state.json b/agent/memories/sharpshooter/wt-20261027-142335-6d1fc1f-1hpiehxnq73s0/state.json index 14f7d4d..fa1ba8c 100644 --- a/agent/memories/sharpshooter/wt-20261027-142335-6d1fc1f-1hpiehxnq73s0/state.json +++ b/agent/memories/sharpshooter/wt-20261027-142335-6d1fc1f-1hpiehxnq73s0/state.json @@ -1,6 +1,6 @@ { "v": 1, - "lastConsolidatedAt": 1793249436829, + "lastConsolidatedAt": 1793253336846, "lastResult": { "at": 1793218183375, "sessions": 1, diff --git a/agent/memories/sharpshooter/wt-20261028-122814-6d1fc1f-2w0ju62uuyknj/state.json b/agent/memories/sharpshooter/wt-20261028-122814-6d1fc1f-2w0ju62uuyknj/state.json index 6370614..d7ff56a 100644 --- a/agent/memories/sharpshooter/wt-20261028-122814-6d1fc1f-2w0ju62uuyknj/state.json +++ b/agent/memories/sharpshooter/wt-20261028-122814-6d1fc1f-2w0ju62uuyknj/state.json @@ -1,4 +1,4 @@ { "v": 1, - "lastConsolidatedAt": 1793249414931 + "lastConsolidatedAt": 1793253314968 }