Archived
sched: --draft-suffix on, SuffixDecoding as a step selector on the MTP chain
After each commit the scheduler looks in the sequence's own prompt and output for the latest earlier occurrence of its last --draft-suffix-min-match tokens; the next step then verifies what followed it (up to --draft-suffix-max rows, cut where the product of the follower frequencies falls under --draft-suffix-min-score) in place of the head's draft. The verify window becomes the larger of the two while the head keeps its own rounds. A sequence whose history ended in a recurring pattern is not issued ahead, since the step is built after the commit where the lookup can read the committed end. It works with the fixed MTP chain, with --draft-depth adaptive and with --draft-verify traversal. A suffix chain carries no coupled row (Request::draft_suffix): the sampler binds none of the head's staged states to its rows, so each row is the target's plain draw and the rows are leaves of the traversal walk; mtp_rrs_test checks the law with a negative control that fails. --draft-verify block is refused. The window is at most 7 rows on Flash-Next (the delta-net fold's register window). On Flash-Next IQR-V4 (TP2) on our branch, window 7 on chain 3 with coupling: +1.4% overall, +2.9% on repetitive tasks, +11% on quoting, free chat unchanged; beside adaptive depth +0.2% [-1.0, +1.5] overall, code +1.0%. Off by default. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
e78d484e60
commit
b8bca7885a
22 files changed
+1112
-9
No files matched your search
@@ -127,6 +127,8 @@ inline SchedMetrics bridge_metrics(const rad::SchedMetrics& m) {
|
||||
o.draft_refills = m.draft_refills; o.draft_refill_tokens = m.draft_refill_tokens;
|
||||
o.lookup_proposals = m.lookup_proposals; o.lookup_held = m.lookup_held;
|
||||
o.lookup_held_drafts = m.lookup_held_drafts; o.lookup_held_hits = m.lookup_held_hits;
|
||||
o.suffix_steps = m.suffix_steps; o.suffix_rows = m.suffix_rows;
|
||||
o.suffix_accepted = m.suffix_accepted; o.suffix_held_ahead = m.suffix_held_ahead;
|
||||
o.linear_hit_rate = m.linear_hit_rate;
|
||||
o.attn_cached_tokens = m.attn_cached_tokens;
|
||||
o.linear_cached_tokens = m.linear_cached_tokens;
|
||||
|
||||
@@ -116,6 +116,12 @@ struct SchedMetrics {
|
||||
int64_t lookup_held = 0;
|
||||
int64_t lookup_held_drafts = 0;
|
||||
int64_t lookup_held_hits = 0;
|
||||
/* --draft-suffix: verifies that carried a suffix chain, their rows and accepted drafts, and the
|
||||
* decode steps kept from being issued ahead by a recurring pattern. */
|
||||
int64_t suffix_steps = 0;
|
||||
int64_t suffix_rows = 0;
|
||||
int64_t suffix_accepted = 0;
|
||||
int64_t suffix_held_ahead = 0;
|
||||
/* Per-position draft acceptance. The pooled `draft_acceptance` cannot tell a drafter that
|
||||
* decays with depth from one whose later rounds are broken. Per position j: verifies that
|
||||
* reached j (every earlier position accepted) and how many of those took j. */
|
||||
|
||||
@@ -200,6 +200,10 @@ void Metrics::sample(const SchedMetrics& m) {
|
||||
c_lookup_held_.advance_to(m.lookup_held);
|
||||
c_lookup_held_drafts_.advance_to(m.lookup_held_drafts);
|
||||
c_lookup_held_hits_.advance_to(m.lookup_held_hits);
|
||||
c_suffix_steps_.advance_to(m.suffix_steps);
|
||||
c_suffix_rows_.advance_to(m.suffix_rows);
|
||||
c_suffix_accepted_.advance_to(m.suffix_accepted);
|
||||
c_suffix_held_ahead_.advance_to(m.suffix_held_ahead);
|
||||
c_attn_cached_.advance_to(m.attn_cached_tokens);
|
||||
c_linear_cached_.advance_to(m.linear_cached_tokens);
|
||||
c_prefix_queries_.advance_to(m.prefix_queries);
|
||||
@@ -474,6 +478,16 @@ std::string Metrics::render() const {
|
||||
"Of the held-back proposals scored against the text that followed, the drafts "
|
||||
"that came true: what verifying them would have accepted.",
|
||||
L, c_lookup_held_hits_.get());
|
||||
w.counter("radiance:suffix_steps_total",
|
||||
"Verify steps that carried a --draft-suffix chain of the sequence's own history.",
|
||||
L, c_suffix_steps_.get());
|
||||
w.counter("radiance:suffix_rows_total",
|
||||
"Draft rows those suffix steps verified.", L, c_suffix_rows_.get());
|
||||
w.counter("radiance:suffix_accepted_total",
|
||||
"Of those rows, the drafts accepted.", L, c_suffix_accepted_.get());
|
||||
w.counter("radiance:suffix_held_ahead_total",
|
||||
"Decode steps not issued ahead of the previous commit because the sequence's "
|
||||
"history ended in a recurring pattern (--draft-suffix).", L, c_suffix_held_ahead_.get());
|
||||
|
||||
/* Decoupled prefix caching (spec §7.3). vllm:gpu_prefix_cache_hit_rate is the attention hit
|
||||
* rate, as in vLLM. The linear side hits at a different granularity (whole checkpoints, not
|
||||
|
||||
@@ -158,6 +158,7 @@ private:
|
||||
Counter c_prefill_tokens_, c_decode_tokens_, c_draft_tokens_, c_draft_accepted_;
|
||||
Counter c_draft_refills_, c_draft_refill_tokens_;
|
||||
Counter c_lookup_proposals_, c_lookup_held_, c_lookup_held_drafts_, c_lookup_held_hits_;
|
||||
Counter c_suffix_steps_, c_suffix_rows_, c_suffix_accepted_, c_suffix_held_ahead_;
|
||||
Counter c_attn_cached_, c_linear_cached_, c_checkpoints_;
|
||||
Counter c_prefix_queries_;
|
||||
Counter c_prefix_evict_, c_prefix_ckpt_evict_;
|
||||
|
||||
Reference in new issue
Block a user