mtp so1 C-split: OVERLAP cc/cd, cd first (#149) #155

Closed
tenstorrent wants to merge 1 commit from mtp-so1-cplit into master
Member

Summary

Implements #149 Option A (grill-approved): under QWEN36_MTP_OVERLAP=1 + QWEN36_MTP_GDN_STATE_ONCE=1 (and not EARLY_RESEED), split the OVERLAP C path into:

  • cc = GDN commit only
  • cd = MTP KV reseed + K drafts

Enqueue cd first, then cc. The draft event is OVERLAP_TIMING wait_c; the commit event is waited in _ensure_committed() immediately before the next verify (or on non-steady drain / plain fallback). Hypothesis: so1's commit recompute (~+2.1–2.4 ms in wait_c vs cm-ot) can hide under draft/host so wait_c drops toward the cm band (~2.4 ms B8).

Same ops as the single C trace; cc and cd touch disjoint buffers (GDN state vs MTP head) → bit-exact intent. Not folding multi-layer commit (c156a: recompute-bound). so-t0 is a separate TG card, not this PR.

Closes nothing yet — needs card measure before merge claim.

Files

  • patches/.../tt/mtp_batch.py — capture, enqueue, drain / _ensure_committed
  • docs/MTP-BATCH.md — §12b row + §16f
  • tests/test_mtp_so1_cplit.py — predicate, source order, toy bit-exact schedule

Desk gates (run)

python3 -m unittest tests.test_mtp_so1_cplit tests.test_mtp_async tests.test_mtp_gdn_state_once tests.test_mtp_batch_host -q

All OK locally. ttsim = so1 kernel correctness only (sim_mtp_gdn_state_once.py); C-split is orchestration (no new kernel). Do not treat ttsim as a performance number. Wall / wait_c only from real ttx / Tracy on cards.

A desk model of wait_c from measured so1-ot phase splits could rank C-split variants without a card; not built in this PR.

Measure plan (needs card window) — see #149 grill

  1. ot screen (diagnostic, not a speed number): …-cm-so1-ot (or equivalent with this tree) vs prior so1-ot / cm-ot — compare wait_c, prep, step total. Expect wait_c toward cm (~2.4 ms B8) if hide works; prep may absorb residual commit.
  2. Served A/B: cm-so1 with this C-split vs cm-so1 baseline (and cm) — wall / TG; no claim until measured.
  3. Equiv / must-fail banners unchanged (so1 self-test, BIT_EXACT vs plain).

Still needs a card window

  • OVERLAP_TIMING ot screen for wait_c / prep / total
  • Served A/B sweep
  • Optional Tracy confirm commit runs after draft event on CQ

Refs: #149, #144, c155 LEDGER, c156a synced split.

## Summary Implements **#149 Option A** (grill-approved): under `QWEN36_MTP_OVERLAP=1` + `QWEN36_MTP_GDN_STATE_ONCE=1` (and not `EARLY_RESEED`), split the OVERLAP C path into: - **cc** = GDN commit only - **cd** = MTP KV reseed + K drafts Enqueue **cd first**, then cc. The draft event is OVERLAP_TIMING `wait_c`; the commit event is waited in `_ensure_committed()` immediately before the next verify (or on non-steady drain / plain fallback). Hypothesis: so1's commit recompute (~+2.1–2.4 ms in wait_c vs cm-ot) can hide under draft/host so `wait_c` drops toward the cm band (~2.4 ms B8). Same ops as the single C trace; cc and cd touch disjoint buffers (GDN state vs MTP head) → **bit-exact** intent. Not folding multi-layer commit (c156a: recompute-bound). so-t0 is a separate TG card, not this PR. Closes nothing yet — needs card measure before merge claim. ## Files - `patches/.../tt/mtp_batch.py` — capture, enqueue, drain / `_ensure_committed` - `docs/MTP-BATCH.md` — §12b row + §16f - `tests/test_mtp_so1_cplit.py` — predicate, source order, toy bit-exact schedule ## Desk gates (run) ```text python3 -m unittest tests.test_mtp_so1_cplit tests.test_mtp_async tests.test_mtp_gdn_state_once tests.test_mtp_batch_host -q ``` All OK locally. **ttsim** = so1 kernel correctness only (`sim_mtp_gdn_state_once.py`); C-split is orchestration (no new kernel). **Do not** treat ttsim as a performance number. Wall / `wait_c` only from real **ttx / Tracy** on cards. A desk model of `wait_c` from measured so1-ot phase splits could rank C-split variants without a card; **not built** in this PR. ## Measure plan (needs card window) — see #149 grill 1. **ot screen** (diagnostic, not a speed number): `…-cm-so1-ot` (or equivalent with this tree) vs prior so1-ot / cm-ot — compare `wait_c`, prep, step total. Expect `wait_c` toward cm (~2.4 ms B8) if hide works; prep may absorb residual commit. 2. **Served A/B**: cm-so1 with this C-split vs cm-so1 baseline (and cm) — wall / TG; no claim until measured. 3. Equiv / must-fail banners unchanged (so1 self-test, BIT_EXACT vs plain). ## Still needs a card window - OVERLAP_TIMING ot screen for wait_c / prep / total - Served A/B sweep - Optional Tracy confirm commit runs after draft event on CQ Refs: #149, #144, c155 LEDGER, c156a synced split.
mtp so1 C-split: OVERLAP captures cc/cd, cd first (#149)
Some checks failed
tt-stack-ci / Report upstream drift (pull_request) Successful in 7s
tt-stack-ci / Build simulators and check the host module (pull_request) Failing after 13s
8ed60a0753
Under OVERLAP+STATE_ONCE (not EARLY_RESEED), C is captured as cc (GDN
commit) + cd (reseed+drafts). The overlap path enqueues cd first so
wait_c is the draft event; cc follows and is waited before the next
verify so host prep can hide the so1 commit recompute. Bit-exact:
disjoint buffers, same ops. Desk gates in test_mtp_so1_cplit; ttsim
stays CORRECTNESS_ONLY for so1 kernels. No served numbers claimed —
measure plan on #149 (ot screen, then served ab).
Owner

Hermes review

  • Verdict: approve
  • Base branch: master (tt-stack master — this is a Python model-orchestration PR, not a nixos-llm infra PR; the T2 gate / human-approved label from review-infra-mr don't apply here)
  • Tests: ran tests.test_mtp_so1_cplit — 4/4 OK (0.027s) via Nix python3.13 interpreter.
  • Flag: opt-in only (QWEN36_MTP_OVERLAP + QWEN36_MTP_GDN_STATE_ONCE + not EARLY_RESEED); no default behavior change.

Rationale: C-split captures C as cc (GDN commit) + cd (reseed+draft) on disjoint buffers. Executing cd before cc on the CQ reverses the single-C's internal commit→draft order, but that is safe — draft reads only verify outputs + plan-only rs_* inputs, never GDN commit state, and the deferred commit is synchronized before the next verify via commit_event/_ensure_committed(). Same ops, same buffers → bit-exact. No leak path on fallback/finish.

Concerns:

  • [nit] tests/test_mtp_so1_cplit.py — the toy mirrors real scheduling (deferred commit + drain), not the device ops; it proves the host schedule equivalence but is not a substitute for ttsim/real-card wait_c. Already stated in the PR body.
  • [nit] branch name mtp-so1-cplit is a typo (should be csplit); cosmetic, no action needed.
## Hermes review - **Verdict: approve** - Base branch: `master` (tt-stack master — this is a Python model-orchestration PR, not a nixos-llm infra PR; the T2 gate / `human-approved` label from review-infra-mr don't apply here) - Tests: ran `tests.test_mtp_so1_cplit` — 4/4 OK (0.027s) via Nix python3.13 interpreter. - Flag: opt-in only (`QWEN36_MTP_OVERLAP + QWEN36_MTP_GDN_STATE_ONCE + not EARLY_RESEED`); no default behavior change. **Rationale:** C-split captures C as cc (GDN commit) + cd (reseed+draft) on disjoint buffers. Executing cd before cc on the CQ reverses the single-C's internal commit→draft order, but that is safe — draft reads only verify outputs + plan-only rs_* inputs, never GDN commit state, and the deferred commit is synchronized before the next verify via `commit_event`/`_ensure_committed()`. Same ops, same buffers → bit-exact. No leak path on fallback/finish. **Concerns:** - [nit] `tests/test_mtp_so1_cplit.py` — the toy mirrors real scheduling (deferred commit + drain), not the device ops; it proves the *host* schedule equivalence but is not a substitute for ttsim/real-card `wait_c`. Already stated in the PR body. - [nit] branch name `mtp-so1-cplit` is a typo (should be `csplit`); cosmetic, no action needed.
Author
Member

Do not merge. Branch mtp-so1-cplit skips EARLY_RESEED and was inert on so1. The flag-gated port is already on master via #156.

Do not merge. Branch mtp-so1-cplit skips EARLY_RESEED and was inert on so1. The flag-gated port is already on master via #156.
Author
Member

Closing as superseded: inert on so1 (comment above, 2026-10-03), and the flag-gated port is already on master via #156. 208 behind, conflicts in docs/MTP-BATCH.md / mtp_batch.py. Triage 2026-10-09.

Closing as superseded: inert on so1 (comment above, 2026-10-03), and the flag-gated port is already on master via #156. 208 behind, conflicts in docs/MTP-BATCH.md / mtp_batch.py. Triage 2026-10-09.
tenstorrent closed this pull request 2026-10-09 10:54:02 +02:00
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.
Some checks failed
tt-stack-ci / Report upstream drift (pull_request) Successful in 7s
tt-stack-ci / Build simulators and check the host module (pull_request) Failing after 13s

Pull request closed

Sign in to join this conversation.
No reviewers
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!155
No description provided.