Repository navigation
Conversation
(cherry picked from commit 8c07b5c)
(cherry picked from commit 1f5a2cb)
…ute in every idle-manager state I add three route-level tests that GET /metrics through the production dispatch with no idle manager, a healthy manager, and a parked manager; each asserts exactly one tensorfold:open_connections sample line, the exact TYPE line, and the admitted count, and the parked body keeps its request-and-process-only family split. (cherry picked from commit 3806056)
metrics.zig crossed the 600-line lean rule, so the gauge renderer and its unit test move to load_metrics.zig (engine_parked, lanes); the route calls it from there. The help and docs now count Unix-socket clients too, the docs line wraps with the surrounding prose, the smoke script is named in zig/tests/server/README.md, and the lone test block in root.zig folds into the previous one.
The ViT and aligner on Metal (--vision), bias_vl routing for image rows, Engram shut on image tokens, an image span prefilled in one chunk, and the prompt cache keyed by the image's hash. The server writes the template's image token for an image part when the engine reads images, and refuses the reserved mark in request text.
…nerate vision configs
OCR reads PDF pages by index under a page budget sized for one generation per page, and must know every page's size before any inference while holding one rendered page at a time. renderPages takes a page selection and caps from the caller over its running budget, measurePages reports the document's page count and each selected page's size and DPI without a bitmap, the render worker's request carries both and renderer failures take the caller's error kind. Chat PDF input keeps its limits, messages and error kinds.
A Mistral client sends whole PDFs and picks pages with pages, so the route now reads PDF documents with --vision-pdf and the pages list or range string, bounded before it expands and deduplicated under the request's page budget. Every PDF is measured before the first generation, so an index out of range or a request over the budget is refused whole before any inference, and each page then renders alone in its page arena just before it is read, so one rendered page is in memory at a time; a client that leaves renders nothing.
The API guide described an image-only route. It now gives the PDF render limits and DPI, the measuring before inference with one rendered page in memory at a time, the shared page budget, PDF fetches under --vision-pdf, renderer failures, and the pages field; the changelog line names PDFs and the page budget.
…o seven tokens a round
… copies grow to the window
…lane core's setup
… three-draft cap has a test
…ys under 600 lines on today's main
…p.zig stays within 600 lines
…calls, for queues made with Device.queue4 A queue from Device.queue4 (macOS 26 and later) takes the same calls as a Metal 3 queue and sends them through an MTL4CommandQueue: a ring of command buffers, each with its own allocator, argument table and constants pages in place of setBytes; a queue barrier at each encoder's start where Metal 3's hazard tracking ordered encoders; barriers that flush to the device's coherence point, and one after each dispatch of a serial encoder; copies and fills on a compute encoder; a shared event for waits; commit feedback for GPU times and failures; and a residency set that follows every buffer bound, releasing a freed buffer once the queue has nothing in flight. Metal 3 queues are unchanged. TF_METAL4_TIMELINE=n stamps every stage of n named rounds on a Metal 4 queue and logs their GPU time by kernel and the longest stages. Pipelines carry their kernel's name as their label.
…ounds named for the timeline boot.openQueue gives the family, and its test rigs, a Metal 4 queue under TF_METAL4=1 where the Mac has one, and Metal 3 otherwise; the kernels and their order are the same. The decode forward names each round by its rows for TF_METAL4_TIMELINE, and TF_DSV41_ROUND_PROF=1 logs rounds' host and GPU milliseconds by rows on either queue. A new device test checks decode rounds of 1 to 16 rows, a prompt's chunks and timestamped rounds on a Metal 4 queue against a Metal 3 queue, bit for bit.
…ps Metal 3 Served DeepSeek-V4.1 replies were equal on Metal 3 and Metal 4 (48 of 48 in every pairing of two runs each), and decode rounds took less GPU time on Metal 4 at every row count, so the served family's queue is Metal 4 wherever the device has Metal 4's command queues. Macs without it, and TF_METAL4=0, stay on Metal 3. The device test rigs stay on Metal 3 unless TF_METAL4=1, as the timing harnesses sample Metal 3 encoders; metal4_test compares both.
…sts, and zig build test reaches them The three tests of TF_FLASHNEXT_FUSED_SPLIT's reader, its CUDA threshold and the Metal and HIP refusals had no build step. They now have their own, test-flashnext-fused-split-host, which the test step depends on, as the RoPE refusal tests beside it do.
…unset as a third arm Main against the branch commit 4df765a on one GB10, both built the same way from their own commits, alternating M1 F1 U1 M2 U2 F2 with one fresh server an arm. With the setting 1: 14 of 22 decode cells faster (+1.0% to +1.8%), 8 level, 0 slower; unset: 21 level and 1 at +1.1%. Tokens a round are main's in every cell. Cold prompts of 2,048 to 65,536 tokens are level. Exactness holds on main and on the branch set to 1, unset and blank, and the branch's replies equal main's. The changelog line takes the new numbers.
A fatbin set for sm_80, sm_86, sm_89, sm_120 and sm_121 built from 120123a by nvcc 13.3.73, then tf-cuda-test kernel-contract-limits over it: the eight launches this change adds report record current on all five SMs, both planted controls go red on all five, and the run's 834 problems are other launches' nvcc 13.0 records that nvcc 13.3 compiles differently. limits.txt is its output; the README says what the run proves and what it does not, and records main 964174e as merged, which moves none of the files the measured arms ran on.
…2b3722 The receipt's source section names both merges of main, 964174e at 120123a and d2b3722 at 1e24f26, and says what main changed between 41a72fd, where the arms ran, and d2b3722: 111 files, of which this change touches CHANGELOG.md and docs/environment.md, and three are on a Flash Next CUDA request's path (fp_pairs.cuh gains a function only nvfp4_experts32.cu calls; lane_host.zig and lane_host_end.zig count a cancelled request's work in the load ledger). No file of the fused split-K path moved, so the arms describe both merges.
…nches and the failures by launch
…not only an EXL3 one The loader picks a dense layer's form from its stored dtype (mlp.held), and the B16 scratch plan counts the dense shapes whenever a dense layer is held bf16.
core: dfloat11.zig decodes one coded group, written from the format's description; dfloat11_config.zig reads config.json's dfloat11_config (the pattern steps the published configs use, others refused by name); checkpoint_coded.zig finds the groups in the headers, answers their members' weight names, decodes a group once and frees it at release; checkpoint.zig's get, expect and has fall through to it. A checkpoint with no coding attached reads as before. glm: cuda_dfloat11.zig gives the shapes the files omit (q, k, v, o, kv_b, the embedding, the head) and attaches the coding to the loader's two checkpoints; cuda_weights.zig's load calls it. Refs #3649.
…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".
…tiles On an M5 a decode round's cached-key attention ran six 16-row query tiles in one threadgroup on a long cache (four below 64 chunks), so each chunk was read once for six tiles. Two tiles a threadgroup gives the GPU more threadgroups and finishes the prefix pass sooner at every context measured; the kernel, its chunks and the merge order are unchanged, so every row's sums are the same. Chips without tensor units keep six and four.
…ttention.zig within 600 lines
…r fields are refused by name
…decimal digits ('{+0}', '{-0}', '{0_0}' are Python keyword names and are refused; '{00}' is index 0), with refusal and parity probes and the changelog line
… pool tile-step window costs Size RDNA3.5 lane-round routed MoE plan buffers in hip.moe to the round's exact row count instead of rounding up to a 16-row minimum bucket, avoiding unnecessary zero-fill and empty item dispatch padding during decode and speculative verification. Pool rising added-row deltas across each 4-row tile regime in hip_serve/costs when timing lone decode windows so load-time window costs remain concave across per-tile step boundaries.
tiles/wmma12_step.hpp holds W12Geo, the bf16x8 type, w12_at, W12Step, W12Exact, the K loop's barrier and the LDS operand store and load, so a second gfx12 tile can stage BF16 operands the same way. The barrier and the load take the fault type, so a tile that uses them gets both contract controls without its own checks. wmma12_gemm.hpp includes it; the geometries, the launch band and the epilogues stay there. tiles/wmma12_gemm_k32_ref.hpp stays self-contained.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
CI for a landing train: #3774 #3862 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.