Archived
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:
1 parent
015cba8837
commit
cb5a69ac3f
11 files changed
+508
-55
No files matched your search
@@ -159,6 +159,23 @@ RAD_ADV_FN void adv_row(const AdvanceArgs& a, int i) {
|
||||
case ADV_TAKE:
|
||||
S.tok[a.round] = a.src[(int64_t)i * a.src_pitch];
|
||||
return;
|
||||
case ADV_BLOCK: {
|
||||
/* A block drafter's query row: the anchor (the token the verify just chose) at the
|
||||
* committed end, where the next verify starts, then `aux`, the mask id, at every position
|
||||
* after it. The host staged the furthest the anchor can be. */
|
||||
const int32_t base = S.ctx;
|
||||
tok[k] = S.tok[0];
|
||||
for (int32_t j = 1; j < n; ++j) tok[k + j] = aux;
|
||||
for (int32_t j = 0; j < n; ++j) adv_pos(a, pos, k + j, base + j);
|
||||
ctx[i] = base;
|
||||
adv_groups(a, i, k, base, n);
|
||||
return;
|
||||
}
|
||||
case ADV_BTAKE:
|
||||
/* Row i is the query pass's i-th block, which is the i-th drafting sequence. */
|
||||
for (int32_t j = 0; j < a.round; ++j)
|
||||
S.tok[1 + j] = a.src[(int64_t)i * a.src_pitch + j];
|
||||
return;
|
||||
default:
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user