Skip to content

minimax_m3 metal: the DFlash2 and DSpark drafters hold up to eight streams' blocks in one pass and one wait - #3121

Merged
ashhart merged 3 commits into
mainfrom
lead/minimax-hold-batch
Nov 21, 2026
Merged

ashhart merged 3 commits into
mainfrom
lead/minimax-hold-batch

Conversation

@ashhart

@ashhart ashhart commented Nov 13, 2026

Copy link
Copy Markdown
Owner

MiniMax-M3's DFlash2 and DSpark drafters on Metal now hold up to eight streams' blocks in one pass and one wait, instead of a pass per stream. Eight is the default lane count, and 64 rows stays inside one row tile of the matrix kernel, so each weight is read once. A row's drafts don't depend on the other rows in the pass (same pipeline and row tile at every count, per-row norms and top-k, the convolution stays inside a block), so drafted replies are unchanged. Absorb no longer waits: its command buffer keeps its buffers alive, and the next hold, the next absorb and deinit wait for it first.

Tests: test-minimax-m3-hold-host 2/2 (layout); lane regressions 363 pass, 1 skip.

Device check pending (M5): DFlash2 and MINIMAX_DRAFTER=dspark at 1, 2, 4 and 8 streams with bench_concurrent.py --alone --serial, replies equal to plain decode, acceptance per round equal to main's, and an A/B at 8 streams.

…reams' blocks in one pass and one wait

Both drafters report batched holds, so a shared round's streams reach hold together. A pass stacks up to eight
streams' blocks (64 rows, one row tile of the tensor-unit product, so each weight is read once): the embedding, norms,
projections, the head, DFlash2's convolution and top-k and DSpark's SwiGLU run over every row at once, and each
block's attention, DFlash2 walk and DSpark Markov steps run at its own row offset. The DFlash2 head now projects every
row and leaves each block's row 0 unread. Absorb commits without waiting; the next hold or absorb, and deinit, settle
it first and report its failure.

A row's bits do not depend on the other rows (one affine_mm pipeline and 64-row tile at every count, per-row norms
and kernels, the convolution within a block), so each stream's drafts are its single hold's, and verification keeps
every token as before.

test-minimax-m3-hold-host: a two-stream pass's ids are the two single holds' ids block after block, blocks and
sequence slots never overlap, and 17 streams take passes of 8, 8 and 1.
@ashhart
ashhart force-pushed the lead/minimax-hold-batch branch from 899fdcc to 8157327 Compare November 21, 2026 04:03
@ashhart
ashhart merged commit 68421e3 into main Nov 21, 2026
2 of 10 checks passed
@ashhart
ashhart deleted the lead/minimax-hold-batch branch November 21, 2026 04:03
ashhart added a commit that referenced this pull request Nov 21, 2026
ashhart added a commit that referenced this pull request Nov 21, 2026
ashhart added a commit that referenced this pull request Nov 21, 2026
ashhart added a commit that referenced this pull request Nov 21, 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