ling32 tier B pool layout: k=2 prefetch predictor by default

The pool layout (every card byte is a dynamic slot, no hot prefix) now plans lookahead_k = 2 instead of 4. The main program then loads and evaluates only the k=2 predictor (lookahead_ks bit 0) and the tier store prefetches from the k=2 list. The old layout (--tier-pool off) and tier C keep k=4.

Measured (quiet host, ABAB, plain decode, same job file, output ids identical on all 22 jobs against the k=4 arm and against plain):
- RTX 3090 (PCIe 4.0): k=2 54.3 against k=4 53.0 tok/s, +2.0 %.
- RTX 5090 (PCIe 5.0, 47 GB/s): k=2 110.2 / 110.3 / 110.1 against k=4 107.5 / 107.5 tok/s, +2.6 %.
- Recall of the true top-8 experts: k=2 64.6 %, k=4 54.0 %; the k=2 lead is 0.8 ms against 1.7 ms for k=4, and the better recall wins.

Env STRATA_L32_LA_KS and STRATA_L32_PF_K still override the choice. The tier planner test expects lookahead_k 2 for the pool layout.
This commit is contained in:
Niko1221 committed 2026-12-03 02:41:04 +01:00
1 parent acb0e4c3d5
commit de6f7bb0d4
2 files changed
+3 -2

No files matched your search

@@ -255,7 +255,8 @@ inline TierPlan plan_tier(const TierHardware& hw, const TierRequestOpts& rq, con
}
if (rq.tier != TierRequest::Nvme && b_fits) {
p.mode = TierMode::B;
p.lookahead_k = 4; // measured on a 5090: the k = 4 predictor (more lead time, 1.8 ms) beats k = 2 (1.0 ms) by 8 points of decode speed in a gated prefetch
// the pool layout (every card byte is a slot) takes the k = 2 predictor (recall 64.6 % top-8, lead 0.8 ms): +2.0 % decode on a 3090 and +2.6 % on a 5090 against k = 4 (recall 54 %, lead 1.7 ms), same ids (2026-12-03). The old layout (hot prefix + a small pool, --tier-pool off) keeps k = 4: measured on a 5090 before the pool layout, k = 4 beat k = 2 by 8 points there.
p.lookahead_k = pool_mode ? 2 : 4;
if (rq.prefetch_width < 0) p.prefetch_width = 4; // decode: gated (rank cut-off 8, 8 MB in flight): +4..5 % measured on a 5090; ungated width 4 or more is slower (see P2-RESULTS)
p.ram_ranks = rt.n_exp - p.vram_ranks;
p.ram_prefix_bytes = rest;
@@ -87,7 +87,7 @@ int main(int argc, char** argv) {
p = plan_tier(hw, rq, rt, sz);
std::printf("%s\n", p.describe().c_str());
// the default for cards up to 30 GiB is the pool layout: no static prefix, every card byte for experts is a slot
CHECK(p.ok && p.mode == TierMode::B && p.lookahead_k == 4 && p.pool_mode && p.vram_ranks == 0 && p.dyn_slots > 1000);
CHECK(p.ok && p.mode == TierMode::B && p.lookahead_k == 2 && p.pool_mode && p.vram_ranks == 0 && p.dyn_slots > 1000);
CHECK(p.vram_prefix_bytes == 0 && p.ram_prefix_bytes == rt.total && p.ssd_bytes == 0 && p.ring_slots == 0);
CHECK(p.vram_total_planned <= p.vram_budget);
// the old layout (hot prefix + a small pool) is --tier-pool off