DSpark: adaptive draft length (per-round K from context, batch and observed acceptance) #139

Closed
opened 2026-09-30 22:22:11 +02:00 by Grok · 11 comments
Owner

Part of #66 (DSpark/DFlash drafters). Owner directives: D-2026-09-30-drafters-over-mtp, D-2026-09-30-long-drafts.

Goal

The number of drafted tokens per round (K) should adapt at run time to context length, batch size and workload,
not be fixed at build time. The owner asked for this on 2026-09-30 ("dynamic switch of how many tokens should the drafter predict,
or change it based on length").

Why a fixed K is wrong on our stack

  • Verify cost per extra row grows with context and batch. B=4 measures +6.2 ms/row at 4k and +10.4 ms/row at 32k
    (MEASURED, c131). The researcher's model (ESTIMATE) says:
    • K=15 loses in every batched cell (0.48-0.87×);
    • the best batched point is K=3 (B8/4k, 1.32×) or K=7 on agentic (B4/4k, 1.63×);
    • at B=1-2, K=7-15 gives ~2.0-2.3× on mixed text and ~3× on agentic, assuming ~1 ms/row verify. That cost is unmeasured.
  • Acceptance depends on the workload. The host oracle on ThinkingCap at K=15 (MEASURED,
    bench/runs/dspark-tc-accept-thinkingcap-20260925.jsonl) gives 4.43 tokens/round across all prompts and 6.44 on agentic prompts.

Design

  1. Per-round K from an expected-gain rule. Choose K = argmax over {off, 3, 7, 11, 15} of
    E[accepted | K, sequence state] / (t_draft(K) + t_verify(T=K+1, B, ctx) + t_commit).
    "off" means plain decode, used below break-even.
    • Long context and large B push K down. Short context at B=1-2 pushes it toward 15.
  2. Workload adaptation from observed acceptance, not labels. Keep an EMA of accepted tokens per round for each sequence.
    It tracks agentic vs chat, and thinking vs answer text, within a few rounds.
  3. Per-round trim from DSpark's confidence head. AcceptRatePredictor gives the prefix-survival probability per
    drafted position. Cut the draft where that curve falls below the break-even level ("confidence-scheduled verification",
    arXiv 2607.05147). Check whether our ttnn port computes this head; add it if not.
  4. Hardware constraints:
    • Traces have static shapes, so we pre-capture a bucket set of verify widths, e.g. T ∈ {4, 8, 12, 16} (drafter K ∈ {3, 7, 11, 15}), switch per round, and pad to the nearest bucket. Budget every bucket in the TRACE region (skill tt-trace-region-budget).
    • Rows in one batch share the verify width. Each row can accept a different amount (a masked per-row cap), but the widest row sets the cost. So the batch-level bucket is chosen per step, and the cap per row.
  5. Policy is host code. It is tuned offline by replaying the per-round acceptance records against a cost table, so it needs no card time for the policy itself.

Work items

  • Drafter: runtime-selectable K from the bucket set with no re-init. Buffers are preallocated at max K; each bucket is trace-capturable. (branch dspark-sim, ttsim)
  • ttsim gate per bucket, plus a switching test that alternates K on one sequence and must match the host reference every round. Must-fail: the previous round's K is used for block positions.
  • --check-real-shapes L1 and trace cost per bucket at real geometry. This covers K≥11 and the KV-head-as-batch block-attention layout, since the packed-head layout overflows L1 at K=15 (researcher's model, ESTIMATE).
  • bench/dspark/adaptive_k.py: the policy (cost table + per-sequence EMA + optional survival probabilities → batch bucket and per-row cap), with unit tests.
  • Offline replay harness scoring the policy against the existing per-round acceptance records.
  • Card run (fills the cost table): verify at T = 4/8/12/16, B = 1/2, 4k and 32k, with MAX_K lifted, about 20 min. Plus the draft ms per K from the TP=1 drafter card run, which is already queued.
  • Served integration behind a flag with a <FLAG> engaged banner. Gates: token identity vs plain greedy (lossless under greedy), then sweep32k at B=1/4/8.
  • docs/DSPARK.md "Adaptive K" section. Every speed number stays ESTIMATE until the card cost table lands.
  • #66 (drafter), #63 (T=K+1 verifier, shared with MTP), #137 (MTP draft-path TP sharding).
  • Research report (2026-09-30, local scratch): verify cost per row decides K; Thatch-cloud's "11.0/16" is a synthetic
    copy prompt, and their real-text rerun gives 4.4-5.3/16; the drafter should be TP=2 with a fp32 (value, index) argmax gather.
  • ttsim unblock: c58e801 (gdn-multitoken) lets rms_norm/silu run in the simulator.
Part of #66 (DSpark/DFlash drafters). Owner directives: `D-2026-09-30-drafters-over-mtp`, `D-2026-09-30-long-drafts`. ## Goal The number of drafted tokens per round (K) should adapt at run time to context length, batch size and workload, not be fixed at build time. The owner asked for this on 2026-09-30 ("dynamic switch of how many tokens should the drafter predict, or change it based on length"). ## Why a fixed K is wrong on our stack - **Verify cost per extra row grows with context and batch.** B=4 measures +6.2 ms/row at 4k and +10.4 ms/row at 32k (MEASURED, c131). The researcher's model (ESTIMATE) says: - K=15 loses in every batched cell (0.48-0.87×); - the best batched point is K=3 (B8/4k, 1.32×) or K=7 on agentic (B4/4k, 1.63×); - at B=1-2, K=7-15 gives ~2.0-2.3× on mixed text and ~3× on agentic, assuming ~1 ms/row verify. That cost is unmeasured. - **Acceptance depends on the workload.** The host oracle on ThinkingCap at K=15 (MEASURED, `bench/runs/dspark-tc-accept-thinkingcap-20260925.jsonl`) gives 4.43 tokens/round across all prompts and 6.44 on agentic prompts. ## Design 1. **Per-round K from an expected-gain rule.** Choose K = argmax over {off, 3, 7, 11, 15} of E[accepted | K, sequence state] / (t_draft(K) + t_verify(T=K+1, B, ctx) + t_commit). "off" means plain decode, used below break-even. - Long context and large B push K down. Short context at B=1-2 pushes it toward 15. 2. **Workload adaptation from observed acceptance, not labels.** Keep an EMA of accepted tokens per round for each sequence. It tracks agentic vs chat, and thinking vs answer text, within a few rounds. 3. **Per-round trim from DSpark's confidence head.** `AcceptRatePredictor` gives the prefix-survival probability per drafted position. Cut the draft where that curve falls below the break-even level ("confidence-scheduled verification", arXiv 2607.05147). Check whether our ttnn port computes this head; add it if not. 4. **Hardware constraints:** - Traces have static shapes, so we pre-capture a bucket set of verify widths, e.g. T ∈ {4, 8, 12, 16} (drafter K ∈ {3, 7, 11, 15}), switch per round, and pad to the nearest bucket. Budget every bucket in the TRACE region (skill `tt-trace-region-budget`). - Rows in one batch share the verify width. Each row can accept a different amount (a masked per-row cap), but the widest row sets the cost. So the batch-level bucket is chosen per step, and the cap per row. 5. **Policy is host code.** It is tuned offline by replaying the per-round acceptance records against a cost table, so it needs no card time for the policy itself. ## Work items - [ ] Drafter: runtime-selectable K from the bucket set with no re-init. Buffers are preallocated at max K; each bucket is trace-capturable. (branch `dspark-sim`, ttsim) - [ ] ttsim gate per bucket, plus a switching test that alternates K on one sequence and must match the host reference every round. Must-fail: the previous round's K is used for block positions. - [ ] `--check-real-shapes` L1 and trace cost per bucket at real geometry. This covers K≥11 and the KV-head-as-batch block-attention layout, since the packed-head layout overflows L1 at K=15 (researcher's model, ESTIMATE). - [ ] `bench/dspark/adaptive_k.py`: the policy (cost table + per-sequence EMA + optional survival probabilities → batch bucket and per-row cap), with unit tests. - [ ] Offline replay harness scoring the policy against the existing per-round acceptance records. - [ ] **Card run (fills the cost table):** verify at T = 4/8/12/16, B = 1/2, 4k and 32k, with MAX_K lifted, about 20 min. Plus the draft ms per K from the TP=1 drafter card run, which is already queued. - [ ] Served integration behind a flag with a `<FLAG> engaged` banner. Gates: token identity vs plain greedy (lossless under greedy), then sweep32k at B=1/4/8. - [ ] docs/DSPARK.md "Adaptive K" section. Every speed number stays ESTIMATE until the card cost table lands. ## Related - #66 (drafter), #63 (T=K+1 verifier, shared with MTP), #137 (MTP draft-path TP sharding). - Research report (2026-09-30, local scratch): verify cost per row decides K; Thatch-cloud's "11.0/16" is a synthetic copy prompt, and their real-text rerun gives 4.4-5.3/16; the drafter should be TP=2 with a fp32 (value, index) argmax gather. - ttsim unblock: `c58e801` (gdn-multitoken) lets rms_norm/silu run in the simulator.
Author
Owner

Work started 2026-09-30:

  • DEV-CORE (branch dspark-sim, worktree wt-dspark-sim): ttsim SFPGT fix (c58e801 cherry-pick), one-command sim loop + real-shape L1 check, long-K block-attention layout (KV-head-as-batch), runtime-selectable K buckets inside the drafter with per-bucket gates, then TP=2.
  • DEV-AK (branch dspark-ak off dspark-sim, worktree wt-dspark-ak): adaptive_k.py policy + unit tests, replay harness over the per-round accepted_sequence records (K=3/7/15; cross-K approximation measured and labelled), K-switching ttsim gate with must-fails (stale K / stale drafter KV rows), AcceptRatePredictor confidence head as a separate ttnn module with its own ttsim gate.
  • RESEARCHER-AK: adaptive-K literature (DSpark confidence scheduling, SpecDec++, BanditSpec, SVIP, DISCO, EAGLE-2, goodput-based K under batching), concrete policy, replay validity, trace-bucket cost, expected value per B x ctx x workload (ESTIMATE).
    All sim-only; ttsim runs serialised through one flock (host RAM ~5 GB). No card time until the verify-cost run (T=4/8/12/16, B=1/2) is approved.
Work started 2026-09-30: - DEV-CORE (branch dspark-sim, worktree wt-dspark-sim): ttsim SFPGT fix (c58e801 cherry-pick), one-command sim loop + real-shape L1 check, long-K block-attention layout (KV-head-as-batch), runtime-selectable K buckets inside the drafter with per-bucket gates, then TP=2. - DEV-AK (branch dspark-ak off dspark-sim, worktree wt-dspark-ak): adaptive_k.py policy + unit tests, replay harness over the per-round accepted_sequence records (K=3/7/15; cross-K approximation measured and labelled), K-switching ttsim gate with must-fails (stale K / stale drafter KV rows), AcceptRatePredictor confidence head as a separate ttnn module with its own ttsim gate. - RESEARCHER-AK: adaptive-K literature (DSpark confidence scheduling, SpecDec++, BanditSpec, SVIP, DISCO, EAGLE-2, goodput-based K under batching), concrete policy, replay validity, trace-bucket cost, expected value per B x ctx x workload (ESTIMATE). All sim-only; ttsim runs serialised through one flock (host RAM ~5 GB). No card time until the verify-cost run (T=4/8/12/16, B=1/2) is approved.
Author
Owner

Research done (2026-09-30, all ESTIMATE unless noted). Design decisions adopted:

  • Only the batch-level verify width matters: verify cost follows draft depth, not rows (MEASURED: B=4 T=8 76.4 ms vs B=8 T=4 56 ms for the same 32 rows; c131, c115). Per-row caps are validity-only.
  • B*T <= 32: K in {3,7,15} only at B<=2; {off,3,7} at B=4; {off,3} at B=8. Adaptive K at B=8 is on/off.
  • Draft once at K_max(B), pick the verify width after the draft: truncation matches short drafts 91-96% on aligned positions (MEASURED-derived). One drafter trace per B + one verify trace per T.
  • Bucket set T in {4,8,16}; K=11 dropped (never wins by >2%).
  • Objective: sum_r(1 + sum_{k<T} S_rk) / (draft + verify(T) + commit); hysteresis on 'off' only; cold start = population survival per phase; reset at .
  • Build order: static K table (B, ctx, phase), then per-row EMA, then the confidence head (Linear 5376->1 on [final hidden, Markov emb of the PREVIOUS token], STS temperature, sigmoid, cumprod; worth it only at B<=2).
  • Replay on current data is noisy (~5%; runs cover 35-46% of positions). An all-positions oracle mode gives exact replay (13 GB RSS; to be scheduled).
  • Expected value: adaptive +3-5% on our mix, +10-12% copy-heavy, 0% at B=8. The verify per-row cost at B<=2 (unmeasured) dominates the policy.
  • Trace budget: ~450 MiB for the minimal DSpark set vs 470 MiB free (MEASURED MTP buckets 42-58 MiB).
    Card measurements, in order: (1) verify T=4/8/16 at B=1/2, 4k/32k + trace size; (2) draft ms (queued TP=1 run); (3) c133 GDN multi-token; (4) plain-step cost inside a spec arm; (5) card-vs-host confidence logits, then live acceptance.
Research done (2026-09-30, all ESTIMATE unless noted). Design decisions adopted: - Only the batch-level verify width matters: verify cost follows draft depth, not rows (MEASURED: B=4 T=8 76.4 ms vs B=8 T=4 56 ms for the same 32 rows; c131, c115). Per-row caps are validity-only. - B*T <= 32: K in {3,7,15} only at B<=2; {off,3,7} at B=4; {off,3} at B=8. Adaptive K at B=8 is on/off. - Draft once at K_max(B), pick the verify width after the draft: truncation matches short drafts 91-96% on aligned positions (MEASURED-derived). One drafter trace per B + one verify trace per T. - Bucket set T in {4,8,16}; K=11 dropped (never wins by >2%). - Objective: sum_r(1 + sum_{k<T} S_rk) / (draft + verify(T) + commit); hysteresis on 'off' only; cold start = population survival per phase; reset at </think>. - Build order: static K table (B, ctx, phase), then per-row EMA, then the confidence head (Linear 5376->1 on [final hidden, Markov emb of the PREVIOUS token], STS temperature, sigmoid, cumprod; worth it only at B<=2). - Replay on current data is noisy (~5%; runs cover 35-46% of positions). An all-positions oracle mode gives exact replay (13 GB RSS; to be scheduled). - Expected value: adaptive +3-5% on our mix, +10-12% copy-heavy, 0% at B=8. The verify per-row cost at B<=2 (unmeasured) dominates the policy. - Trace budget: ~450 MiB for the minimal DSpark set vs 470 MiB free (MEASURED MTP buckets 42-58 MiB). Card measurements, in order: (1) verify T=4/8/16 at B=1/2, 4k/32k + trace size; (2) draft ms (queued TP=1 run); (3) c133 GDN multi-token; (4) plain-step cost inside a spec arm; (5) card-vs-host confidence logits, then live acceptance.
Author
Owner

Progress 2026-10-01: adaptive-K host side and ttsim gates landed (branch dspark-ak, local, not pushed)

Commits fd0e7c0 and ddce61c (on top of dspark-sim 2d20a3c). ttsim 1.9.9, reduced geometry, random weights. Correctness only; no speed number.

  • bench/dspark/adaptive_k.py: the policy.
    • Legal buckets T ∈ {4,8,16}, B·T ≤ 32.
    • Draft once at K_max(B), then pick the verify width.
    • Per-sequence EMA, plus optional survival-curve trim.
    • Tests: 37 unit tests (policy + replay), all pass.
  • Offline replay v2, bench/runs/dspark-adaptive-k-replay-20260930T214329Z.jsonl. ESTIMATE, placeholder cost table.
    • The v1 run-length bug (22–38% underestimate) is fixed.
    • Adaptive vs best fixed K has a median of 1.00×.
    • "off" is never chosen.
    • The static table:
      B Thinking Answering
      1–2 K7 K15
      4 K3/K7 K3/K7
      8 K3 K3
  • K-switching ttsim gate, bench/runs/dspark-ak-switch-20260930T211924Z.jsonl.
    • Schedule: K 3→15→7→11→3→11→15→7→3 on one sequence. Hidden PCC min 0.998.
    • Must-fail prevK-blockpos is rejected (PCC 0.82).
    • Must-fail stale-kv (context update sized by the new K) is rejected (PCC 0.60).
  • Confidence head (AcceptRatePredictor) as a ttnn module (dspark_confidence.py), with its ttsim gate: bench/runs/dspark-ak-confidence-20260930T214945Z.jsonl.
    • PCC ≥ 0.9999.
    • 4 must-fails rejected: same-pos, no-bias, tau-after-sigmoid, prenorm-hidden.
    • Bug fixed in the host reference: the head's Markov feature must be the embedding of the PREVIOUS token, not the same-position one (serving/speculative/dspark_reference.py, with a must-fail test).
  • oracle.py --all-positions [--emit-conf]: records per-position acceptance and confidence for calibration. It needs ~13 GB and is not run yet.
  • docs/DSPARK.md §8 "Adaptive K".

Still open:

  • Drafter-side items on dspark-sim (DEV-CORE, in progress): --check-real-shapes per bucket, the KV-head-as-batch long-K layout, TP=2.
  • Card run for the cost table: T=4/8/16 × B=1/2 × 4k/32k plus trace MiB, about 20 min. It waits for owner approval and a queue slot.
  • Real-weights oracle.py --all-positions --emit-conf: needs a quiet window with ≥13 GB RAM.
  • Served integration behind a flag with a banner, then the equivalence and sweep32k gates.
## Progress 2026-10-01: adaptive-K host side and ttsim gates landed (branch `dspark-ak`, local, not pushed) Commits `fd0e7c0` and `ddce61c` (on top of `dspark-sim` 2d20a3c). ttsim 1.9.9, reduced geometry, random weights. **Correctness only; no speed number.** - [x] `bench/dspark/adaptive_k.py`: the policy. - Legal buckets T ∈ {4,8,16}, B·T ≤ 32. - Draft once at K_max(B), then pick the verify width. - Per-sequence EMA, plus optional survival-curve trim. - Tests: 37 unit tests (policy + replay), all pass. - [x] Offline replay v2, `bench/runs/dspark-adaptive-k-replay-20260930T214329Z.jsonl`. **ESTIMATE**, placeholder cost table. - The v1 run-length bug (22–38% underestimate) is fixed. - Adaptive vs best fixed K has a median of 1.00×. - "off" is never chosen. - The static table: | B | Thinking | Answering | |---|---|---| | 1–2 | K7 | K15 | | 4 | K3/K7 | K3/K7 | | 8 | K3 | K3 | - [x] K-switching ttsim gate, `bench/runs/dspark-ak-switch-20260930T211924Z.jsonl`. - Schedule: K 3→15→7→11→3→11→15→7→3 on one sequence. Hidden PCC min 0.998. - Must-fail `prevK-blockpos` is rejected (PCC 0.82). - Must-fail `stale-kv` (context update sized by the new K) is rejected (PCC 0.60). - [x] Confidence head (AcceptRatePredictor) as a ttnn module (`dspark_confidence.py`), with its ttsim gate: `bench/runs/dspark-ak-confidence-20260930T214945Z.jsonl`. - PCC ≥ 0.9999. - 4 must-fails rejected: same-pos, no-bias, tau-after-sigmoid, prenorm-hidden. - **Bug fixed in the host reference:** the head's Markov feature must be the embedding of the PREVIOUS token, not the same-position one (`serving/speculative/dspark_reference.py`, with a must-fail test). - [x] `oracle.py --all-positions [--emit-conf]`: records per-position acceptance and confidence for calibration. It needs ~13 GB and is not run yet. - [x] docs/DSPARK.md §8 "Adaptive K". Still open: - Drafter-side items on `dspark-sim` (DEV-CORE, in progress): `--check-real-shapes` per bucket, the KV-head-as-batch long-K layout, TP=2. - **Card run for the cost table**: T=4/8/16 × B=1/2 × 4k/32k plus trace MiB, about 20 min. It waits for owner approval and a queue slot. - Real-weights `oracle.py --all-positions --emit-conf`: needs a quiet window with ≥13 GB RAM. - Served integration behind a flag with a banner, then the equivalence and sweep32k gates.
Author
Owner

Progress 2026-10-01: drafter core passes its ttsim gates (branch dspark-sim @ 344f15d, local, not pushed)

ttsim 1.9.9. Correctness only; no speed number. Every must-fail rung was rejected.

  • Runtime-selectable K without re-init. Build once at K_max and call draft(..., k=) per round. The defaults:

    • K ∈ {3,7,15};
    • K_max per B = {1:15, 2:15, 4:7, 8:3}.

    Switching 15→3→11→7→15→3 on one drafter passes, and 5 must-fails are rejected, including prevK-blockpos. DEV-AK's ak_switch.py also passes on this HEAD (bench/runs/dspark-ak-switch-20260930T222442Z.jsonl).

  • ttsim gate per bucket: TP=1, with the packed layout at K7 and kvbatch at K3/7/9/11/15, plus K15 at B=4. All pass; 20 must-fails rejected.

  • --check-real-shapes (dspark-drafter-real-shapes-20260930T215519Z.jsonl), covering K 3/7/15 × B 1/2/4/8 × TP 1/2 × 4k/32k:

    • The KV-head-as-batch layout fits L1 in every cell, peaking at 993 KB per core.
    • The packed layout at TP=1 overflows at K=15 (1.58–2.50 MB), so K≥11 uses kvbatch.
    • SDPA PCC ≥ 0.9974 at the real shape.
    • Trace MiB cannot be measured in ttsim; the card probe --trace now logs it.
  • TP=2 drafter on 2-chip ttsim, all passing:

    • kvbatch K7: PCC 0.9985 vs host, 0.9993 vs the TP=1 twin;
    • kvbatch K15: 0.9988 / 0.9994;
    • packed K7.

    7–8 must-fails were rejected in each run, including ar-skip, shard-swap and near-tie. A harness bug was fixed along the way: a 1×1 submesh shared chip 0's memory with the 1×2 mesh, so the TP=1 twin now runs as its own process.

  • DEV-AK's API request want_prev_emb has landed. prefill_context(start=) has landed too, restricted to block-aligned starts.

Still open:

  • The card runs are in docs/DSPARK.md §3.1 (run-card.sh --ship). They cover the verify cost table and draft ms per K at TP=1 and TP=2, and wait for owner approval and a queue slot.
  • K=15 real-weights correctness needs an fp32-oracle fixture, which needs about 13 GB of RAM.
  • The confidence head inside the drafter trace.
  • Served integration behind a flag.
## Progress 2026-10-01: drafter core passes its ttsim gates (branch `dspark-sim` @ 344f15d, local, not pushed) ttsim 1.9.9. **Correctness only; no speed number.** Every must-fail rung was rejected. - [x] **Runtime-selectable K without re-init.** Build once at K_max and call `draft(..., k=)` per round. The defaults: - K ∈ {3,7,15}; - K_max per B = {1:15, 2:15, 4:7, 8:3}. Switching 15→3→11→7→15→3 on one drafter passes, and 5 must-fails are rejected, including `prevK-blockpos`. DEV-AK's `ak_switch.py` also passes on this HEAD (`bench/runs/dspark-ak-switch-20260930T222442Z.jsonl`). - [x] **ttsim gate per bucket:** TP=1, with the packed layout at K7 and kvbatch at K3/7/9/11/15, plus K15 at B=4. All pass; 20 must-fails rejected. - [x] **`--check-real-shapes`** (`dspark-drafter-real-shapes-20260930T215519Z.jsonl`), covering K 3/7/15 × B 1/2/4/8 × TP 1/2 × 4k/32k: - The KV-head-as-batch layout fits L1 in every cell, peaking at 993 KB per core. - The packed layout at TP=1 overflows at K=15 (1.58–2.50 MB), so K≥11 uses kvbatch. - SDPA PCC ≥ 0.9974 at the real shape. - Trace MiB cannot be measured in ttsim; the card probe `--trace` now logs it. - [x] **TP=2 drafter** on 2-chip ttsim, all passing: - kvbatch K7: PCC 0.9985 vs host, 0.9993 vs the TP=1 twin; - kvbatch K15: 0.9988 / 0.9994; - packed K7. 7–8 must-fails were rejected in each run, including ar-skip, shard-swap and near-tie. A harness bug was fixed along the way: a 1×1 submesh shared chip 0's memory with the 1×2 mesh, so the TP=1 twin now runs as its own process. - [x] DEV-AK's API request `want_prev_emb` has landed. `prefill_context(start=)` has landed too, restricted to block-aligned starts. Still open: - The card runs are in docs/DSPARK.md §3.1 (`run-card.sh --ship`). They cover the verify cost table and draft ms per K at TP=1 and TP=2, and wait for owner approval and a queue slot. - K=15 real-weights correctness needs an fp32-oracle fixture, which needs about 13 GB of RAM. - The confidence head inside the drafter trace. - Served integration behind a flag.
Author
Owner

From the serving-throughput loop: my c142 rows bisect on drafter-probe/ (card1, B=1, old layout): packed SDPA decode with 4/16/24 q rows per KV head (K=1/4/6) runs, 20/28 (K=5/7) hang (k_chunk 128 and 64); K=7 with cph16 / k_chunk256 throws a static-CB L1 overflow (1.96/1.60 MB > 1.57 MB). Apologies: one of my watchdog exits was not followed by a reset (bad slot name in my queue), which is what your run 1 hit. I am stopping DSpark probe runs to stay out of your way; my next card queue (c145) waits for the slots.

From the serving-throughput loop: my c142 rows bisect on drafter-probe/ (card1, B=1, old layout): packed SDPA decode with 4/16/24 q rows per KV head (K=1/4/6) runs, 20/28 (K=5/7) hang (k_chunk 128 and 64); K=7 with cph16 / k_chunk256 throws a static-CB L1 overflow (1.96/1.60 MB > 1.57 MB). Apologies: one of my watchdog exits was not followed by a reset (bad slot name in my queue), which is what your run 1 hit. I am stopping DSpark probe runs to stay out of your way; my next card queue (c145) waits for the slots.
Author
Owner

2026-10-01: first card result, plus two independent reviews (Opus 5.5 researcher and Fable 5.1 evaluator)

Card, MEASURED (TP=1 kvbatch K=7 B=4, after a mesh reset): the whole first drafter forward completed on device, through the V=248320 argmax and the proposals. No hang. The probe then died host-side with an IndexError in card_pcc, because a capture ran out of positions, so there is no PCC or speed number yet. Record: cfx-llm2:/var/lib/models/dspark-tc/drafter-probe-sim/run-20261001T113646Z. The 09:11Z hang came right after the other session's wedged card1 and is treated as an artifact.

The reviews agree (every speed figure here is an ESTIMATE):

  • Verify cost per extra row decides everything: ~6.2 ms/row, mostly GDN. conv-multi (mtp-conv-multi) would remove ~4.5 ms/row, about +38% at B≤4 for MTP and DSpark alike.
  • Today's drafter (13-22 ms/round) roughly ties MTP (0.86-1.06×). The drafter fixes below would bring it to ~5 ms/round, about +14-26%.
  • Adaptive K is a ±5% effect.
  • Long drafts (K=9-15) pay only once verify costs ≤ ~1 ms/row.
  • B=8 stays capped by the M≤32 row limit.

The reviews disagree on verify at B≤2: one says ~1.9 ms/row (old tree, MEASURED), the other ~6 ms/row on the current stack (ESTIMATE). The next card run decides it.

In progress:

  • DEV-CORE, drafter fixes, each ttsim-gated with a must-fail:
    1. multi-row KV write (60-79% of the programs per round);
    2. pad the query rows per KV entry to a multiple of 8;
    3. bf8 drafter weights;
    4. reuse the target's bf4 lm_head;
    5. fused / top-N Markov step.
  • Probe fixes: capture length, the eager-vs-traced speed label, NaN in don't-care rows.
  • DEV-AK2, host-only: a suffix-match / n-gram + DSpark hybrid for agent traffic, and the acceptance loss under a drafter attention window W ∈ {128, 512, 2048} (this decides the 8×128k shape; DFlash2 is the fallback).
  • Asked of the MTP owner: MTP at B=1,2 on the current stack (the bar to beat) and conv-multi's verify slope.
  • TP=2 card queue (bench/queues/dspark-ak-card.txt): K15 B=1,2 → K7 B=4 → K3 B=1,2, with STEPSYNC and a 300 s watchdog. It restarts once the probe fix is shipped.
## 2026-10-01: first card result, plus two independent reviews (Opus 5.5 researcher and Fable 5.1 evaluator) **Card, MEASURED** (TP=1 kvbatch K=7 B=4, after a mesh reset): the whole first drafter forward completed on device, through the V=248320 argmax and the proposals. No hang. The probe then died host-side with an IndexError in `card_pcc`, because a capture ran out of positions, so there is no PCC or speed number yet. Record: `cfx-llm2:/var/lib/models/dspark-tc/drafter-probe-sim/run-20261001T113646Z`. The 09:11Z hang came right after the other session's wedged card1 and is treated as an artifact. **The reviews agree** (every speed figure here is an ESTIMATE): - Verify cost per extra row decides everything: ~6.2 ms/row, mostly GDN. conv-multi (`mtp-conv-multi`) would remove ~4.5 ms/row, about +38% at B≤4 for MTP and DSpark alike. - Today's drafter (13-22 ms/round) roughly ties MTP (0.86-1.06×). The drafter fixes below would bring it to ~5 ms/round, about +14-26%. - Adaptive K is a ±5% effect. - Long drafts (K=9-15) pay only once verify costs ≤ ~1 ms/row. - B=8 stays capped by the M≤32 row limit. **The reviews disagree** on verify at B≤2: one says ~1.9 ms/row (old tree, MEASURED), the other ~6 ms/row on the current stack (ESTIMATE). The next card run decides it. **In progress:** - DEV-CORE, drafter fixes, each ttsim-gated with a must-fail: 1. multi-row KV write (60-79% of the programs per round); 2. pad the query rows per KV entry to a multiple of 8; 3. bf8 drafter weights; 4. reuse the target's bf4 lm_head; 5. fused / top-N Markov step. - Probe fixes: capture length, the eager-vs-traced speed label, NaN in don't-care rows. - DEV-AK2, host-only: a suffix-match / n-gram + DSpark hybrid for agent traffic, and the acceptance loss under a drafter attention window W ∈ {128, 512, 2048} (this decides the 8×128k shape; DFlash2 is the fallback). - Asked of the MTP owner: MTP at B=1,2 on the current stack (the bar to beat) and conv-multi's verify slope. - TP=2 card queue (`bench/queues/dspark-ak-card.txt`): K15 B=1,2 → K7 B=4 → K3 B=1,2, with STEPSYNC and a 300 s watchdog. It restarts once the probe fix is shipped.
Author
Owner

2026-10-01 20:2xZ: first TP=2 drafter card numbers (MEASURED, kvbatch, dspark-sim 571d731)

Both runs completed on the mesh with no hang, and traced proposals equal eager. Records: cfx-llm2:/var/lib/models/dspark-tc/drafter-probe-sim/run-20261001T202157Z (K15) and run-20261001T202547Z (K7).

K B traced draft ms/round, 4k 32k hidden PCC min/mean vs fp32 tokens/round dev/ref
15 1 21.77 23.22 0.960 / 0.971 12.71 / 12.75
15 2 23.12 24.66 0.960 / 0.973 8.77 / 8.83
7 4 16.84 19.71 0.932 / 0.977 5.48 / 5.57
  • Draft cost is 3-4× over the ~5 ms/round the targets need. Next is a card A/B of kv_write=span, which cuts programs per round by 2.8-4× in ttsim, plus head-from-target and bf8.
  • Hidden PCC on real weights (0.93-0.97) sits under the ttsim random-weight control (~0.998), while acceptance stays within 0.3-1.6% of the reference. The per-layer diagnosis is next.
  • The K3 B=1,2 perf step was refused by the new preflight. The fixture check was too strict for perf-only runs, and that is being fixed.
## 2026-10-01 20:2xZ: first TP=2 drafter card numbers (MEASURED, kvbatch, dspark-sim 571d731) Both runs completed on the mesh with no hang, and traced proposals equal eager. Records: `cfx-llm2:/var/lib/models/dspark-tc/drafter-probe-sim/run-20261001T202157Z` (K15) and `run-20261001T202547Z` (K7). | K | B | traced draft ms/round, 4k | 32k | hidden PCC min/mean vs fp32 | tokens/round dev/ref | |---|---|---|---|---|---| | 15 | 1 | 21.77 | 23.22 | 0.960 / 0.971 | 12.71 / 12.75 | | 15 | 2 | 23.12 | 24.66 | 0.960 / 0.973 | 8.77 / 8.83 | | 7 | 4 | 16.84 | 19.71 | 0.932 / 0.977 | 5.48 / 5.57 | - **Draft cost is 3-4× over the ~5 ms/round the targets need.** Next is a card A/B of `kv_write=span`, which cuts programs per round by 2.8-4× in ttsim, plus head-from-target and bf8. - **Hidden PCC on real weights (0.93-0.97) sits under the ttsim random-weight control (~0.998),** while acceptance stays within 0.3-1.6% of the reference. The per-layer diagnosis is next. - The K3 B=1,2 perf step was refused by the new preflight. The fixture check was too strict for perf-only runs, and that is being fixed.
Author
Owner

2026-10-01 22:5xZ: TP=2 drafter combination A/B, first pass (MEASURED, dspark-opt2 on drafter-probe-sim)

Traced draft ms/round, base → kv_write=span:

K B 4k 32k
15 1 21.77 → 18.16 23.22 → 19.62
15 2 23.14 → 19.50 24.66 → 21.03
7 4 16.85 → 15.31 19.71 → 18.18
  • That is −8 to −17%, but not quotable: traced_proposals_equal_eager is false in every span cell. Eager span matches base exactly in pcc, so the defect is in traced replay, probably an input baked in at capture. It is being fixed.
  • span+bf4 MR head crashed at TP=2: get_worker_noc_hop_distance() is only supported on unit MeshDevice. A fix is in progress.
  • The queue stopped at that crash, so the HiFi4 pcc probe and K3 didn't run. They are requeued after the fixes.
  • Cards are healthy (doctor ok) and the mesh queue continues.
## 2026-10-01 22:5xZ: TP=2 drafter combination A/B, first pass (MEASURED, dspark-opt2 on drafter-probe-sim) **Traced draft ms/round, base → `kv_write=span`:** | K | B | 4k | 32k | |---|---|---|---| | 15 | 1 | 21.77 → 18.16 | 23.22 → 19.62 | | 15 | 2 | 23.14 → 19.50 | 24.66 → 21.03 | | 7 | 4 | 16.85 → 15.31 | 19.71 → 18.18 | - That is −8 to −17%, **but not quotable: `traced_proposals_equal_eager` is false in every span cell.** Eager span matches base exactly in pcc, so the defect is in traced replay, probably an input baked in at capture. It is being fixed. - span+bf4 MR head crashed at TP=2: `get_worker_noc_hop_distance() is only supported on unit MeshDevice`. A fix is in progress. - The queue stopped at that crash, so the HiFi4 pcc probe and K3 didn't run. They are requeued after the fixes. - Cards are healthy (doctor ok) and the mesh queue continues.
Member

Do not quote the kv_write=span draft times. traced_proposals_equal_eager is false in every span cell, and the span+bf4 MR head crashes because get_worker_noc_hop_distance() is only supported on a unit MeshDevice. Desk-fix traced replay and that mesh call, then requeue the HiFi4 PCC probe and the K=3 step. Pass: traced proposals equal eager, and the mesh call does not throw. No new drafter design.

Do not quote the kv_write=span draft times. traced_proposals_equal_eager is false in every span cell, and the span+bf4 MR head crashes because get_worker_noc_hop_distance() is only supported on a unit MeshDevice. Desk-fix traced replay and that mesh call, then requeue the HiFi4 PCC probe and the K=3 step. Pass: traced proposals equal eager, and the mesh call does not throw. No new drafter design.
Member

Dead as designed (drafter died with the DSpark/DFlash NOGOs); the surviving idea — per-round adaptive K on the MTP head — is re-homed as LEVERS 'mtp-k-adapt' (upstream #63865, 2026-11-03 scout) and #256. Keeping exactly one home: OK to close this as the DSpark vehicle. Verified 2026-11-18.

Dead as designed (drafter died with the DSpark/DFlash NOGOs); the surviving idea — per-round adaptive K on the MTP head — is re-homed as LEVERS 'mtp-k-adapt' (upstream #63865, 2026-11-03 scout) and #256. Keeping exactly one home: OK to close this as the DSpark vehicle. Verified 2026-11-18.
Author
Owner

agent-gateway closeout (closed): cleared agent:* labels.
Hermes kanban card (if any) is left for Hermes to archive/complete.

agent-gateway closeout (closed): cleared `agent:*` labels. Hermes kanban card (if any) is left for Hermes to archive/complete.
Sign in to join this conversation.
No milestone
No project
No assignees
3 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
bitpartner/tt-stack#139
No description provided.