Skip to content

train 1116013308: #3474 #2837 #2888 #3383 #3494 #3496 (CI only) - #3497

Closed
ashhart wants to merge 68 commits into
mainfrom
lead/train-1116013308
Closed

ashhart wants to merge 68 commits into
mainfrom
lead/train-1116013308

Conversation

@ashhart

@ashhart ashhart commented Nov 16, 2026

Copy link
Copy Markdown
Owner

CI for a landing train: #3474 #2837 #2888 #3383 #3494 #3496 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.

ashhart and others added 30 commits November 15, 2026 22:48
A stream count's first all-plain trial pays one-off costs, and blending
each later trial a fifth of the way kept that slow sample in the plain
price for hundreds of rounds, so near-even drafts kept drafting. The
first trial is now a warm-up whose sample is dropped (the existing
allocator stays in charge until the next trial, `every` rounds on), and
each later trial replaces the plain point. Natural plain rounds still
blend as before; `due` is unchanged.
Off unless TF_SHARED_PRICE_LOG=1. A common-scope environment.zig row
refuses any other text by name when a server starts, and the lane core
reads it through the same parser at an engine's first priced shared
round, which then logs the load-time shared forward costs and head
steps. Each priced shared round after that logs one line: its trial
flag, rows, time, the forward's table time, each stream's verified
drafts and next depth, the plain and row prices the depths were chosen
by, and each stream's acceptance estimates. Nothing it logs feeds back
into a decision.
Keep the measured plain intercept while the row learner owns its signed slope.
Exercise both prices, the plain-width floor and all three measuring allocators.

Refs #2605.
#2687 made Engine.askDrafts public so shared_round.zig could call it,
and proposal_batch_host.zig refuses a public askDrafts at compile time
(draft internals must stay private). The engine now passes its private
draft call to shared_round.run instead.
…runs it

"a reply's end is born with its request's prompt" built its reply stream
without history_len, so keepEnd pinned nothing. Since a reply supersedes
equal-born states on its token path (e5f75e8), the request's own
history went first and the other conversation's state stayed: the test
failed, and no build step ran it. The served host names the history on
every request that keeps one, the pin 3487174 added; the test now does
too. test-qwen27-reply-cache-host runs it. Serving is unchanged.
… metrics (#2135)

Each queued request holds one wait reason, decided where the host last tried to admit it (pick, choose, a family planner's wait or skip, takeJob's ledger promise) and cleared on admission; publishing the ledger only counts the stored reasons and never asks the family's pool. The planner's Verdict carries the reason with its wait or skip, and DeepSeek-V4.1 names kv_pool, memory_floor or prefill_concurrent from its own counters, so the floor is never reported as memory_pressure.

/metrics gains requests_waiting_by_reason{reason} (all ten labels, summing to requests_waiting), request_failures_total{reason}, restore_fallbacks_total and request_refusals_total{reason}; /v1/load gains waiting_by_reason and refusals. Refusals are counted where the chat, embeddings, rerank and speech routes answer with a client code, and every reply's bytes are unchanged. Shape B as designed by devopsfortunato on #2196.

Co-authored-by: devopsfortunato <57877156+devopsfortunato@users.noreply.github.com>
…est, DeepSeek's mapping tested on the host (#2135)

request_refusals_total gains the admission flags' 429s under the code each reply carries (max_inflight_exceeded, max_inflight_per_key_exceeded, admission_capacity_exceeded, requests_per_second_exceeded), counted once at the request gate, and an images engine's busy 503 as engine_busy. request_failures_total is now always shown, the server's count beside the host's: the chat routes' 500 for a stale device is engine_stale, and a family planner's refusal, a failed reply with its own words and no code, is planner_refused.

A begin that reports its saved entry damaged and the pass that then reports the failed restore count one fallback: each request carries whether its fallback is counted. DeepSeek-V4.1's verdict mapping moves from sched_host.zig into sched_verdict.zig, which a new host step (test-dsv41-wait-reasons-host, in both nightly DeepSeek lists) drives through a real lane host round into the ledger. The docs say the stored reasons are as of the last admission attempt. Every reply's bytes are unchanged.
…2370)

TF_QWEN27_SLOT_RESUME, TF_QWEN27_METAL_KV_PAGES, TF_QWEN35_METAL_KV_PAGES,
TF_SLIDE_FIT_REDUCE, TF_SLIDE_TAKE_OUT_CHECK and TF_SLIDE_TAP_CHECK get
rows in platform/environment and are read through it, so a malformed
value is refused by name instead of read as a default. Unset or blank
keeps today's defaults: resume on, pages off, the ordered fit reduction,
both checks off. The two check switches move from on-when-set to exact
0 or 1. The two KV-page switches and the tree reduction get profile rows
(arithmetic until a token-hash run says otherwise), and the docs list the
six in the strict table.

Host tests: each switch's forms, blank as unset and named refusals,
valid-form coverage for the new rows, and profile-line reporting.
…rt (#2370)

TF_SLIDE_FIT_REDUCE leaves this change: its only reader, fitDevice, takes
living.pocket_fit.DeviceFit, which does not exist, so nothing compiles
it. Its row, profile entry and reader go back to main, and it stays in
the lenient list.

TF_SLIDE_TAKE_OUT_CHECK is read once when the server starts with --slide
and kept in the config, so a malformed value is refused there by name
instead of being logged at every kept lesson.

Host test: the start-up read with and without --slide, and its refusals.
…600 with slide_take_out_check

Comment-only: Config keeps every field and default.
…m leasing

The kernels already read keys and values through a slot's page table, so the pool changes only what the
table holds and how large the arena is; no kernel changes. A page is 512 positions of the ten attention
layers' keys and values (10 MiB, 20 KiB a token); the conv states stay a fixed part a slot (240 KiB).

- Loaded.layout with engine_paged, as Dory's: the plan sets a window of pages aside for the first stream;
  each stream leases its prompt, its reply and one verify window at its prompt pass and gives them back
  when it ends. A request that cannot lease waits (LaneMemory); fits is the host's admission.
- Model.attach makes the arena and the tables and conv states of the slots the plan names; forward refuses
  rows past a slot's pages. The idle server logs the pool's census.
- TENSORFOLD_LFM2_KV_PAGES=0 keeps every stream's own window of pages, made at open.

Served on the GB10 at --parallel 8, 16k: drafted == plain and concurrent == solo, also with 8 long prompts
on a 52-page pool where the last waits for pages; the replies equal the fixed pages' ones.
…the pages' rows through its position

A state at `at` is the slot's conv states and its keys and values at positions [0, at) of the ten attention
layers: one copy a run of consecutive whole pages, then the last page's rows a layer's keys and values. It is
copied behind the chunk that ends at the mark and restored into the new stream's leased pages before its next
chunk, so a later turn's pass starts at its history. Lookahead 0, as the other headless families.

States live in 2 MiB snapshot pages allocated once at startup inside the prompt-cache budget (`snap_ready`), as
GLM's: a keep or a restore leases or reads pages and allocates nothing, and a dropped state's pages go back to the
pool at once (every copy that reads or writes them is queued on the backend's one stream). The store counts held
and spare pages through `snap_charged` / `snap_spare` / `snap_reuses`.
…dds no pass

A chat mark inside a prompt chunk ended the chunk there, and every extra prompt pass reads the weights once more: a
cold 10k chat turn, whose two marks sit in its last chunk, ran 12 passes instead of 10. Now up to four marks inside a
chunk are tapped instead: the conv kernel runs once more on each mark's last row alone, writing the same y and that
row's conv states into the model's tap buffer, and the keep copies those states with the K/V rows before the mark.
The pass goes on to its grid line; a fifth mark still ends it. The kernel is unchanged.
ashhart and others added 28 commits November 16, 2026 00:42
Six growing agent conversations on a shared 8,192-token system prefix with one-offs between turns, two cohorts of
interleaved chats, and unique one-off prompts, replayed through Store.begin/keep/lookup/restore/remove at 4, 8 and
16 GiB. Shared cuts reach the store, so a common system prompt restores as a prefix. A frequency/probation selector
runs beside main's for comparison; production eviction is unchanged. zig build cache-agent-replay prints the records.

Refs #3241
…in eviction (opt-in)

A resumed snapshot gets eight store ticks of recency credit, at most two resumes' worth, so a conversation that keeps
coming back outlives one-off prompts without outliving its use; redundant copies, the active rewind, borrowed
entries and reservations keep main's protections. Off by default: unset, eviction is main's order exactly (host
controls replay main's choices on every trace). Measured through the real store on frozen traces: at 16 GiB agent
loops rebuild 28-34% fewer prompt rows and agent cohorts 24-30% fewer, at 4 GiB 4-18% fewer across agents and chats,
no cell worse on seeds 7, 11 and 23. The replay gains an agent-cohort trace and confirmation runs per seed.
Refs #3241
… windows (#2840)

Bolt sizes its shared slot for every window row and plans its one-expert shared layer once at load for rows 1 to windowRows, with its own act and out rows, so the routed path's plan, act and ymoe are never shared. In a decode window with a side stream the shared up and down kernels run on f.side between a fork and a join; the main stream waits for the join before addBf16, so the sum keeps its order. Windows without a side stream run the same kernels serially; prompt chunks are unchanged. shared-fork covers Bolt with a NaN-poisoned slot and the side stream held back.
… as on one GPU

The draft head's pieces and groups and the rollback replay ran eagerly whenever a
collective was attached. None of them calls the collective: the head's pass carries
no collective and loads its layer whole on rank 0, and the replay is local copies and
DeltaNet launches on each rank. Each graph replays exactly the launches the eager
pass makes, keyed as on one GPU. Main-model windows keep their one-GPU guard (their
passes hold NCCL calls).

Host tests drive runPiece, runGroup and the rollback through a recording driver
with a collective attached, and check every per-round host value moves each key.
test-flashnext-rank-graphs-host runs them. Part of #2835.
…the product

At one row the ranks' gathered blocks [2, 1, width] are already the row [1, 2 * width],
so the out projection reads the gather's buffer and its FP32 gather writes part's row
directly, and the split shared expert's down projection reads its gather as it lands.
The bytes each product reads and part holds are the ones the two-copy path made; more
rows keep the copies. The launch-recording tests expect no interleave copy at one row.
Part of #2835.
C6 of #2444 makes reuse depend on more than the key: a request's
image identities and frame, a namespace, its own chunk starts and
the rows it prefills. The family's Query now carries them through
kv_prompts (a core-side image identity, converted by the CUDA
adapter) and GLM passes its stream's images. The store enforces
none of them yet, so every store user is unchanged.
C6 of #2444 for the resume schedule: as in the copy store, a
planned store cuts and resumes at a request's own chunk starts
when it gives them and on its grid otherwise, so a grid point
inside the request's chunk is never its resume point; the marks,
keeps and both tree walks use one rule. A key of another length
than its prompt now reuses and keeps nothing, and a keep past the
rows a pass prefills is refused. Without starts every store user
cuts where it did.
C6 of #2444 for content: a page matches only when its words, the
words past it, the exact identities of the images over them, and
its namespace and frame are all equal, as the copy store compares
exact image identities beside its key. Two pictures under equal
key words are two branches, text before them stays shared, and a
split keeps an image on both sides. Eviction reads the same
identity, so another namespace's longer prompt never counts as a
conversation moving past a state. Text keys match as before.
A shared cut was recorded by its words alone, so a cut planned in
one namespace or over one picture could flag another identity's
state at the same words as shared, and keep it from its normal
eviction order. The record now hashes the namespace, frame and
image identities too (text in the default namespace hashes the
same words as before). A test through the CUDA adapter shows a
picture reaching the store: text pages shared, image pages not.
…o tokens

The Qwen3.5 CUDA Options take tp, rank and master as Flash Next's do, and
cuda_shard.zig plans the dense hybrid's even split for a rank of a world:
whole query, KV, key and value heads, the packed in_proj_qkv segments, the
MLP rows and the vocabulary in 128-tiles. A width or half off the tiles is
refused by name, never rounded.

No rank serves yet: --tp on the dense family, --tp on qwen3_5_moe (which
shares Options) and --learn-conversations at --tp are each refused by name.

Refs #3325
test-native-options-host builds cuda_options.zig with engine_api alone, so
the test that imported qwen35 there stopped test-host with "no module named
'qwen35' available within module 'root'". The same test now sits beside the
other Qwen3.5 refusal tests in cuda_refusal.zig and reaches set() through
cuda_options.zig; cuda_options.zig is back to main's text.

Refs #3325
Extend the dense BF16 forward with projected Q/K head norms and last-row pooling. Reuse the shared embedding admission and HTTP route, refuse reranking and unsupported options, and add contract controls plus a checkpoint-only FP32 reference and served qualification.
@ashhart

ashhart commented Nov 16, 2026

Copy link
Copy Markdown
Owner Author

Stopped: the train this one was stacked on did not land whole; its PRs go back to the queue.

@ashhart ashhart closed this Nov 16, 2026
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.

5 participants