Skip to content

train 1120043259: #3249 #3772 #3438 (CI only) - #4154

Closed
ashhart wants to merge 8 commits into
mainfrom
lead/train-1120043259
Closed

ashhart wants to merge 8 commits into
mainfrom
lead/train-1120043259

Conversation

@ashhart

@ashhart ashhart commented Nov 20, 2026

Copy link
Copy Markdown
Owner

CI for a landing train: #3249 #3772 #3438 stacked on main in that order. Nothing merges from this PR: each PR above lands on its own once this tip is green, and this PR is then closed.

Bizuayeu and others added 8 commits November 20, 2026 04:33
GLM's load-time race summed the 2-, 4- and 8-row windows and one draft step of its classic and factored NVFP4 expert
forms, then ran every decode window on the winner. A sum hides the widths it loses: at TP=4 the factored form wins at
1 and 8 rows but loses at 4 and 6, so four streams without drafts decode about 2% slower than on classic.

Both forms give the same bits (the NVFP4 fact contract holds the factored tiles and waves to the decode form's sums),
so each window can take either. The race now times both forms at all ten widths, keeps classic at a width unless
factored is more than 1% faster there, and prices each width at its kept form's time instead of timing the table
again. A window runs on the form of the narrowest timed width that holds it: rank 0 sends the forms as a bit a row
count, and the record keeps a bit a width. Records carry the build's hash in their key, so no record of a single-form
build is read for its forms.

The race sweeps every width five times on both forms, untimed, before it times a window, then each width's timed
windows take the two forms in turn, classic first on even rounds and factored first on odd ones. Timed one form after
the other, the order picked the form: on four GB10s at TP=4 a log of every run showed classic's narrow widths up to
60% over their later time in a load's first 4 s, and a 4 to 6% drift through the race on one form, so two launches of
one build kept different forms at 3, 4, 6 and 12 rows. Five sweeps of both forms take about 5.4 s there.

TF_GLM_EXPERT_FORM now names one form for every width: the warm-up sweeps that form ten times and the load times the
windows and the draft step at it, and a load that times nothing sends it to every rank for every row count. The
startup line names one form when every width shares it, else the more common form and the widths where the other runs
(experts factored, classic at 4 and 6 rows).
flashnext_constraint_gate, structured/vision/video_served and xpu_draft_receipt need landed drafts, a plain arm
that drafts none, full token hashes and (Flash Next) seeds that differ; xpu_draft_receipt exits 1 on FAIL;
reuse_served's cancel must cut before the reply, be counted and leave the census idle and /health ok;
image_cache_turns needs a fresh side with 0 cached and a later turn resuming past a first turn's template tokens;
clef_head_gate compare needs logits for every question type; bench_concurrent names alone/serial counts that
compared nothing.
…usage

A request may name "deadline_s" (seconds, more than 0, at most 1000000), for
chat and legacy completions. At that time the server cancels the engine
itself, still commits the tokens the engine gives before its finished event,
and labels the reply finish_reason "deadline". The final response keeps
usage and token_ids/token_sha256. A token the engine gives after the
deadline cancel may be EOS, hit a stop string or reach max_tokens; the
reply still ends "deadline". A deadline that passes after the reply already
ended (a stop string's own cancel) is not counted. Without the field
nothing changes.

A cancel from POST /v1/requests/{id}/cancel that came first keeps the
reply "cancelled": the deadline then sends no second cancel and never
relabels it. docs/api.md lists the field.

test-request-deadline-host: through chat.run and through openai.run (chat
and completions, whole and streamed): a forced deadline ends the reply with
finish deadline, the late token, usage and ids; no field and a deadline the
reply never meets give the same reply, token sha and stream choices; 0, -1,
"300", true and 1e7 are refused before the engine. A cancel ask before the
deadline, with an engine that ends late, still ends "cancelled".
…adline passes while it drains

A slow client could still be writing out tokens the engine had already
finished with (stop or length) when deadline_s passed; the server then sent
a cancel to the finished request and labelled the whole reply "deadline".
Before marking a deadline, the read loop now checks the mailbox's finished
flag under the mailbox's own mutex: an engine that ended first keeps its
finish reason and gets no cancel.

test-request-deadline-host: the engine ends inside submit, before the
50 ms deadline, and the first stream write takes 100 ms: the reply ends
"stop" with abcde and no cancel is sent (chat.run); over HTTP, for chat and
completions, whole and streamed, a reply the engine ended before the
deadline and the server first reads after it keeps "stop".
@ashhart ashhart closed this Nov 20, 2026
@ashhart ashhart reopened this Nov 20, 2026
@ashhart

ashhart commented Nov 20, 2026

Copy link
Copy Markdown
Owner Author

Held: main is red.

@ashhart ashhart closed this Nov 20, 2026
@ashhart
ashhart deleted the lead/train-1120043259 branch November 20, 2026 07:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants