engine: a block drafter on the card's acceptance -- its passes queued behind the step, the next step issued ahead

A block drafter (DFlash) ran its two passes after the commit, staged from the committed sequence:
the verify, a host wait and the commit, the context and query passes, a second host wait for the
proposals, then the next step's build and issue, with the cards idle through each host turn and
the ranks starting every pass at different times. Pipelining was off for block drafters.

It now takes the serial drafters' path (sched/advance.h). After the trunk's ranks join, the
acceptance runs on every rank (ADV_ACCEPT). block_begin runs before the commit (on_card): the
context pass mirrors the trunk step, whose positions the host knows (a row issued ahead continued
from the committed end, as commit() reads it); the query block's rows are device rows staged at
the furthest anchor acceptance could leave, with the KV reservation that far, and ADV_BLOCK puts
the anchor (the token the verify chose) and the masks at the card's committed end. After the
query pass, ADV_BTAKE takes the proposals into each StepSlot behind the anchor, which is the token
row the next verify reads (ADV_TRUNK), so issue_ahead verifies them with no host round trip. The
slots come back with the step's one readback; finish_block_drafter checks the card's acceptance
against the host's, as the serial driver does, publishes the proposals and moves the drafter's
filled range.

RADIANCE_DRAFT_BLOCK_HOST=1 keeps the host's driver, for the A/B, and has a row in GUIDE.md's
environment table. On libref with the tiny 31B-shaped checkpoint (and one doctored so its drafter
is right part of the time) the two drivers give the same replies, the same draft acceptance and
the same sampled text, and greedy matches plain decoding. sched_test runs 24 pipelined steps
against the host's driver: the same trunk steps and the same context and query passes, positions,
lengths and slots (the context pass's token ids aside, which that pass does not read);
advance_test covers the two modes and the chain.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
AshlynandClaude Opus 5.5 authored and StillDeadcode committed 2026-10-21 09:48:51 +02:00
1 parent 015cba8837
commit cb5a69ac3f
11 files changed
+508 -55

No files matched your search

+3 -1
View File
@@ -1183,7 +1183,9 @@ core.
**Kind is a shape, not a model.** `RAD_DRAFT_SERIAL` runs `depth` dependent passes, each embedding
what the last proposed. `RAD_DRAFT_BLOCK` runs a context pass, then one pass that fills every
drafted position. MTP and EAGLE-style heads are serial; block-diffusion drafters (DFlash2, DSpark)
are block.
are block. Both run on the card's acceptance (`core/sched/advance.h`): the verify's acceptance, the
positions of every pass after it and the proposals stay on the card, so a step's passes and the
next step are issued before the step is read back, and the host's commit runs beside the card.
Separate draft models are not supported; a drafter is part of the model's source.
`rad-convert --draft-model` merges a drafter that ships as its own repository into the container