Skip to content

dsv41 metal: drafts behind the verify, Engram reads beside the first layers, threaded picks, same replies - #3404

Closed
ashhart wants to merge 3 commits into
mainfrom
lead/dsv41-early-drafts2
Closed

ashhart wants to merge 3 commits into
mainfrom
lead/dsv41-early-drafts2

Conversation

@ashhart

@ashhart ashhart commented Nov 15, 2026

Copy link
Copy Markdown
Owner

DeepSeek-V4.1 on Metal: host work comes off the round's critical path. Every reply is unchanged.

Changes:

  • A greedy window's next DSpark pass is queued right behind its verify, in one command buffer (picks, acceptance, ingest and pass). It is kept when the host's commit matches. A speculative ingest cut by a shorter commit now has its ring rows restored for every ingest, which also fixes the existing speculative path for sampled and multi-stream rounds. TF_DSV41_SPEC_DRAFT=0 turns both off.
  • A window's Engram reads start before its first layer runs. Each layer's rows are written just before the command buffer that reads them.
  • A window's sampled picks run one row per thread, each pick unchanged.
  • DSpark candidates skip any block of logits that can't beat the list's last entry; the list is unchanged.

Measured on an M5 Ultra on the release checkpoint (decode stack against this head):

Before After
16 prompts, greedy 91.8 tok/s 95.9 tok/s (+4.5%)
16 prompts, sampled 74.8 tok/s 80.3 tok/s (+7.4%)
Prose, greedy 68.6 tok/s 71.9 tok/s (+4.8%)
Prose, sampled 59.2 tok/s 63.0 tok/s (+6.4%)
  • Replies: 48/48 equal, run twice.
  • Tokens a round are the same, and a round takes 33.71 → 32.08 ms greedy and 34.94 → 32.87 ms sampled.

Tests:

  • Served test (i): chain off, on, and with every second chain forced to miss. Every reply equals serial with the same windows and drafted rows. A negative control with a wrong anchor fails it.
  • A drafter test: a window ingested before its commit and then cut leaves rings and drafts bit-equal to ingesting only the kept rows.
  • multi_test on the production per-buffer Engram path.
  • Threaded picks against single-row picks, and the candidates skip against the scalar list.
  • test-dsv41-metal, test-dsv41-metal-serve and test-dsv41-draft pass. Lean finds nothing new.

Stacked on the decode stack (#3376, which sits on #3296, #3292, #3288, #3287, #2983 and #2973). It lands after it.

  • Synthena (Ash's Agent)

Follow main f9df8bf (the Metal lane target and native server) and e19cf91 (the pick.zig split). Keep the current prompt geometry admission assertion when taking the threaded sampled-row delta; leave the split pick helpers and every caller in their maintained modules.
…d its verify (picks, acceptance, ingest and pass on the GPU) and kept when the host's commit matches; an ingest made before its window's commit is put back where the commit cuts it
@ashhart
ashhart force-pushed the lead/dsv41-early-drafts2 branch from 1950c4b to 520bc30 Compare November 21, 2026 21:24
@ashhart

ashhart commented Nov 23, 2026

Copy link
Copy Markdown
Owner Author

Closing this one: the regression test it adds is already on main in serve_early_test.zig.

  • Synthena

@ashhart ashhart closed this Nov 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant