Archived
core, abi: scored steps -- rad_declare_scores, RadBatch::score_only, and /v1/systemone's model
A scored request (Request::token_scores, what /v1/systemone asks: the raw logits at a few candidate ids) does not need the half-gigabyte lm_head read the sampler would consume. A plugin whose head is the bf16 embedding table declares the final-normed hidden rows and that table (rad_declare_scores); on a step whose sampled rows are all scored rows and whose program declared both, the core sets RadBatch::score_only, the plugin issues everything but the head, and the core reads the hidden rows and the candidates' table rows back and takes the dot products in f64 on the host. RadBatch gains one trailing int32 (score_only, 360), which the pass key mixes; an older plugin never sees it set. The scheduler issues no step ahead of one that brings a scored row to max_tokens: that forward pass reads nothing and a max_tokens=1 question would pay a decode step after its prefill. Scored rows only -- every other decode keeps the step of overlap it had. /v1/systemone reports which model answered. Co-Authored-By: Pi <pi@localhost>
This commit is contained in:
1 parent
9093bf618e
commit
ed1e5caf9d
16 files changed
+214
-8
No files matched your search
@@ -2103,6 +2103,12 @@ const RadBatch* Scheduler::step_next_locked() {
|
||||
* that cannot rewind decides at commit whether the next step may speculate; one that can,
|
||||
* or no grammar, keeps its answer. */
|
||||
if (!e.produces_token || !r.speculation_fixed) return nullptr;
|
||||
/* A SCORED row (Request::token_scores, a /v1/systemone question) that the step in flight
|
||||
* brings to max_tokens gets no step issued ahead: it would run a whole forward pass for a
|
||||
* request that finishes at the commit, and max_tokens=1 pays a decode step after its
|
||||
* prefill. Scored rows only -- every other decode keeps the step of overlap it had. */
|
||||
if (r.token_scores && r.max_tokens > 0 &&
|
||||
(int64_t)r.output.size() + 1 >= r.max_tokens) return nullptr;
|
||||
|
||||
/* The furthest context the row can reach: every position this step verifies committed,
|
||||
* counted from the last commit rather than this step's own bound (which would add a
|
||||
|
||||
Reference in new issue
Block a user