Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/aien-sovereign-core-mv/issues/7d51783704a492a1 # aien-sovereign-core-mv AienOS host runtime: inference scheduling, paged KV state, the aien CLI and Spark verification tooling. Its inference engine is in alpha testing (DGX Spark GB10); Omega is the implementation destination. Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers # [RIBBON P3] Optional expert-demand prefetch hints with zero routing influence Closed · #633 · open 2026-10-18 05:41 UTC · closed 2026-11-07 00:06 UTC (reason not_planned) Imported from GitHub aien-dev/aien-sovereign-core-mv#633, by drakestapleton Labels: retired drakestapleton wrote on 2026-10-18 05:41 UTC Parent: https://github.com/aien-dev/aienix/issues/4 Depends on a correct working tiered serving path: controller #630 , pipeline #631 , integration #632 . ## Objective Investigate speculative expert prefetch, but with a hard boundary: only the model's real router chooses which experts participate in inference. Hints influence I/O priority and cache admission only. Prediction must never change logits, precision, routing, or correctness. ## Deliverables - Read-only trace of actual top-k (layer, expert) references and time-to-use, with deterministic fixed workload/replay. - A no-hint baseline, cheap nonlearned initial heuristic and optional predictor behind an explicitly disabled-by-default switch. Measure predictor CPU/GPU cost and bytes fetched unnecessarily. - Readiness test before use: wrong prediction -> accurate cache miss and load of the correct expert; no guessed expert can reach execution unless the real router independently selected it. - Bounded speculative budget lower priority than required loads; promptly cancel/drop obsolete hints without evicting pinned or imminent known-needed experts. - Evidence for hit rate, useful prefetched bytes, harmful misses, additional SSD bytes, exposed stall, TTFT and tok/s with and without hints. ## Acceptance - Byte-/token-equivalent outputs and error propagation to the no-hint system on identical seeds and checkpoints. - Negative controls for wrong/stale hints, aggressive misprediction, saturated SSD and zero spare slots. Net slowdown is reported explicitly. - Do not enable by default unless GB10 evidence shows robust end-to-end gain for named workloads. ## Out of scope No new router model, offline learning on unsealed held-out benchmark prompts, or checkpoint architecture changes. drakestapleton wrote on 2026-11-07 00:06 UTC 35B retired (Drake 2026-11-06): Omega LLM only. Expert Ribbon P3 (parent aienix#4, retired): expert-demand prefetch hints for Qwen3-MoE. — issuecov/I3 (Hermes worker subagent of lead issuecov, claude-opus-5-5, anthropic) did:key:`z6MkhL6jkVBvyZTg9eMGkJWKQKjnKA1wbA7ym3PkTXt4M6Jd` wrote on 2026-11-18 17:17 UTC Recovered GitHub comment. Original comment `6532989027` Deliverable 1 of this issue (read-only trace) now exists for DeepSeek-V4-Flash, and a cheap non-learned hint looks strong. Status: HOST-ONLY, EXERCISED. Not wired into anything. The trace. `~/handoffs/Ribbon-20261030/trace-dsv4.txt` (sha `5e6c3a92…`) holds 4096 tokens × 43 layers × top-6. The forward is a teacher-forced CPU reference at pin `60d8d707`, with fixed corpus `ff05a14f`, so it can be replayed deterministically. It is in `om/residency` input format. The heuristic. Take the gate input of layer l-1 and push it through the gate of layer l (one 4096×256 GEMV). Compare its top-K with the experts the real router picks at layer l. Recall over 40 routed layers × 4096 tokens (MEASURED counts, rates from Wolfram): K hint recall control: tokens shuffled within a segment control: static top-K by popularity 6 0.6882 0.1411 0.1937 12 0.8402 0.1981 0.2926 18 0.8917 0.2370 0.3635 Hash layers 0–2 need no prediction: `tid2eid[token]` is exact. Limits of this measurement: - The hint arrives about one layer ahead: 1.163 ms at 20 tok/s. One expert read is 1.261 ms at depth-32 rates and 10.13 ms at depth 1. The hint therefore pays only with a deep, low-priority read queue, as this issue already specifies. - These are recall figures against the demand set. They are not cache-filtered, so useful versus wasted SSD bytes are NOT MEASURED. That needs a hint-aware replay, which is the next host step. - Router margins are thin. In 3.26% of routed token-layers the 6th and 7th selection keys differ by less than 1e-3. That supports the issue's rule: hints must never touch routing or precision. Report: `~/handoffs/Ribbon-20261030/REPORT.md`. did:key:`z6MkhL6jkVBvyZTg9eMGkJWKQKjnKA1wbA7ym3PkTXt4M6Jd` wrote on 2026-11-18 17:18 UTC Recovered GitHub comment. Original comment `6533236348` Hint replay through the cache (host only; MEASURED counts from a MEASURED trace, MODELED bytes and ceilings). Follow-up to the recall figures above. Draft #844 (head `6700220c`) now replays hints: `residency.om` takes an optional `H` plus `T*L*H` predicted ids and prints `hlru` lines for the shared LRU cache. Each step first makes its hinted experts resident (a prefetch on a miss) and protects them for the step, then serves the K demands. It counts demand misses and the prefetches that were later used or evicted unused. Timing is not modeled, so every prefetch arrives in time: demand misses are the best case, and bytes moved are exact for this policy. Oracle: Wolfram `hintReplay` in `fixtures/oracle.wl`, byte-equal on a hinted synthetic fixture. `run.sh` ALL PASS, including 4 hint mutants. Predictor: hash layers 0-2 exact; routed layers 3-42 take the top H of layer l's selection key applied to layer l-1's gate input (one layer ahead, no learning). Trace: DeepSeek-V4-Flash CPU reference, 4096 tokens, 43 layers, top-6 of 256; per token over the 2048 warm tokens; 13,369,344 B per expert. Numbers from Wolfram. policy cache % demand misses/token experts fetched/token MB/token wasted MB/token prefetches used I/O ceiling tok/s @10.60 GB/s @1.715 GB/s shared LRU 64 8.926 8.926 119.3 0 – 88.83 14.37 hints H=6 64 4.532 13.91 186.0 25.64 0.7621 56.98 9.219 shared LRU 70 6.526 6.526 87.25 0 – 121.5 19.66 hints H=6 70 3.356 9.981 133.4 15.78 0.778 79.43 12.85 hints H=12 70 2.066 19.77 264.3 78.32 0.628 40.11 6.489 shared LRU 80 3.516 3.516 47.01 0 – 225.5 36.48 hints H=6 80 1.81 5.153 68.9 5.608 0.8087 153.9 24.89 What this says for #633: - One-layer-ahead hints halve demand misses (−48.6% at 70%, H=6; −68.3% at H=12). - They cost bytes: 1.53× (H=6) and 3.03× (H=12) the shared LRU's reads at 70%. Of the extra 3.456 experts/token at H=6, 1.181 are wasted prefetches, 0.29 are still pending at the end, and 1.985 are demanded experts the hinted ones pushed out of the cache. - With layer-serial reads (1.715 GB/s, as delivered by the 10-18 pager) hints lower the ceiling: 19.66 → 12.85 tok/s at 70%. With depth-32 reads (10.60 GB/s) H=6 still reaches 79.43 tok/s, about the routed-weight memory ceiling, with half the stalls. Hints pay only on top of #631's deep, overlapped reads. - H=12 reads more bytes than H=6 at every cache size from 25% to 90%. - Untested levers (PROPOSED): insert prefetches at the LRU end, do not refresh hinted experts that are already resident, gate hints on the router key margin. NOT_RUN: GPU, serving loop, prefetch timing and queue depth. did:key:`z6MkhL6jkVBvyZTg9eMGkJWKQKjnKA1wbA7ym3PkTXt4M6Jd` wrote on 2026-11-18 17:18 UTC Recovered GitHub comment. Original comment `6533561694` Protect-only hints tested; they lose (MODELED from the MEASURED 43-layer trace, host only). #844 head `4e415bdc` adds an `hcold` replay mode next to `hlru`. Under `hcold` a hint protects its expert for the step but never refreshes its recency, and a prefetched expert enters at the LRU end. The Wolfram oracle reproduces the synthetic H3 fixture byte for byte, `run.sh` reports ALL PASS (3 new mutants caught), and CI AIEN Checks passes. Real trace, 2048 warm tokens, 13,369,344 B per expert; ratios from Wolfram: H cache % policy demand misses/token MB/token bytes vs hlru tok/s ceiling @1.715 GB/s 6 70 hlru 3.356 133.4 1 12.85 6 70 hcold 3.297 183.8 1.377 9.331 12 70 hlru 2.066 264.3 1 6.489 12 70 hcold 1.805 562.6 2.129 3.048 Across 64/70/80% and H=6/12, `hcold` changes demand misses by −15.6% to +3.1% against `hlru` but moves 1.31–2.61× the bytes. At H=6/70%, 77.8% of `hlru` prefetches are demanded before eviction; for `hcold` the figure is 30.9%. Split of the two levers, using throwaway variants that were not committed: - MRU insertion without refresh: 1.066–1.303× `hlru` bytes. - Cold insertion with refresh: 1.157–1.615× `hlru` bytes. `hlru` (MRU insertion with refresh) moves the fewest bytes of the four. Likely cause [INFERENCE; refetches were not counted per expert]: wrong hints recur on nearby tokens. `hlru` keeps such an expert resident, while `hcold` evicts it and fetches it again. Recommendation for #633: keep MRU insertion with refresh. Margin-gated hints remain PROPOSED. None of this is timed and none of it ran on the GB10. Hints pay only with overlapped deep-queue reads (#631). did:key:`z6MkhL6jkVBvyZTg9eMGkJWKQKjnKA1wbA7ym3PkTXt4M6Jd` wrote on 2026-11-18 17:22 UTC Recovered GitHub comment. Original comment `6535505468` The hint claims hold on the host NVMe (MEASURED host I/O; GB10 NOT_RUN). The earlier comments made three claims from MODELED bytes. Each now has a falsifier and a host replay against it: - C1: layer-serial hints lower the I/O ceiling. - C2: hints pay only with deep, overlapped reads. - C3: `hcold` costs more than `hlru`. The full plan and data are in `~/handoffs/Ribbon-20261030/TESTPLAN.md` and REPORT §5.2. Method - Referee. `sched.py` (ORACLE, Python) re-implements glru/hlru/hcold. - It matches all 200 count lines printed by `residency.om` (`e9c1b2a6`) over 9 outputs. - Three mutants each give 8–19 DIFF lines. - It also caught a row-0 stamp edge case in itself, which has been fixed. - Segment orders. The trace's four 1024-token segments were replayed in 4 orders. - NVMe replay. `io_replay.py` (MEASUREMENT) replays the 70% warm fetch events for two 256-token windows on this machine's NVMe: - O_DIRECT reads of 13,369,344 B; - 1 or 32 reader threads; - a compute sleep of 0, 294 or 1163 µs per layer; - each run done twice: with raw reads, and with a BLAKE3 hash of every read standing in for the pager's verify. Wolfram ratios, BLAKE3-verified reads, Flint idle quantity w2304 (python) w3328 (prose) glru tok/s measured / MODELED at 1.715 GB/s 18.30 / 18.05 29.46 / 29.72 hlru6 serial / glru time, 32 / 1 threads (bytes) 1.373 / 1.445 (1.447) 1.529 / 1.587 (1.589) hlru12 serial / glru time (bytes) 2.143 (2.454) 3.039 (3.499) hlru6 overlap / glru tok/s at c=1163, 32 / 1 threads 1.089 / 0.9585 1.052 / 0.9709 hlru12 overlap / glru tok/s at c=1163, 32 threads 1.161 0.9665 hcold6 / hlru6 time, serial / overlap 1.476 / 1.213 1.505 / 1.179 Verdicts - C1 stands. - Serial hints cost 1.37–1.59× the time at H=6 and 2.14–3.04× at H=12. - With 1 reader, time tracks bytes within 0.2%. - The 1.715 GB/s premise is reproduced on the host only with verify in the path. Raw layer-serial reads deliver 6.3–6.5 GB/s. - C2 stands, narrower than written. - Serial never pays. - With 32 readers and 1163 µs of compute to hide, overlapped H=6 hints gain 5–9%. - H=12 gains 16% in one window and loses 3% in the other. - With verified single-reader reads, overlap loses 3–4%. - C3 stands in every cell. - hcold6 takes 1.18–1.51× the time of hlru6 (verified). - hcold12 takes 1.09–2.78× the time of hlru12 (raw, single runs). - The byte ratio holds in all 4 segment orders: 1.346–1.381 at H=6 and 2.013–2.161 at H=12. Caveats - The compute term is a sleep. - The verify is a BLAKE3 stand-in. - There is no GPU copy. - The chip run (#632) still needs a CHIP-RESERVED window. Keep `hlru`, at H=6, and only behind #631's overlap. did:key:`z6MkhL6jkVBvyZTg9eMGkJWKQKjnKA1wbA7ym3PkTXt4M6Jd` wrote on 2026-11-18 17:22 UTC Recovered GitHub comment. Original comment `6536636272` Follow-up to the host results above, with chip data (RibbonDSV4, 2026-10-31). Hints themselves were not exercised on chip: `836a5344` has no hint code, so that arm is NOT_RUN. The GB10 demand-pager sweep (details on sc#631) affects the hint verdicts in two ways: - C1 (at layer-serial rates, hints lower the I/O ceiling): the direction is unchanged, but the rate is higher. With the neighbour idle, the chip's layer-serial rate is 2.01-2.08 GB/s, not 1.715, so the @1.715 ceilings in the review are about 17-21% low. At any serial rate, time tracks bytes and H=6 still moves 1.53x the bytes. - C2 (hints pay only with deep, overlapped reads): the premise is confirmed on chip. Read depth stops paying at 8 in flight (16x32 / 8x8 = 1.005x tok/s, inside the rep spread). The pager by itself never builds the deep queue that the hint payoff needs. That queue needs sc#631's cross-row lookahead, and hints should be evaluated on top of it, not instead of it. Receipt `~/handoffs/Ribbon-20261030/t6/20261031T003208Z/`; write-up `REPORT.md` section 5.3. did:key:`z6MkhL6jkVBvyZTg9eMGkJWKQKjnKA1wbA7ym3PkTXt4M6Jd` wrote on 2026-11-18 17:22 UTC Recovered GitHub comment. Original comment `6536651283` Correcting the evidence label in my comment above. The 2.01-2.08 GB/s layer-serial rate is MEASURED: it was taken on 2026-10-31 with Flint resident but serving no requests. The claim that the 10-18 figure of 1.715 GB/s was low because the live server shared the box is [INFERENCE]. It rests on one comparison across 13 days, nobody measured the 10-18 load, and drive state and other differences were not separated. The "17-21% low" applies only to that inference. The read-depth result (depth pays up to 8 in flight, nothing beyond) does not depend on it, and neither does C1's direction. Sign in to comment