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:
Code000andPi authored and StillDeadcode committed 2026-10-29 16:23:28 +01:00
1 parent 9093bf618e
commit ed1e5caf9d
16 files changed
+214 -8

No files matched your search

+6
View File
@@ -315,6 +315,12 @@ private:
* Written by the scheduler thread while the ranks are parked, read by them during the step,
* consumed by collect_step. */
std::vector<std::pair<int32_t, TokenScores*>> score_rows_;
/* A scored step (RadBatch::score_only): the plugin ran no lm_head, and the candidates' logits
* come from the hidden rows and the head table's rows at `score_ids_` (every scored row's
* candidates, sorted and unique), both read back into `score_host`. */
bool score_only_ = false;
std::vector<int32_t> score_ids_;
int64_t score_embd_ = 0;
int stage_scored_rows(const StepPlan& plan, const StepOut& so);
int issue_scored_rows(Rank& r);
int collect_scored_rows();