MTP: truncated draft lm_head / MTP_DRAFT_VOCAB (portable amd-qwen borrow) #133

Closed
opened 2026-09-30 09:08:20 +02:00 by tenstorrent · 4 comments
Member

Parent / blocked-by tracking via #90 (amd-qwen / tinygrad borrow-adapt lane).

Grill call: GO (desk/harness first; no device until measure says so)

Hypothesis. Truncating the draft lm_head / draft vocab ids (MTP_DRAFT_VOCAB) so MTP scoring is not full-vocab every step cuts draft-step host/device cost without changing acceptance semantics when the truncated set covers the true draft candidates. Highest portable win from the amd-qwen / tinygrad AMD path; independent of RDNA microkernels.

Source. tinygrad / jacobrosenthal amd-qwen-on-master (AMD ROCm Qwen3.8). External — not TT silicon claims.

Depends on. Local MTP path (#82 / #63); desk harness that can score draft logits with a truncated vocab before any metal/vllm-tt port.

Measure first. Offline/host: same MTP draft sequence, full-vocab vs truncated draft vocab — wall for draft lm_head + top-k agree rate / accept-curve delta. Pass bar: material draft-step time cut with accept bits unchanged on a fixed corpus.

Out of scope. RDNA micro-opts; ngram-DFlash (see #98); device port until the desk measure shows headroom.

Refs: #90; related #82/#63 MTP; grill 2026-09-29/30 Tenstorrent amd-qwen eval.

Parent / blocked-by tracking via #90 (amd-qwen / tinygrad borrow-adapt lane). ## Grill call: **GO** (desk/harness first; no device until measure says so) **Hypothesis.** Truncating the draft `lm_head` / draft vocab ids (`MTP_DRAFT_VOCAB`) so MTP scoring is not full-vocab every step cuts draft-step host/device cost without changing acceptance semantics when the truncated set covers the true draft candidates. Highest portable win from the amd-qwen / tinygrad AMD path; independent of RDNA microkernels. **Source.** tinygrad / jacobrosenthal amd-qwen-on-master (AMD ROCm Qwen3.8). External — not TT silicon claims. **Depends on.** Local MTP path (#82 / #63); desk harness that can score draft logits with a truncated vocab before any metal/vllm-tt port. **Measure first.** Offline/host: same MTP draft sequence, full-vocab vs truncated draft vocab — wall for draft lm_head + top-k agree rate / accept-curve delta. Pass bar: material draft-step time cut with accept bits unchanged on a fixed corpus. **Out of scope.** RDNA micro-opts; ngram-DFlash (see #98); device port until the desk measure shows headroom. Refs: #90; related #82/#63 MTP; grill 2026-09-29/30 Tenstorrent amd-qwen eval.
Owner

Eval (2026-09-30): agree GO, but desk only for now. Card time comes after c115. Full write-up: docs/ISSUES-133-137-EVAL-2026-09-30.md.

  • Mechanism: each draft call reads the full 248k shared head, then does a sharded argmax with 2 CCLs (mtp_batch.py:221), which costs ~0.5 ms traced at B=8 (model.py:4480). Measured analogue: one ~31k-column bf8 chunk at M=8 takes 202-218 µs (bench/runs/perf-loop-c54-lmhead-probe-20260927T0700Z.jsonl).
  • Est: a 32k replicated bf4 draft head, with no argmax CCL, saves ~1 ms per draft call, or ≈ −3 ms per K=3 step (≈ −1.1 ms/token). That is ≈ −1.3% B8/32k and −2.0% B4/32k, but only if MTP at batch ever wins. It is still dead at B=4/8 (bench/runs/perf-loop-c69d-mtp-batch-verdict-20260927T1644Z.jsonl), so the gain today is 0.
  • Correctness: verify stays full-vocab, so the output is lossless; only acceptance can drop. The tier is near-tie because of the width trap.
  • Cheapest decisive experiment (0 card-h):
    1. Coverage bound: take the committed tokens from existing equiv/gsm8k/retrieval outputs, build a top-N set from a disjoint half, and measure coverage at N = 8k/16k/32k/64k.
    2. Then the host MTP oracle, full vs truncated vocab. Must-fail rung: N=1024 has to show a large drop in acceptance.
  • Kill if coverage is under 97% at N=64k. Promote at ≥99% coverage with N ≤ 32k. After that it is 0.5-1 day of Python (no C++) and rides on the MTP-at-batch A/B.
  • Priority: desk work can start now; nothing on card before c115.

🤖 Generated with Claude Code

**Eval (2026-09-30): agree GO, but desk only for now.** Card time comes after c115. Full write-up: `docs/ISSUES-133-137-EVAL-2026-09-30.md`. - **Mechanism:** each draft call reads the full 248k shared head, then does a sharded argmax with 2 CCLs (`mtp_batch.py:221`), which costs ~0.5 ms traced at B=8 (`model.py:4480`). Measured analogue: one ~31k-column bf8 chunk at M=8 takes 202-218 µs (`bench/runs/perf-loop-c54-lmhead-probe-20260927T0700Z.jsonl`). - **Est:** a 32k replicated bf4 draft head, with no argmax CCL, saves ~1 ms per draft call, or ≈ −3 ms per K=3 step (≈ −1.1 ms/token). That is ≈ −1.3% B8/32k and −2.0% B4/32k, **but only if MTP at batch ever wins**. It is still dead at B=4/8 (`bench/runs/perf-loop-c69d-mtp-batch-verdict-20260927T1644Z.jsonl`), so the gain today is 0. - **Correctness:** verify stays full-vocab, so the output is lossless; only acceptance can drop. The tier is near-tie because of the width trap. - **Cheapest decisive experiment (0 card-h):** 1. Coverage bound: take the committed tokens from existing equiv/gsm8k/retrieval outputs, build a top-N set from a disjoint half, and measure coverage at N = 8k/16k/32k/64k. 2. Then the host MTP oracle, full vs truncated vocab. Must-fail rung: N=1024 has to show a large drop in acceptance. - **Kill** if coverage is under 97% at N=64k. **Promote** at ≥99% coverage with N ≤ 32k. After that it is 0.5-1 day of Python (no C++) and rides on the MTP-at-batch A/B. - **Priority:** desk work can start now; nothing on card before c115. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Author
Member

dv32k is parked (R-2026-10-03-so-t0, B1/32k regression). The "still dead at c69d" comment is superseded. Do not rerun a 32k draft vocab.

dv32k is parked (R-2026-10-03-so-t0, B1/32k regression). The "still dead at c69d" comment is superseded. Do not rerun a 32k draft vocab.
Member

Shipped: QWEN36_MTP_DRAFT_VOCAB at 65536 is the served head (LEDGER R-2026-10-16-dv64k, +1.0…+6.3% TG/user 6/6 cells; banners verified in ship-cdr8g.toml). Verified 2026-11-18.

Shipped: QWEN36_MTP_DRAFT_VOCAB at 65536 is the served head (LEDGER R-2026-10-16-dv64k, +1.0…+6.3% TG/user 6/6 cells; banners verified in ship-cdr8g.toml). Verified 2026-11-18.
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.

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