The loader refuses to start when the free card memory is below trunk + reserve_bytes, and the reserve counted the chunk's logits buffer (chunk x 157,184 x 4 B = 1.3 GiB at 2048) plus its share of the latent cache. With scratch regrow in a tiered run only decode_rows rows of scratch stay resident (the chunk-sized set is allocated by the first prefill, the store gives pool chunks for it), so the reserve counts min(chunk, decode_rows) rows there. Every other run (tier A, regrow off, no lazy KV) computes the same expression as before: reserve_rows = o.chunk.
A decode / verify token's routed experts whose share of its routing weight is below T are dropped (the top expert is always kept, the kept
weights are scaled to the original sum, the dropped slot repeats the top expert with weight 0 so the tier store fetches nothing for it);
prefill and the MTP layer are untouched. Off (T = 0, the default) the engine path is unchanged. Quiet RTX 3090, tier B, plain decode:
T 0 / 0.03 / 0.05 / 0.08 = 53.0 / 53.5 / 58.0 / 70.8 tok/s, H2D per token 331 / 324 / 299 / 240 MB; teacher-forced against the unpruned
engine: top-1 100 % / 98-100 % / 97.5-98 %, mean KL 1e-4 / 1e-3 / 1.6e-2 (T 0.08 max KL 0.7). ling32_bench decode checks the prune kernel
against a CPU reference (bit-identical). STRATA_L32_LA_KS (bit mask of the lookahead lists a tier run computes) with STRATA_L32_PF_K: with
both lists computed the k=2 list as the prefetch driver is +3 % on the 3090 (ABAB x3). Register entries for both and for the HIP
ROUTE_EARLY / PROBE_ALLOC / GPU_CAP_GIB settings that had no status.
L32-SMALL's gate on a quiet RTX 3090 (ctx 131072, chunk 1024 regrow off = A, chunk 2048 regrow on = B, chunk 2048 regrow off = C): steady
decode 53.3 / 55.1 (+3.4 %) / 52.3 (-1.9 %), prefill 4K +13 %, 16K +15 %, slots 4088 / 4345 / 3813, ids of all jobs identical, CTest 19 + the
regrow regress pass. The launcher already passes --chunk 2048 for 20-30 GB cards, so regrow follows from the chunk; tier A and runs without
lazy KV are unchanged. A speculative (MTP) request keeps its scratch and does not regrow. Register note updated.
L32-SMALL's gate on a quiet RTX 3090 (build 418f142af4, chunk 1024 regrow off = A, chunk 2048 regrow on = B, chunk 2048 regrow off = C):
prefill 4K 4.10 s / 3.62 (+13 %), 16K 16.4 s / 14.2 (+15 %); steady decode 53.3 / 55.1 (+3.4 %) / 52.3; slots 4088 / 4345 / 3813; ids of all 9
jobs identical; CTest 19 existing + ling32_regrow_regress pass. Register: STRATA_L32_REGROW and STRATA_L32_REGROW_RESERVE_MB (status
research); the only merge conflict was the generated register, regenerated. Needs a HIP compile before the default flips.
- engine: every row-dependent buffer (activations, logits, KDA chunk scratch, MLA workspaces, grouped-MoE work, lookahead snapshots) lives in a ScratchSet; a small `dec` set (decode_rows = 64 rows) is always resident, a `big` set of the prompt chunk is allocated by the first prefill-sized forward (the existing allocation retry makes the tier store release chunks of pool slots when the card has no room) and freed by the first decode-sized forward, which also frees the span rows and tells the store to take the memory back
- store: ExpertProvider::grow_bytes / ExpertStore::grow_bytes re-allocate released chunks of small dynamic slots (empty, lowest chunk first, keeping 192 MiB free: STRATA_L32_REGROW_RESERVE_MB)
- planner / main: --regrow on|off (or STRATA_L32_REGROW=1; default off), --decode-rows N; with regrow the plan counts decode_rows rows of scratch instead of the chunk (tier A and runs without lazy KV keep the full chunk); a speculative request (MTP, not plain) keeps its sets and does not regrow
- test: ling32_regrow_regress (same dump and ids with regrow on and off: tier B, two prompts, injected allocation failure, tier C, MTP speculation; STRATA_L32_KV_FORCE_RELEASE=1 makes the big set take one chunk even where the card has room)
A verify batch of 2 tokens needs the experts of both tokens and consecutive tokens share only about 19 % of
their expert uses, so with an LRU pool the misses of a 2-row verify are 2.0x those of one row (cache simulation
on 2810 real decode tokens, L32-MID2): 1.8 tokens per verify then run at 0.90x on a link-bound card. Measured:
RTX 5090 (PCIe 5.0, 5466 slots) +4..11 %; RTX 5070 Ti 16 GB (PCIe 5.0, 2413 slots) -0.7 %, 12 GB emulation
(1485 slots) -2.4 %; RTX 4090 and 3090 (PCIe 4.0, about 4000 slots): forced MTP never gains (K=1: 1.83 tokens per
verify at 48.0 tok/s against 49.0 plain; the adaptive controller runs plain). No measurement between 2413 and
5466 slots on a fast link: 4500 (22 % of the 20480 routed experts) is the conservative side of the cut.
mtp_auto_pays takes the card expert count (-1: unknown, rule unchanged); tier A and unified memory ignore it.
Tests: ling32_tier_planner_test table, ling32_mtp_auto_regress (pool cut off / small pool legs); z440 CTest 19/19 apart
from this leg's first version (the fixture's pool holds many fixture experts: the leg moves the cut by hand).
- sm_75: mma16816 is two mma.sync m16n8k8 on the same fp32 accumulators in the trunk GEMM, the grouped experts, the expanded MLA and the latent-attention tc kernel; ldmatrix from sm_75; cp.async as a register copy; the expanded MLA attention keeps one 43 KB stage below sm_80 (two stages do not fit 64 KB)
- sm_70: volta_group_step runs the 4 k16 steps of a 64-wide group of the trunk GEMM and the grouped experts on nvcuda::wmma (16x16x16 fp16, fp32 accumulation) and hands the accumulators back in the m16n8 layout of the scale step through a per-warp shared tile (+5 KB of shared memory on sm_70 only); the MLA stays on the scalar kernels there; the fresh-accumulator mode (tc mode bit 1) is not modelled
- ling32_main: the SIMT switch-off applies to sm_61 and below only; the default MLA prefill kernel is tc from sm_75; STRATA_L32_TC_FORCE=1 keeps the tensor-core flags on a card below sm_70 (measurement only)
- sm_80 and newer: the code paths are the same text (the new branches are #elif / #if for older architectures)
Titan RTX (sm_75), 4062-token prefill: 151.4 s -> 17.1 s; V100 (sm_70): 22 s -> 10.9 s; goldens top-1 100 %, KL 3.5e-7 (Titan) / 5.3e-7 (V100); ids identical to the SIMT kernels.
With the wide tiles (32-pair expert tiles, 64-token trunk tiles) a 2048-token chunk fills the expert tiles; the grouped results do not depend on the chunk size.
R9700 (gfx1201, tier B, SQ-96, default flags otherwise), rebased tree on f-ling32-int fe96b81b73, one process per run:
prompt reading, no sidecar 4K 4.16 -> 3.89 s, 32K 35.67 -> 31.62 s
prompt reading, with sidecar 4K 4.71 -> 4.00 s, 32K 38.74 -> 33.28 s
decode (128 tokens) plain 34.2 / 33.2 -> 33.8 / 32.8 tok/s, spec 39.1 / 37.0 -> 38.6 / 36.3 tok/s (4K / 32K): -1.2 to -1.9 %
(the chunk-1024 runs and the chunk-2048 runs are single runs on a shared box; the 32K prefill gain is larger than the run-to-run spread)
Exactness: greedy ids equal for spec and plain at 4K and 32K and on the short set (digest 52e2d4c109a3); teacher-forced first-dump md5 with the sidecar short 6cb0eca7 and long_4k cdac903e,
identical to the chunk-1024 values and to L32-HIP's identity values, so the golden numbers are unchanged (short 17/17 top-1 100.000 %, KL 1.83e-4; long_4k 99.879 %, KL 3.03e-4).
--chunk 1024 restores the old default (and gives back the 1.8 GiB of pool).
Measured (2026-12-02, L32-TABLE / L32-MID / L32-SMALL, real Ling-3.2-Air, plain vs MTP, greedy): the drafter pays on an RTX 5090 (PCIe 5.0 x16: +4..11 % decode,
115.8 tok/s with it at ctx 131072 on our 5090 box) and where everything is resident or memory is unified; on tiered cards over PCIe 4.0 x16 or narrower
(3090: 1.00 tokens per verify, prefill 947 vs 1042 tok/s at 4K, 89 fewer pool slots; 4090: acceptance 0; 5080 16 GB -3.4 %; 5060 Ti -3 %) it never does, yet
the sidecar still costs prefill and pool slots.
--mtp-auto FILE (with --spec mtp --spec-adaptive; --mtp FILE stays the forced 'on'): after the memory plan, tier A / unified memory: loaded; tier C: not loaded;
tier B: one pinned 256 MiB host-to-device copy (3 repeats, median) and loaded only from 32 GB/s (kMtpAutoMinLinkGbps, between PCIe 4.0 x16 = 24.4 GB/s measured
and PCIe 5.0 x16 = 45+; 53.5 GB/s measured on the 5090 box); an unmeasured link: not loaded. When it is not loaded the sidecar, --spec mtp and the speculative loop
are dropped and the plan is made again without the sidecar's bytes. The rule is the pure function mtp_auto_pays (planner header, rows in its comment), table-tested in
ling32_tier_planner_test; ling32_mtp_auto_regress runs the wiring on the wide fixture (link by STRATA_L32_H2D_GBPS: 24.4 -> not loaded and plain ids, 46 -> loaded and
speculation on, --mtp forced -> loaded, tier A -> loaded; ids equal to the plain run in every leg).
Also: the measured link is printed ('tier store: host-to-device link moved N GB/s (pinned 256 MiB copies, median of 3)') whenever a tier store is planned, the serve INFO line
carries h2d_gbps=N (before images=), and --info FILE --kv says mtp_auto=1 so the launcher can tell old engines apart.
The planner counted the latent KV for the whole context up front (ctx * MLA layers * 576 * 4: 2.1 GiB at the
128K default), which cost dynamic expert slots on every card in tier B / C (L32-MID, 16 GB RTX 5080: 1671 slots /
38.1 tok/s at ctx 131072 against 2104 / 41.2 at ctx 8192; 4090: -4 %; 5090: 4875 vs 5307 slots, -2 % decode).
Now, with a tier store, the engine starts with min(ctx, 16384) rows per MLA layer (the planner counts only those;
--kv-init N sets it, STRATA_L32_LAZY_KV=0 or --kv-init 0 reserves everything up front as before). When the
position + chunk + 512 rows of margin reaches the capacity (forward_mm, forward_span, spec_cycle), every cache is
re-allocated at twice the size (clamped to ctx), the rows are copied on the device, the old buffer is freed and the
captured graphs are dropped. When cudaMalloc fails the tier store gives dynamic slots back (the small pool is
allocated in chunks of 64 slots; the tail chunks are freed, their slots get state 4 and are never picked,
alloc caps follow the live count; ExpertProvider::release_bytes). Tier A (all resident, CUDA graphs capture the
cache pointers) is planned again with the whole context and keeps the full reservation.
The attention kernels keep receiving max_ctx as their plan bound, so the split plan and therefore the bits do not
depend on the capacity; the same positions hold the same values. The 512-row margin keeps a tile of over-read
inside the buffer.
Tests: ling32_kv_grow_regress (wide fixture, 1200-token prompt, --kv-init 64, ctx 4000: growth 64 -> 1024 -> 2048;
dump and ids byte-identical to --kv-init 0 in tier B, tier B with a pool chunk freed at every growth step
(STRATA_L32_KV_FORCE_RELEASE=1), tier C and MTP speculation); z440 CTest 18/18, compute-sanitizer memcheck clean on
the growth + release legs (plain and speculative). Also merged: L32-MID's logits-buffer sizing (cced9a40a1).
The dual-stream MoE layer (shared expert and the FWHT of the routed input on a second stream,
beside the router and the host-side prepare() wait) costs four cross-stream event operations per
layer, about 300 per token. On the R9700 (gfx1201, tier B, 25 GiB pool, 78 GiB RAM tier) that cost
more than the overlap saves: the GPU is idle 56 % of the decode wall time (rocprofv3), 700 kernel
launches per token, 16 gaps of 300-1000 us per token.
Controlled ABAB on one binary (int 5f8097fb00), same 4062-token prompt, 3 identical jobs per
process, box load 6-12 recorded:
dual stream (old default) 35.6 / 35.3 / 35.4 and 35.4 / 35.3 / 35.4 tok/s, prefill 4.05 s
--no-dual 40.1 / 40.1 / 40.1 and 39.9 / 39.9 / 39.8 tok/s, prefill 3.72 s
i.e. plain decode +13 %, prefill +9 %. MTP verify batches are not affected (51.6 vs 52.7 tok/s).
Exactness: the single-stream order is the one of --exact. R9700 goldens on the new default are
bit-identical to the dual-stream build: short 17 md5 6cb0eca7 (100.000 % / KL 1.83e-4), long_4k
md5 cdac903e (99.879 % / KL 3.03e-4); greedy ids of the short genjobs, plain and MTP, identical to
the references (16/16 each).
Only HIP builds with a tier store change; the Windows iGPU keeps the second stream until it is
measured there, CUDA is untouched. --dual forces the second stream, --no-dual the single one.
The engine allocated chunk x vocab floats of logits (644 MB at chunk 1024) although a chat or serve run asks for the last token of a prompt chunk and at most block + 1 rows of a speculative verify batch. EngineOptions::logits_rows (default 0 = a whole chunk, so the library, the fixture tests and the teacher-forced modes are unchanged) sizes it; strata-ling32 sets 32 for --serve and --genjobs (--logits-rows N overrides, 0 = a whole chunk), and the tier planner's activation estimate follows (TierSizes::logits_rows), so the freed memory becomes expert slots. forward() / forward_span() refuse a request for more rows than the buffer holds, and spec_init refuses a buffer smaller than a verify batch.
RTX 5080 16 GB (tier B, ctx 131072, plain, 5 x 256 greedy): pool 1671 -> 1807 slots (fixed 7.72 -> 7.14 GiB), decode 37.9 / 38.1 -> 39.0 tok/s, greedy ids identical on all 5 prompts.
1. Windows (WDDM) page-locks only part of the RAM for the GPU (about half of it; the commit limit is RAM + page file): cudaHostAlloc of the 34 GiB warm prefix failed with "out of memory" on a 63 GB PC with 43 GB free and ended the start in every mode.
- host_region(): when cudaHostAlloc is refused the region is ordinary pages (VirtualAlloc / aligned malloc) and the largest front part the system accepts is registered with cudaHostRegister (one range, cut at a slab end so no copy straddles the border, stepped down by an eighth until it is accepted); the rest stays unpinned (copies from it are staged by the driver: slower, correct), reads in place are switched off, one log line says what happened. Used for the warm prefix and the SSD ring; freed with the matching call.
- ling32_main.cpp: on Windows with a discrete card the planner gives the RAM tier at most the free RAM minus 8 GiB and half of the system RAM minus 0.5 GiB (the limit measured on the Strix); an explicit --ram-budget-gib above that is cut to it, with a line.
- test hooks STRATA_L32_PIN_FAIL=1 (refuse the allocation) and STRATA_L32_PIN_LIMIT_MIB=N (refuse registrations above N MiB): tier B / C dumps are identical with the pin refused and partly pinned (z440).
2. Tier C with the MTP sidecar loaded failed at start ("slab N differs from the file after the fill (RAM)"; reproduced on Linux with the real model at --ram-budget-gib 24): the sidecar's experts are appended to the table with offsets shifted to vp + rp_file, and every "is this slab in the RAM tier" test used the combined range, so a MODEL slab on the SSD whose file offset fell in the sidecar's range was taken for RAM-resident (and would have been read from the sidecar's data). in_warm(gi) now tests the model's slabs against [vp, vp + rp_file) and the sidecar's against [vp + rp_file, vp + rp) in all seven places (verify, the preload pick, init_ram_slots, the prefetch path, the adaptive statistics, warm_cuts).
3. CTest ling32_mtp_tier_regress (engine/tests/ling32/ling32_mtp_tier_test.py, with a synthetic wide MTP fixture from ling32_pyref.py make-mtp-fixture --wide): the dump of tier A / B / C with and without the sidecar must be byte-identical; the unfixed binary fails it with "slab 0 differs from the file after the fill (RAM)".
4. settings register: STRATA_L32_PIN_FAIL, STRATA_L32_PIN_LIMIT_MIB (research).
--mla-prefill expanded (ling32_mla_exp.cu: per-head K / V projected slab by slab, 3.4x fewer flop than the absorbed form) becomes the default where
the tensor-core MLA already is (sm_80+), for prefill chunks of at least 1024 tokens (EngineOptions::mla_exp_min_n; an explicit --mla-prefill keeps
min 0 and wins over the default; --exact and a non-fp32 latent cache keep the absorbed form). STRATA_L32_MLA_EXPANDED=0 switches it off without a
rebuild. The transient K / V slab (84 MB at 2048 keys) and the fp16 copies of wk_b / wv_b (~60 MB) come with it.
Not bit-identical to the absorbed form (different arithmetic path, same ~2^-22 per product error), so this is a quality decision: GB10, SQ-96:
16 short goldens (all under 1024 tokens, absorbed path): byte-identical to before;
long_4k_fp64: top-1 100.000 %, KL -2.1e-7 (was -1.5e-7);
long_16k_fp64: 97.33 % / 2.16e-2 against 97.58 % / 2.01e-2 for the absorbed form (the chaos-limited band; neither passes the 99.8 % bar of the short
set); the two engines agree on 98.67 % of the 16,448 positions, KL 7.0e-3, greedy continuation identical;
prefill, default flags, interleaved pairs, old default -> new default: 4,082 tokens 5.34 -> 3.83 s (1,067 tok/s), 16,358 tokens 24.29 -> 15.00 s
(1,090 tok/s), 32,748 tokens 59.1 -> 31.6 s (1,037 tok/s); the exact-GEMM change alone gives 4.27 / 20.07 / 50.7 s.
engine/src/ling32/CMakeLists.txt reads project(strata VERSION ...) of engine/CMakeLists.txt and passes LING32_VERSION to the program; ling32_main.cpp and the Metal main have no literal and stop the build without the define. tools/packaging/ling32/engine_version.py gives the same number to build_linux.sh, build_mac.sh, build_windows.py and the Metal build script (a VERSION given by hand must equal it). verify_pkg.py checks manifest, folder name, BUILD.json, the program's --version line, the source tree and the archive name. The release commit bumps one number in engine/CMakeLists.txt.
Building with -DLING32_CUDA_ARCH=75 failed in ptxas (cp.async and mma.sync.m16n8k16 /
ldmatrix need sm_80). ling32_dev.cuh: the 4-byte cp.async of the decode kernels goes through a
register below sm_80 (as on AMD; commit / wait are no-ops, the stage loop is correct either way),
mma16816 and ldsm_x4 compile to nothing there. ling32_main.cpp: on a device with compute
capability below 8 the paths that use them (trunk tensor cores, grouped tensor-core experts, tier
grouped experts) are switched off, so they take the SIMT kernels that --exact selects; the engine
prints one line saying so. sm_80+ code is unchanged. Checked: MSVC + CUDA 12.9 sm_75 build OK
(jobq owner, build only); NOT run on a Turing card yet.
The adaptive warm tier (decayed use counts, promotion of SSD-resident experts from the ring into spare
RAM-tier slots, quarantined demotion) is now on by default where the RAM tier is read in place
(zero-copy, Windows iGPU). Spare slots 8 per size class, quarantine 24, queue 16; knobs
STRATA_L32_AD_Q / AD_SPARE / AD_QUAR; STRATA_L32_ADAPT=0 / 1 still overrides.
It is only used for single-token decode: promotion and use counting are skipped for MTP verify
batches, and main sets StoreOptions::adaptive_default = false when --mtp is given (the first
default-on build cost -10 % with MTP: the copies and the spare slots taken from the warm prefix
buy nothing there). Drop-reason counters (ring slot gone / no spare / not hotter / queue full)
are printed with the PF_COV statistics.
Strix Halo (gfx1151), 48 short prompts, greedy ids identical to the switched-off runs in every arm:
plain 23.6 tok/s vs 22.9-23.0 off (+2.6 %, SSD wait 45 s vs 55 s); MTP default 31.2 vs 31.4 off
(parity, ids identical).
Without --latent, on an AMD gfx11 / gfx12 device (and with the shared MLA kernel, i.e. not --exact) the MLA cache is the pre-split fp16 hi / lo planes of the WMMA kernel
(same bytes as fp32). --latent f32 selects the scalar fp32 kernel. Measured (P8-LONGCTX-RESULTS.md): attention per layer 1.8x (gfx1151) to 3.0x (gfx1201) faster at
128K / 256K, relative error 1e-6 .. 2.2e-6 against the scalar kernel, Strix golden set unchanged, Strix decode at a 256K position 9.5 -> 11.3 tok/s (tier C, ABBA).
New cache format LatentFmt::F16X2 / MlaCacheType::kF16x2: every cache value as two fp16 numbers, hi = fp16(x), lo = fp16((x - hi) * 2048), row = [hi[576] | lo[576]]
(the bytes of an fp32 row, fp32-class accuracy like the CUDA tensor-core split path: three WMMA 16x16x16 f16 per product, cross terms in a second accumulator added with 1/2048).
mla_prep writes the planes; the kernel (mla_latent_attn_wmma.inc, AMD only) computes S^T = C Q^T with the key tile as the A operand, online softmax over the accumulator
elements, O += P C with the key tile read against its layout for the B operand; dense visibility, one block per (token, head tile, chunk), the same split-K / merge machinery.
CUDA builds reject f16x2. mla_latent_attn_long: --fmt f16x2, relative error against the f32 cache of the same data, --ntok.
gfx1151 (Strix), one layer, decode, vs the scalar fp32 kernel on the same data: 128K 1.59 vs 2.89 ms, 256K 3.22 vs 5.81 ms (187-192 GB/s of cache, the memory floor of this
box); relative L2 error 1e-6 .. 2.2e-6 over 39 cases (contexts 1 .. 262144, one and several chunks, verify batches of 1 .. 16 tokens).
Two conflicts: ling32_engine.cu (the older-copy preparation of the age-mix study comes right after mla_prep, then the AMD / CUDA expanded-form call sites, which stay off when the age mix is on) and ling32_main.cpp (the new --latent f32|f16|q8, --age-mix, --latent-emul, --mla-kernel parsing plus --mla-prefill expanded and --mla-exp-slab). The expanded-form conditions use the LatentFmt enum (fp32 cache only) instead of the removed latent_fp32 flag; ling32_mla_exp_test uses LatentFmt::F32.
Conflicts resolved so that both backends coexist: ling32_mla_exp.cu (CUDA) and ling32_mla_exp_hip.cu (AMD) are both in the source list and guarded by their backend; ling32_kernels.hpp declares mla_exph_* under STRATA_USE_HIP and mla_exp_* otherwise; ling32_engine.cu allocates the workspace and picks the call site by backend (#if HIP / #else); the CUDA call site also stays off for multimodal position batches like the HIP one.
--mla-prefill expanded (+ --mla-exp-slab N, default 2048 keys): prefill chunks of more than kda_seq_max_n / graph_max_n tokens, fp32 latent cache, geometry 128 / 64 / 128 / 512, replace mla_qabs + the attention kernel + mla_out by mla_exp_prefill (per-head K / V projected slab by slab into a fixed workspace, 192-deep flash attention, same split-precision products as the exact tensor-core path). Other batches and shapes keep the existing kernels. GpuModel::build_mla_expanded makes fp16 x 256 copies of wk_b / wv_b (8.4 MB per MLA layer at 32 heads) when the option is on; the workspace is H x slab x 1280 B + 16.6 KB per chunk token at 32 heads (84 MB + 68 MB at slab 2048, chunk 4096), nothing grows with the context. ling32_forward_test --mla-exp runs the fixture suites through it.
Kernel level (one layer, 2048-token chunk, 16384 context, RTX 5070): absorbed exact path 195 ms, expanded 43.6 ms (x4.5); correct against the absorbed fp32 scalar and exact tensor-core kernels to 4e-6 on outputs up to 4.4.
The two conflicts (ling32_main.cpp, ling32_tier_store.cu) are resolved as in L32-PREFILL's trial merge 732329ea3b; the tree equals that trial merge plus the __align__(16) fix of 11154bde5e.
- Zero-copy misses (kind 2 / kind 3) handed the kernels the HOST address of the registered warm prefix and of the pinned
ring. On Windows the device address of a registered VirtualAlloc range differs from the host address, so --miss zc read
garbage (the run "generated" 128 tokens per job at 800 tok/s). The store now keeps host_dev / ringb_dev from
hipHostGetDevicePointer and gives the kernels those. The DMA sources (staging, CPU experts) keep the host address.
- Windows integrated GPU: the RAM tier and the ring are read in place by default (--miss stage restores the staged copy).
Strix tier C, same greedy tokens: plain 21.8 -> 22.6 tok/s, MTP 28.2 -> 31.1 tok/s.
- STRATA_L32_SPLIT=N (default 1): an SSD slab read is issued as N parallel pieces (Ring::pend counts them).
- STRATA_L32_PF_SSDONLY=1: decode prefetch only for SSD-resident experts. Measured, not a win by itself (see the grid in
the notes): width / scan / lead variations 18.2-22.5 tok/s against 22.6 for the default.
- Reserved contexts of 64K and more decode with the tensor-core split MLA kernel where it exists (sm_80+) unless --mla-kernel is given: 1.13x at 256K on a PRO 6000
(f32 cache), golden top-1 / KL and batch invariance unchanged (checked with a 128K reservation: base == scalar kernel to the digits, invariance 9/9 at 4400 / 131072 / 262144).
- Study switches on the engine, all opt-in and off by default: --latent-emul / configs el-<fmt> ep-<fmt> (including Hadamard-rotated block quantisation, codes 8-10),
--age-mix N / config ageN (the newest N positions exact, older ones through the rounding; a second fp32 cache read by the shared MLA kernel through lat_old / recent),
configs mlasimt / mlatc (decode kernel per config), --jobs rows {"fake_ctx": N} (decode steps at position N with zeroed caches, no prefill: cost only), jobs field "tail".
- MLA kernel: lat_old / recent in MlaLatentArgs and the f32 loader (inert unless set).
- mla_latent_attn_long: host-wall timing and a checksum of the result per row (the HIP event times of the first row of a group are not reliable).
- the dynamic pool has two size classes: slots of the largest slab below max_slab (4.36 MiB, 98.8 % of the experts) and a small arena of max_slab slots (the 256
S8 experts, 2 % of the uses). 32 % more slots in the same card memory. STRATA_L32_BIGSLOTS=0 goes back to one slot size.
- pool mode takes 1.1 GiB of the slack the plan used to leave (1.7-2.1 GiB were free at the end of the start-up on all four cards); the MTP sidecar bytes
(+200 MiB of buffers) come out of that slack, so --mtp does not push the card over its limit.
- stage groups count free slots per size class.
- DemandSink::wants_prediction(n): the engine skips the lookahead predictor for forwards the store makes no use of
(speculative verify batches of 2..127 tokens). R9700 tier B with MTP: prefetch on 30.9 -> 39.7 tok/s (off: 39.6).
- Tiers: the predictor runs on the compute stream and the compute thread hands the predictions to the store after the
next router sync (Impl::pend / flush_predictions). The second lookahead stream with its event pair cost 11 ms per
decode token on the R9700 although it did almost nothing (bisect with STRATA_L32_LA_DBG / STRATA_L32_LA_TIME).
Plain tier B decode with prefetch on: 25.0 -> 29.3 tok/s (off 36.6; the remaining gap is open).
- The routing capture copies (two small D2H copies per MoE layer) are only made for the statistics and capture modes.
- Optional prefetch of the union of a verify batch (STRATA_L32_PF_VERIFY=N experts per layer, default 0: measured slower).
- Windows iGPU planner: explicit RAM budget = free RAM - 8 GiB floor, at most half of the system RAM - 0.5 GiB (GPU-visible
pinned memory above half of the system RAM stalls the card fill); the planner's 6 GiB headroom no longer applies.
Strix tier C: RAM tier 8.8 -> 12.5 GiB, 20.7 -> 21.8 tok/s, same greedy tokens. Fail-fast check of the free Windows RAM
before the warm prefix is allocated; progress lines for the start-up fill.
- tier planner: pool mode (--tier-pool on|off|auto, auto up to 30 GiB of card): no static prefix, every card byte for experts is a dynamic slot;
the store preloads the pool with the best-ranked experts from the warm RAM prefix (STRATA_L32_PRELOAD=0|1 overrides). Same tokens as before;
decode on a 24 GB card 36.7 -> 49 tok/s (5 prompts x 256 tokens, greedy).
- ling32_cpu_expert: the S4/S5/S6 row dot unpacks a superblock with vector shifts instead of 256 scalar steps (same q values, same fma order,
bit-identical to the scalar kernel and to the GPU: ling32_cpu_expert_test 24 of 24); 10-12x faster per thread. STRATA_L32_CPU_KERNEL=ref selects the old one.
- tier store: STRATA_L32_ROUTE_TRACE=FILE writes the true routing of every decode layer (measurement only).
--latent f32|f16|q8 (EngineOptions::latent, ling32_latent.hpp): the Q8 cache keeps int8 c_lat, fp16 block scales (Q8_0, 32 values) and fp16 k_pe
in three planes of one allocation, 672 B per position and layer instead of 2304 (fp32) / 1152 (fp16); mla_prep writes it, mla_attn_fast reads it
through the shared kernel's Q8_0 path. fp32 stays the exact default. Study switches --latent-emul lat=..,pe=.. and configs el-<fmt> / ep-<fmt>
round an fp32 cache through a smaller format so the sensitive part of the cache can be found without a new storage format.
The tier planner sizes the latent cache per precision (7 MLA layers, +1 with the MTP layer) and --plan prints it for f32 / f16 / q8.
Jobs: "tail": N dumps only the last N prompt positions (long prompts).
MLA kernel: up to 256 split-K chunks (the merge loops over them), used only for reserved lengths of 64K and more; below that the cap stays 64,
so every existing run keeps its arithmetic. mla_latent_attn_long: decode cost per cache precision at 4K..256K, --check for the cache writer.