Repository navigation
Merge upstream main - #63
Merged
Merged
Conversation
plotarmordev
commented
Nov 16, 2026
Owner
- glm cuda: NVFP4_NZ5 checkpoints, block 32's experts with E2M1's code 0b1000 read as +5
- changelog: NVFP4_NZ5's line waits for landing
- cuda source check: declare __vcmpeq2, which fp4pair_nz5 calls
- cuda tests: nvfp4-nz5, contract_exl3 and dory_serve imported at their dispatch lines, so main.zig stays within 600 lines on today's main
- changelog: glm cuda: NVFP4_NZ5 checkpoints, block 32's experts with E2M1's code 0b1000 read as +5 ashhart/TensorFold#2894 under Unreleased
- nemotron metal: prefill runs a chunk a call, so a new prompt no longer stalls other streams' rounds (Gemma 4 on Metal: a new prompt freezes every other stream's decode for its whole prefill (no prefill stepping) ashhart/TensorFold#3021)
- fix(metal): preserve Nemotron prompt overlap and cancelled progress
- changelog: nemotron metal: prefill runs a chunk a call, so a new prompt no longer stalls other streams' rounds (#3021) ashhart/TensorFold#3054's line from lines/3054.txt in place of its own
- changelog: back under Unreleased
- fix(qwen3.5/cuda): yield background prefill between chunks
- changelog: fix(qwen3.5/cuda): yield background prefill between chunks ashhart/TensorFold#2873 under Unreleased
- changelog: each line once under Unreleased
- flashnext hip: the draft step moves to draft_batch.zig and the head's forward takes segments
- flashnext hip: a shared round's streams draft in one head pass a step
- flashnext hip: the draft step draws on the stream's tile, a serial and a batched draft
- flashnext hip: a GPU check runs two streams' drafts in one head pass against one at a time
- changelog: the draft batch's line ends with its number and the thanks
- flashnext hip: the batched draft keeps each stream's chain row in the arena, and the GPU check's variables are named for the family
- changelog: back under Unreleased
- docs: strict tools under tool_choice auto, and TENSORFOLD_TOOL_GRAMMAR
- changelog: docs: strict tools under tool_choice auto, and TENSORFOLD_TOOL_GRAMMAR ashhart/TensorFold#3235 under Unreleased
- changelog: each line once under Unreleased
- Price shared plain rounds independently of drafted row costs
- Exclude preceding deferred work from shared round timing
- Calibrate copied shared rounds when plain competes
- Keep existing shared choices until a plain round is measured
- Assert that the calibration fixture measured plain before reading it
- Keep held drafts free of another drafting charge
- Keep unmeasured shared prices on the original head rule
- Space plain trials independently of forward table coverage
- Match independent residuals to the priced head batching mode
- Pin mixed reservation caps and holds before plain timing
- Price shared plain rounds from warm plain trials
- Log what the shared plain-price rule sees, behind TF_SHARED_PRICE_LOG
- lanes: retain signed learning with independent plain prices
- lanes: keep askDrafts private; the shared round gets it as an argument
- lanes: one-line comments for the shared round's draft argument (lean)
- changelog: lanes: shared rounds price plain overhead apart from drafted rows (refs #2605) ashhart/TensorFold#2687 under Unreleased
- qwen27 served: the reply-end keep test names its history, and a step runs it
- changelog: qwen27 served: the reply-end keep test names its history, and a step runs it ashhart/TensorFold#3012 under Unreleased
- lanes: one stored wait reason per queued request, and per-reason load metrics (One reason code for every wait or refusal, and an audit of queue limits ashhart/TensorFold#2135)
- lanes: count every refusal a client sees, one restore fallback a request, DeepSeek's mapping tested on the host (One reason code for every wait or refusal, and an audit of queue limits ashhart/TensorFold#2135)
- changelog: lanes: one stored wait reason per queued request; refusals, failures and waits counted by their codes (#2135, shape B) ashhart/TensorFold#3014 under Unreleased
- environment: Metal Qwen paging, slot resume and slide checks by name (Environment variables: refuse a bad value by name instead of reading it as a default, and register the ones that change outputs ashhart/TensorFold#2370)
- environment: drop TF_SLIDE_FIT_REDUCE; read the take-out check at start (Environment variables: refuse a bad value by name instead of reading it as a default, and register the ones that change outputs ashhart/TensorFold#2370)
- server: slide_forget_fail's note on its line, so server.zig stays at 600 with slide_take_out_check
- changelog: environment: Metal Qwen paging, slot resume and slide checks refused by name (#2370) ashhart/TensorFold#3018 under Unreleased
- lfm2_moe: the attention caches in pages of the core pool, every stream leasing
- lfm2_moe: the prompt cache on CUDA, a kept state the conv states and the pages' rows through its position
- lfm2_moe: keep a mark's state as the prompt pass goes by, so a keep adds no pass
- docs: LFM2.5 on CUDA leases pool pages and keeps chat states in the prompt cache
- lfm2: read TENSORFOLD_LFM2_KV_PAGES through the environment table, refuse anything but 0 or 1
- lfm2: the startup line says the prompt cache is reserved at load
- lfm2_moe: a keep's copies run on their own stream, so a cold turn's first token doesn't wait for them
- lfm2_moe: every write a keep reads takes its stream from one place, which waits for the keeps
- changelog: LFM2.5-24B-A2B on CUDA: one helper for every prompt-stream write a keep reads, and a test that fails if a writer skips the wait ashhart/TensorFold#2989 under Unreleased
- server: a crash's stale note and graph temporaries are cleared when the server opens their folders
- server: the stale-temporary sweep moves to stale_temps.zig, so server.zig stays at 600 lines
- changelog: server: a crash's stale note and graph temporaries are cleared when the server opens their folders ashhart/TensorFold#3132 under Unreleased
…0b1000 read as +5
E2M1 spends two of its sixteen codes on zero. A quantized_layers entry of
{"quant_algo": "NVFP4_NZ5", "group_size": 32, "weight_scale_encoding":
"csf0_v1", "code_map": "e2m1_nz5"} holds csf0_v1's tensors in the same
layout and reads 0b1000 as +5. admitRecipes takes that pairing alone and
refuses a code map beside any other recipe by module, and GLM's CUDA load
refuses a checkpoint that declares both NVFP4_NZ5 and NVFP4 csf0_v1.
nvfp4_experts32.cu gains NZ5 entries of its five launches: the same
templates with fp4pair_nz5, which turns fp4pair's 0x8000 (-0) into 0x40A0
(+5), and the same sums in the same order. The image loads the E2M1 or the
NZ5 entries as the checkpoint's modules declare, so a csf0_v1 checkpoint
runs the entries it ran before and a block 16 one loads no block 32 image.
The kernel contract holds each NZ5 entry bit-equal to the block 16 instance
it replaces on the same values, a planted +5 written there as a 4 under a
scale two e4m3 steps up, with E2M1's entry on NZ5's codes as the planted
control; nvfp4_experts32_records.zig gives their limits under nvcc 13.0 and
13.3. tf-cuda-test nvfp4-nz5 compares each form's bytes with E2M1's kernels
on the same values at widths 1,024, 704 and 640, on bf16 integer inputs so
that a group's sum is exact before its scale. The FP4-Local recipe count in
modelopt's test gains the new recipe's zero.
1.2.7 was released after this branch's base. On that base the line would merge into 1.2.7's section, so it goes under Unreleased when the change lands.
test_real_exl3_layout parses exl3_layout.cpp, whose includes reach common/fp_pairs.cuh, against the fixed SDK declarations in tools/zig/cuda_host. fp4pair_nz5 there calls __vcmpeq2, which they did not declare, so pytest failed. Declare it with the signature in CUDA 13.0's crt/device_functions.h, unsigned int __vcmpeq2(unsigned int a, unsigned int b). Only check_cuda_sources.py reads these headers: no kernel, engine or test binary changes.
… dispatch lines, so main.zig stays within 600 lines on today's main
…r stalls other streams' rounds (ashhart#3021) The Metal backend now declares prefill_step and cancel_prefill beside reports_fill. The prompt pass moves out of backend.zig into prefill_metal.zig (the device side, unchanged) and prefill_steps.zig (whole pass and step, generic, with recording-fake tests). Both run the same chunk at prompt_flight's cuts, so replies are unchanged; each step lands the queue and reloads its own prompt ids before encoding, since the prompt buffer is shared.
… forward takes segments
…d a batched draft
…against one at a time
… arena, and the GPU check's variables are named for the family
What a strict tool's schema holds under auto, what each choice lets the model emit, which cases are refused and with which status, the server-wide switch and its legacy DeepSeek alias, and that LFM2's EBNF call rule is not grammar-held under auto. Docs only.
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 ashhart#2605.
ashhart#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 (ashhart#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 ashhart#2196. Co-authored-by: devopsfortunato <57877156+devopsfortunato@users.noreply.github.com>
…est, DeepSeek's mapping tested on the host (ashhart#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.
…shhart#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 (ashhart#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.
…fuse anything but 0 or 1
…irst token doesn't wait for them
…hich waits for the keeps A clear, a chunk, a one-row step, a verify round and a commit each queue on the stream fenced() hands back, after the keeps' copies queued so far. A host test reads the backend's writes and fails on one queued on the prompt stream without the wait; each of the five planted that way goes red.
…he server opens their folders
….zig stays at 600 lines The same two calls, made at the same point in Server.init.
…eam-main # Conflicts: # docs/quantization.md
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.