spec: ngram/lookup accept oracle (batch-spec rescue) #98

Open
opened 2026-09-26 04:44:27 +02:00 by tenstorrent · 3 comments
Member

Parent / blocked-by tracking via #90 grill board (new spec lane). After MTP K matrix.

Grill call: GO (oracle) → then WATCH device

Hypothesis. AMD 2×R9700 external: plain29 → MTP5+ngram71 → file-edit~170 tok/s. Win is workload-shaped accept, not a TT kernel. Thatch hybrid lookup+MTP is the closest tip.

Depends on. MTP verify path; host ngram drafter first.

Risk. Fake win on synthetic coding ladders (Thatch real-text-acceptance: synth 6.8 vs real 4.4–5.3/round).

Measure first. Host oracle: MTP drafts ± ngram proposals on real edit vs new-code captures; accept curve only. No device port until that shows headroom.

Related WATCH: Thatch pair/quad (#66), metal #55548 / vllm-tt #131 (we already have local MTP).

Refs: grill 2026-09-26 Tenstorrent.

Parent / blocked-by tracking via #90 grill board (new spec lane). After MTP K matrix. ## Grill call: **GO** (oracle) → then WATCH device **Hypothesis.** AMD 2×R9700 external: plain~29 → MTP5+ngram~71 → file-edit~170 tok/s. Win is **workload-shaped accept**, not a TT kernel. Thatch hybrid lookup+MTP is the closest tip. **Depends on.** MTP verify path; host ngram drafter first. **Risk.** Fake win on synthetic coding ladders (Thatch `real-text-acceptance`: synth 6.8 vs real 4.4–5.3/round). **Measure first.** Host oracle: MTP drafts ± ngram proposals on **real** edit vs new-code captures; accept curve only. No device port until that shows headroom. Related WATCH: Thatch pair/quad (#66), metal #55548 / vllm-tt #131 (we already have local MTP). Refs: grill 2026-09-26 Tenstorrent.
tenstorrent changed title from spec: ngram / lookup draft on top of MTP — host oracle on real edits first to spec: ngram/lookup accept oracle (batch-spec rescue after c69d) 2026-09-30 10:19:04 +02:00
Author
Member

Host oracle only, on real edit versus new-code captures: MTP drafts plus ngram proposals, accept curve only. Pass: a real-text accept gain versus current MTP accept, not a synthetic ladder. Fail: no headroom, or the gain exists only on synth. No device port and no mesh. c69d is not the gate.

Host oracle only, on real edit versus new-code captures: MTP drafts plus ngram proposals, accept curve only. Pass: a real-text accept gain versus current MTP accept, not a synthetic ladder. Fail: no headroom, or the gain exists only on synth. No device port and no mesh. c69d is not the gate.
tenstorrent changed title from spec: ngram/lookup accept oracle (batch-spec rescue after c69d) to spec: ngram/lookup accept oracle (batch-spec rescue) 2026-10-03 15:57:48 +02:00
Author
Member

Host accept curve only. No device, no mesh, no /tokenize. This is the command for the pickup above. Do not open a DFlash2 issue: that host oracle is already measured and is the same class as DSpark.

Bar (served MTP, not a host drafter). LEDGER R-2026-10-03-gdc-cpk, arm …-csplit-t0-gdc-cpk: accept_rate 0.599 at B4/4k and 0.546 at B1/32k, identical on both arms of that A/B. accept_rate() is mean accepted draft tokens per iteration; committed tokens/iter is that plus 1 (bench/mtp/overlay/models/demos/blackhole/qwen36/tt/spec_decode.py). So the current MTP accept is 1.599 tokens/iter at B4/4k and 1.546 at B1/32k. K by bucket 8:2,4:3,2:3,1:3 is already shipped (R-2026-10-01-mtp-warm-kb). c69d is not the gate.

Already measured. Not this run.

  • DSpark host oracle, LEDGER R-2026-09-25-dspark-tc: 3.00 / 3.95 / 4.43 tokens/round at K=3/7/15 on ThinkingCap (bench/runs/dspark-tc-accept-thinkingcap-20260925.jsonl).
  • DFlash2 host oracle, #66 comment 2026-10-01 and docs/PERF-LOOP-SYNTHESIS.md: 3.05 / 4.04 / 4.34 at K=3/7/15 (bench/runs/dflash2-accept-thinkingcap-20260930T164522Z.jsonl). Longer host K is that K=15 column. It is not a new experiment.
  • Lookup alone, bench/runs/lookup-draft-acceptance-20260919T0400Z.jsonl: 1.16-1.41 committed/block on free-running text (no headroom versus 1.599) and 12.21 on a synthetic 5% line-edit. The record says that edit is synthetic. It is not the pass.
  • #139 stays a desk fix (traced_proposals_equal_eager false; mesh hop crash). #66: do not rerun K=7 at k_chunk 128 or 256. #133: dv32k stays parked.

Next. Replay ngram proposals from bench/harness/spec/lookup_draft.py (LookupDraft) on the existing ThinkingCap capture tapes. Token ids are already in the safetensors (bench/runs/dspark-tc-capture-20260924T195053Z.jsonl, dir /var/lib/models/dspark-tc/capture-thinkingcap-20260924T195053Z). Split real edit (agentic_edit_nothink, agentic_edit_think) from new code (code_new). Greedy prefix accept against the captured continuation. Primary K=3, because that is the shipped B4 bucket; also report K=7 and K=15.

Pass: real-edit tokens/round above 1.599, with code_new reported beside it. Fail: no headroom on the edit tapes, or the only gain is the synthetic 12.21 ladder. No device port until that number exists.

# host only. CAP is the capture dir above. No docker, no card.
cd /path/to/tt-stack
CAP=/var/lib/models/dspark-tc/capture-thinkingcap-20260924T195053Z \
python3 - << 'END'
import json, os
from safetensors import safe_open
from bench.harness.spec.lookup_draft import LookupDraft

CAP = os.environ["CAP"]
NAMES = ["agentic_edit_nothink", "agentic_edit_think", "code_new"]
KS = [3, 7, 15]

def load(name):
    with safe_open(os.path.join(CAP, name + ".safetensors"), framework="pt") as f:
        meta = f.metadata() or {}
        tokens = [int(t) for t in f.get_tensor("tokens").tolist()]
    return tokens, int(meta["prompt_len"])

def tokens_per_round(tokens, P, K):
    gen = tokens[P:]
    lk = LookupDraft("cap", tokens[:P], max_proposals=K)
    i = blocks = committed = 0
    while i < len(gen):
        draft = lk.propose("cap", min(K, len(gen) - i))
        acc = 0
        for j, t in enumerate(draft):
            if i + j < len(gen) and gen[i + j] == t:
                acc += 1
            else:
                break
        step = min(acc + 1, len(gen) - i)
        lk.commit("cap", gen[i:i + step])
        committed += step
        blocks += 1
        i += step
    return round(committed / blocks, 3), blocks

out = {}
for name in NAMES:
    tokens, P = load(name)
    out[name] = {"prompt_len": P, "gen": len(tokens) - P}
    for K in KS:
        tpr, blocks = tokens_per_round(tokens, P, K)
        out[name][f"K{K}"] = {"tokens_per_round": tpr, "blocks": blocks}
print(json.dumps({"bar_B4_4k_mtp_committed_per_iter": 1.599, "results": out}, indent=2))
END
Host accept curve only. No device, no mesh, no /tokenize. This is the command for the pickup above. Do not open a DFlash2 issue: that host oracle is already measured and is the same class as DSpark. **Bar (served MTP, not a host drafter).** LEDGER `R-2026-10-03-gdc-cpk`, arm `…-csplit-t0-gdc-cpk`: accept_rate 0.599 at B4/4k and 0.546 at B1/32k, identical on both arms of that A/B. `accept_rate()` is mean accepted draft tokens per iteration; committed tokens/iter is that plus 1 (`bench/mtp/overlay/models/demos/blackhole/qwen36/tt/spec_decode.py`). So the current MTP accept is **1.599 tokens/iter at B4/4k** and **1.546 at B1/32k**. K by bucket `8:2,4:3,2:3,1:3` is already shipped (`R-2026-10-01-mtp-warm-kb`). c69d is not the gate. **Already measured. Not this run.** - DSpark host oracle, LEDGER `R-2026-09-25-dspark-tc`: **3.00 / 3.95 / 4.43** tokens/round at K=3/7/15 on ThinkingCap (`bench/runs/dspark-tc-accept-thinkingcap-20260925.jsonl`). - DFlash2 host oracle, #66 comment 2026-10-01 and `docs/PERF-LOOP-SYNTHESIS.md`: **3.05 / 4.04 / 4.34** at K=3/7/15 (`bench/runs/dflash2-accept-thinkingcap-20260930T164522Z.jsonl`). Longer host K is that K=15 column. It is not a new experiment. - Lookup alone, `bench/runs/lookup-draft-acceptance-20260919T0400Z.jsonl`: 1.16-1.41 committed/block on free-running text (no headroom versus 1.599) and 12.21 on a synthetic 5% line-edit. The record says that edit is synthetic. It is not the pass. - #139 stays a desk fix (`traced_proposals_equal_eager` false; mesh hop crash). #66: do not rerun K=7 at k_chunk 128 or 256. #133: dv32k stays parked. **Next.** Replay ngram proposals from `bench/harness/spec/lookup_draft.py` (`LookupDraft`) on the existing ThinkingCap capture tapes. Token ids are already in the safetensors (`bench/runs/dspark-tc-capture-20260924T195053Z.jsonl`, dir `/var/lib/models/dspark-tc/capture-thinkingcap-20260924T195053Z`). Split **real edit** (`agentic_edit_nothink`, `agentic_edit_think`) from **new code** (`code_new`). Greedy prefix accept against the captured continuation. Primary K=3, because that is the shipped B4 bucket; also report K=7 and K=15. **Pass:** real-edit tokens/round above **1.599**, with `code_new` reported beside it. **Fail:** no headroom on the edit tapes, or the only gain is the synthetic 12.21 ladder. No device port until that number exists. ```bash # host only. CAP is the capture dir above. No docker, no card. cd /path/to/tt-stack CAP=/var/lib/models/dspark-tc/capture-thinkingcap-20260924T195053Z \ python3 - << 'END' import json, os from safetensors import safe_open from bench.harness.spec.lookup_draft import LookupDraft CAP = os.environ["CAP"] NAMES = ["agentic_edit_nothink", "agentic_edit_think", "code_new"] KS = [3, 7, 15] def load(name): with safe_open(os.path.join(CAP, name + ".safetensors"), framework="pt") as f: meta = f.metadata() or {} tokens = [int(t) for t in f.get_tensor("tokens").tolist()] return tokens, int(meta["prompt_len"]) def tokens_per_round(tokens, P, K): gen = tokens[P:] lk = LookupDraft("cap", tokens[:P], max_proposals=K) i = blocks = committed = 0 while i < len(gen): draft = lk.propose("cap", min(K, len(gen) - i)) acc = 0 for j, t in enumerate(draft): if i + j < len(gen) and gen[i + j] == t: acc += 1 else: break step = min(acc + 1, len(gen) - i) lk.commit("cap", gen[i:i + step]) committed += step blocks += 1 i += step return round(committed / blocks, 3), blocks out = {} for name in NAMES: tokens, P = load(name) out[name] = {"prompt_len": P, "gen": len(tokens) - P} for K in KS: tpr, blocks = tokens_per_round(tokens, P, K) out[name][f"K{K}"] = {"tokens_per_round": tpr, "blocks": blocks} print(json.dumps({"bar_B4_4k_mtp_committed_per_iter": 1.599, "results": out}, indent=2)) END ```
Author
Member

Grill: lookup-mix drafter (host prompt-lookup + MTP fallback). Offline oracle on the LC0 captures

Desk only: no cards and no implementation PR yet. This is the "measure first" step this issue asked for: host prompt-lookup + MTP on real served greedy output. I checked for a duplicate issue; this one is the lookup lane, so the grill goes here instead of a new issue. Related: #212 (LC0 / long context), #190 (DSpark K 3/5/7), #213 (metal #59957, K by batch), #191 (verify T cap 4 to 16), #139 (adaptive K).

Data

  • Captures. The LC0 run on CONTROL …-dx-w2t-b8k3-cph48 (#219, run 7539, artifact 631). 72 cell requests: B1, B4 and B8 at 32k, 64k and 128k, 8 per cell. Each has the served greedy output ids (~1024) and the per-step MTP m/nd.
  • Prompts. Rebuilt bit-exactly from agent-corpus-v1 + cut_chars. Every capture joins to exactly one prompt at a constant +11 chat-template tokens.
  • Kinds.
    • edit: 27 requests. A full-file rewrite; no <|im_end|> inside 1024 tokens.
    • analyse: 27. The answer is one tool call, typically 70–143 tokens.
    • new: 18.
  • ANSWER corpus. The ids before the first <|im_end|> (248046). This drops the ignore_eos tail. All contexts are included.

Method (replay; greedy output is fixed, so any drafter policy can be replayed)

  • Lookup proposals are exact. Find the latest earlier occurrence of the last 3 ids in prompt+output, extend backwards to get the match length ℓ, and propose up to K of the ids that followed it.
  • MTP at a served step anchor is exact (the served m).
  • MTP at an off-anchor position is approximated, pessimistically. After a lookup step moves the boundary, MTP is credited only with the rest of the served run that covers that position, min(3, e_j+m_j−e). This affects 1–9% of steps.
  • Step time (ms per batch step).
    • Base, from LC0 CONTROL at 32k (TG ms/tok × tokens/row-step, measured): B1 40.13, B4 46.75, B8 55.60.
    • Extra cost per draft token above K=3, from #191 dx→dx-k5b1 at 32k: B1 +2.86 ms/K, B4 +3.28 ms/K. That slope includes the extra MTP draft steps, so it is an upper bound. The lower bound treats the wider verify as free.
    • At B4 the verify width pads to the widest row: p_any = 1−(1−p)^4.
    • K>5 is extrapolated; K=7 means T=8, a single SDPA fold program after #191.
    • Sanity check: the MTP-only estimate at B1 is 12.75 ms/tok, against 12.748 measured at 32k.
  • All TG values below are estimates, not measurements. Gains are per-user tok/s against MTP-only.

Results. ANSWER corpus, gate ℓ≥12; K=7 at B1/B4, K=3 at B8 (source swap only)

B kind MTP accepted/step MTP TG est ms/tok mix accepted/step lookup share of steps mix TG est, upper cost mix TG est, free verify
1 edit 2.30 12.17 5.33 66% 7.54 (+61%) 6.34 (+92%)
1 analyse 1.66 15.11 2.03 9% 13.57 (+11%) 13.24 (+14%)
1 new 2.22 12.48 2.44 8% 11.94 (+5%) 11.68 (+7%)
1 all 2.16 12.69 3.39 29% 9.90 (+28%) 9.15 (+39%)
4 edit 2.31 14.12 5.23 64% 9.58 (+47%) 7.51 (+88%)
4 analyse 1.63 17.77 2.00 9% 17.00 (+4%) 15.59 (+14%)
4 new 2.06 15.26 2.08 2% 15.45 (−1%) 15.17 (+1%)
4 all 2.11 15.05 3.20 26% 13.31 (+13%) 11.12 (+35%)
8 edit 2.31 16.78 2.75 69% 14.81 (+13%) =
8 analyse 1.64 21.08 1.78 12% 20.01 (+5%) =
8 new 2.12 17.82 2.10 4% 17.91 (−0%) =
8 all 2.13 17.78 2.35 37% 16.57 (+7%) =

Step 1 (swap only, K stays 3, no device change), ℓ≥12, upper cost:

B all edit analyse new
1 +7% (2.16→2.40 accepted/step) +14% +6% −0%
4 +7% +13% +5% −0%
8 +7% +13% +5% −0%

Gate sensitivity (B1, K=7, accepted/step):

ℓ ≥ all new
3 3.12 2.03 (below MTP's 2.22)
6 3.38 2.33
8 3.40 2.40
12 3.39 2.44
16 3.35 2.44
32 3.28 2.44
  • Results are flat for ℓ 6–16, so ℓ=8–12 is the pick.
  • Hysteresis (pause lookup after a lookup step accepts 0) changed nothing.

K (B1, ℓ≥12, accepted/step all / edit):

K all edit
3 2.40 2.77
5 2.93 3.95
7 3.39 5.33
11 3.91 7.51
15 4.26 9.72

Edit is capped by K (lookup accepts 6.9 of 7). K>7 needs T>8 (chunked SDPA), whose cost is unmeasured.

Lookup alone (no MTP), B1: edit 5.2 accepted/step, but analyse 0.48 and new 0.48 (76–81% of steps have no match). The MTP fallback is required, which matches the 2026-09-19 lookup record (1.16–1.41 on free-running text).

Proposed design (for grilling; not built)

  1. Host side, mtp_batch_host.plan().
    • Per row, keep an incremental 3-gram index over prompt+output ids. The plugin already has the prompt ids at prefill.
    • At plan time: if ℓ ≥ L (env, default 12), the row's drafts come from the history. Otherwise MTP drafts as today.
    • Output stays exact: verify is unchanged, exact greedy.
  2. Step 1 PR: swap only at the bucket's K. No device or verify-width change, so the boot self-tests and the T set are unchanged. Estimated about +7% on this mix and +13–14% on edit, with new neutral.
  3. Step 2: per-row K for lookup rows up to 7 at B1–B4 (Bw·(K+1) ≤ 32, T ≤ 8). This needs a verify T chosen per step, plus boot self-test cells for each (T, Bw) served. B5–B8 stay at K=3.
  4. Gates.
    • Host unit tests for the index, the proposals, and the bit-exact output.
    • ttsim exactness.
    • Cards: LC0 agent corpus (needs #221's bench fix) plus the standard sweep32k on the equiv corpus as a no-regress check, where the gate should rarely fire.

Grill questions

  1. Workload realism. Our edit task is a full-file rewrite, which is the copy-heavy best case (66% of steps go to lookup). Real agents often edit with str_replace/diff tool calls. What mix should the bar use, and do we have any real agent traces to replay?
  2. Is step 1 worth a PR on its own? The estimate is +7% overall, +13–14% on edit, and it needs zero device change.
  3. Step 2 verify width at B2–B4 with mixed rows: pad to the widest row (every row pays) or make the decision once per bucket (all rows or none)?
  4. MTP state on lookup steps. Must the MTP head still run on lookup-drafted steps to keep its KV in sync? If its draft compute can be skipped on lookup rows, the cost model moves toward the "free verify" column.
  5. Sources and K policy. How should this compose with #213 (K=11 at B1–2 upstream), #190 (DSpark) and #139 (adaptive K)? Should the source be picked per row (lookup when ℓ is high, otherwise MTP or DSpark), and should K follow the match length?
  6. Does this replay pass this issue's bar ("real-text accept gain vs MTP, not synth")? The caveats: MTP off-anchor is pessimistic on 1–9% of steps, the cost slope is extrapolated past K=5, and the task framing is our corpus, though the outputs are the served model's real greedy ids.
  7. No-regress on prose. There are no id captures on the equiv corpus yet. Should the first card run with #221 also capture an equiv sweep so this oracle can be rerun there?

Scripts live on the shared box under /workspace/lc0/: join.py, gate.py, sim.py and report.py, plus the lookup.py prototype.

## Grill: lookup-mix drafter (host prompt-lookup + MTP fallback). Offline oracle on the LC0 captures Desk only: no cards and no implementation PR yet. This is the "measure first" step this issue asked for: host prompt-lookup + MTP on real served greedy output. I checked for a duplicate issue; this one is the lookup lane, so the grill goes here instead of a new issue. Related: #212 (LC0 / long context), #190 (DSpark K 3/5/7), #213 (metal #59957, K by batch), #191 (verify T cap 4 to 16), #139 (adaptive K). ### Data - **Captures.** The LC0 run on CONTROL `…-dx-w2t-b8k3-cph48` (#219, run 7539, artifact 631). 72 cell requests: B1, B4 and B8 at 32k, 64k and 128k, 8 per cell. Each has the served greedy output ids (~1024) and the per-step MTP `m`/`nd`. - **Prompts.** Rebuilt bit-exactly from `agent-corpus-v1` + `cut_chars`. Every capture joins to exactly one prompt at a constant +11 chat-template tokens. - **Kinds.** - edit: 27 requests. A full-file rewrite; no `<|im_end|>` inside 1024 tokens. - analyse: 27. The answer is one tool call, typically 70–143 tokens. - new: 18. - **ANSWER corpus.** The ids before the first `<|im_end|>` (248046). This drops the ignore_eos tail. All contexts are included. ### Method (replay; greedy output is fixed, so any drafter policy can be replayed) - **Lookup proposals are exact.** Find the latest earlier occurrence of the last 3 ids in prompt+output, extend backwards to get the match length ℓ, and propose up to K of the ids that followed it. - **MTP at a served step anchor is exact** (the served `m`). - **MTP at an off-anchor position is approximated, pessimistically.** After a lookup step moves the boundary, MTP is credited only with the rest of the served run that covers that position, `min(3, e_j+m_j−e)`. This affects 1–9% of steps. - **Step time (ms per batch step).** - Base, from LC0 CONTROL at 32k (TG ms/tok × tokens/row-step, measured): B1 40.13, B4 46.75, B8 55.60. - Extra cost per draft token above K=3, from #191 `dx`→`dx-k5b1` at 32k: B1 +2.86 ms/K, B4 +3.28 ms/K. That slope includes the extra MTP draft steps, so it is an **upper bound**. The **lower bound** treats the wider verify as free. - At B4 the verify width pads to the widest row: p_any = 1−(1−p)^4. - K>5 is extrapolated; K=7 means T=8, a single SDPA fold program after #191. - Sanity check: the MTP-only estimate at B1 is 12.75 ms/tok, against 12.748 measured at 32k. - **All TG values below are estimates, not measurements.** Gains are per-user tok/s against MTP-only. ### Results. ANSWER corpus, gate ℓ≥12; K=7 at B1/B4, K=3 at B8 (source swap only) | B | kind | MTP accepted/step | MTP TG est ms/tok | mix accepted/step | lookup share of steps | mix TG est, upper cost | mix TG est, free verify | |---|---|---|---|---|---|---|---| | 1 | edit | 2.30 | 12.17 | 5.33 | 66% | 7.54 (+61%) | 6.34 (+92%) | | 1 | analyse | 1.66 | 15.11 | 2.03 | 9% | 13.57 (+11%) | 13.24 (+14%) | | 1 | new | 2.22 | 12.48 | 2.44 | 8% | 11.94 (+5%) | 11.68 (+7%) | | 1 | all | 2.16 | 12.69 | 3.39 | 29% | 9.90 (+28%) | 9.15 (+39%) | | 4 | edit | 2.31 | 14.12 | 5.23 | 64% | 9.58 (+47%) | 7.51 (+88%) | | 4 | analyse | 1.63 | 17.77 | 2.00 | 9% | 17.00 (+4%) | 15.59 (+14%) | | 4 | new | 2.06 | 15.26 | 2.08 | 2% | 15.45 (−1%) | 15.17 (+1%) | | 4 | all | 2.11 | 15.05 | 3.20 | 26% | 13.31 (+13%) | 11.12 (+35%) | | 8 | edit | 2.31 | 16.78 | 2.75 | 69% | 14.81 (+13%) | = | | 8 | analyse | 1.64 | 21.08 | 1.78 | 12% | 20.01 (+5%) | = | | 8 | new | 2.12 | 17.82 | 2.10 | 4% | 17.91 (−0%) | = | | 8 | all | 2.13 | 17.78 | 2.35 | 37% | 16.57 (+7%) | = | **Step 1 (swap only, K stays 3, no device change), ℓ≥12, upper cost:** | B | all | edit | analyse | new | |---|---|---|---|---| | 1 | +7% (2.16→2.40 accepted/step) | +14% | +6% | −0% | | 4 | +7% | +13% | +5% | −0% | | 8 | +7% | +13% | +5% | −0% | **Gate sensitivity (B1, K=7, accepted/step):** | ℓ ≥ | all | new | |---|---|---| | 3 | 3.12 | 2.03 (below MTP's 2.22) | | 6 | 3.38 | 2.33 | | 8 | 3.40 | 2.40 | | 12 | 3.39 | 2.44 | | 16 | 3.35 | 2.44 | | 32 | 3.28 | 2.44 | - Results are flat for ℓ 6–16, so ℓ=8–12 is the pick. - Hysteresis (pause lookup after a lookup step accepts 0) changed nothing. **K (B1, ℓ≥12, accepted/step all / edit):** | K | all | edit | |---|---|---| | 3 | 2.40 | 2.77 | | 5 | 2.93 | 3.95 | | 7 | 3.39 | 5.33 | | 11 | 3.91 | 7.51 | | 15 | 4.26 | 9.72 | Edit is capped by K (lookup accepts 6.9 of 7). K>7 needs T>8 (chunked SDPA), whose cost is unmeasured. **Lookup alone (no MTP), B1:** edit 5.2 accepted/step, but analyse 0.48 and new 0.48 (76–81% of steps have no match). The MTP fallback is required, which matches the 2026-09-19 lookup record (1.16–1.41 on free-running text). ### Proposed design (for grilling; not built) 1. **Host side, `mtp_batch_host.plan()`.** - Per row, keep an incremental 3-gram index over prompt+output ids. The plugin already has the prompt ids at prefill. - At plan time: if ℓ ≥ L (env, default 12), the row's drafts come from the history. Otherwise MTP drafts as today. - Output stays exact: verify is unchanged, exact greedy. 2. **Step 1 PR: swap only at the bucket's K.** No device or verify-width change, so the boot self-tests and the T set are unchanged. Estimated about +7% on this mix and +13–14% on edit, with new neutral. 3. **Step 2: per-row K for lookup rows up to 7 at B1–B4** (Bw·(K+1) ≤ 32, T ≤ 8). This needs a verify T chosen per step, plus boot self-test cells for each (T, Bw) served. B5–B8 stay at K=3. 4. **Gates.** - Host unit tests for the index, the proposals, and the bit-exact output. - ttsim exactness. - Cards: LC0 agent corpus (needs #221's bench fix) plus the standard sweep32k on the equiv corpus as a no-regress check, where the gate should rarely fire. ### Grill questions 1. **Workload realism.** Our edit task is a full-file rewrite, which is the copy-heavy best case (66% of steps go to lookup). Real agents often edit with str_replace/diff tool calls. What mix should the bar use, and do we have any real agent traces to replay? 2. **Is step 1 worth a PR on its own?** The estimate is +7% overall, +13–14% on edit, and it needs zero device change. 3. **Step 2 verify width at B2–B4 with mixed rows:** pad to the widest row (every row pays) or make the decision once per bucket (all rows or none)? 4. **MTP state on lookup steps.** Must the MTP head still run on lookup-drafted steps to keep its KV in sync? If its draft compute can be skipped on lookup rows, the cost model moves toward the "free verify" column. 5. **Sources and K policy.** How should this compose with #213 (K=11 at B1–2 upstream), #190 (DSpark) and #139 (adaptive K)? Should the source be picked per row (lookup when ℓ is high, otherwise MTP or DSpark), and should K follow the match length? 6. **Does this replay pass this issue's bar** ("real-text accept gain vs MTP, not synth")? The caveats: MTP off-anchor is pessimistic on 1–9% of steps, the cost slope is extrapolated past K=5, and the task framing is our corpus, though the outputs are the served model's real greedy ids. 7. **No-regress on prose.** There are no id captures on the equiv corpus yet. Should the first card run with #221 also capture an equiv sweep so this oracle can be rerun there? Scripts live on the shared box under `/workspace/lc0/`: `join.py`, `gate.py`, `sim.py` and `report.py`, plus the `lookup.py` prototype.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

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