Skip to content

train 1119013628: #3140 #3189 #3221 #3407 #3558 (CI only) - #3901

Closed
ashhart wants to merge 53 commits into
mainfrom
lead/train-1119013628
Closed

ashhart wants to merge 53 commits into
mainfrom
lead/train-1119013628

Conversation

@ashhart

@ashhart ashhart commented Nov 19, 2026

Copy link
Copy Markdown
Owner

CI for a landing train: #3140 #3189 #3221 #3407 #3558 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 30 commits November 19, 2026 01:13
…ared gate-up, after its router

Site f read a MoE layer's router alone. The shared expert's gate-up runs on the same window once the routed
experts are done, and its scales and codes now follow the router in the site's rows, inside the same budget.
The table's test gives layer 1 a block FP8 shared gate-up and checks where the 12 MiB budget cuts it.
…age cache after load

Shard 15 of the NVFP4 checkpoint holds the n-gram table beside 3.27 GiB of load-only tensors (embedding, HC,
MTP, vision); the runtimePages guard skipped its release whole, and the final sweep listed only top-level
*.safetensors while this checkpoint keeps its shards under tensors/. Now a shard drops everything but the
n-gram tensors' pages (releaseExcept), and the sweep walks the index's shards (core.checkpoint.shardFiles).
Split ling_mla_gpu.zig past 600 lines by job. One-line comments in mla.metal
and one-line docstrings in the python oracle. Lean new vs main is 0.
Register tf_ling_mla_rope_cache, tf_ling_mla_rope_q and tf_ling_mla_gate_expand
with planted source controls, the way Ling KDA and route were done in #3055.
AutoGPTQ v1 stores a 4-bit symmetric weight as qweight int32 [k / 8, n] with
eight inputs a word, scales fp16 [k / 128, n], and qzeros int32 [k / 128, n / 8]
whose every nibble is 7, so a weight is (nibble - 8) * scale.

core/quant/gptq.zig reads that form. The config side admits quant_method gptq
with bits 4, group_size 128, sym, no act order and a quantized lm_head, and keeps
its dynamic rules in declaration order, so the last rule matching a module
decides whether it is stored quantized. A rule is matched with Python's re.match
over the subset the rules use: literals, '.', '\x' escapes, '*' and '+' after an
atom and a final '$'. A rule outside that subset, an unprefixed rule key and a
rule whose own bits or group_size differ are refused by the rule's name rather
than guessed at. Anything else stops the load naming the field, the rule or the
tensor: bits, group_size, sym, desc_act, lm_head, a missing or malformed
dynamic, a qweight, scales or qzeros of another dtype or shape, a qzeros byte
other than 0x77 with its offset and value, and a non-empty g_idx, because act
order is not read.

read returns the three stored tensors as views and reference writes every
dequantized weight as binary64: q - 8 is an integer and the scale an fp16 value,
so each product is exact.

Host only: no family calls it, no kernel reads it and no setting is added, so
every checkpoint served today takes the path it took before. The test builds a
synthetic GPTQ checkpoint (config.json and a safetensors image packed by the
format's own definition) and checks a binary64 fixture of hand-derived values,
every refusal by name, the matcher on the rules a real export writes, and the
reader on both modules of the checkpoint.

Refs #3368
…nd a non-bool desc_act

A rule's backslash escape was read as the character that followed it, whatever that was,
so ".*layers\.\d+\.mlp.*" matched "layers.d.mlp" here while Python's re matches
"layers.12.mlp" there: a module the rule leaves BF16 could read as int4, or the reverse,
with no error. supported admits an escape only before a non-alphanumeric character, which
is that character itself in Python's re and here, and refuses "\d", "\w", "\s", "\b" and
the rest by the rule's name as "(" and "[" already were.

desc_act went through flag, which answers null for a value that is not a bool, so
"desc_act": "false" was read as false. It is refused by name now, saying what it found in
place of a bool, for the reason sym is.

checkpoint_format was ignored. It is admitted as "gptq" only and refused by name
otherwise, and dialect's doc comment no longer claims every field the reader does not read
is refused.

The tests add the rule above and "\w" and "\s\b" beside it, an escape of a non-alphanumeric
character read as the character, a rule using one admitted, the desc_act refusals, the
checkpoint_format refusals, and checkpoint_format "gptq" on the admitted config.

The published AutoRound export (Qwen3.8-Flash-Next-125B-A5B-INT4-AutoRound, revision
1464274) stores no g_idx tensor: 70 shards, 224454 tensors, none named *.g_idx, so the
refusal of a non-empty one is unchanged.
jayleaton and others added 23 commits November 19, 2026 01:14
Every pipeline of idol.metal and idol_attention.metal is registered: id_linear's eight forms (plain and GELU),
id_split's two, id_gemm32, id_norm (plain, affine, modulated), id_norm32 (affine, modulated), id_norm_split,
id_repo, id_qk, id_gate_add, id_embed, id_cond, id_bias32 and the attention's four forms. Each output is checked
at idol-sdk's fp16 points as the range its fp32 steps allow; the NAX projections against the tensor unit's
16-deep step bound, the attention against attention_ref's formula with P at the tensor unit's fp32. Inputs at the
large served shapes repeat at periods prime to every tile, so float64 stays cheap and every output is checked.

19 controls: rounding points dropped or added (gate 3), fp16 sums in id_norm32, id_repo, id_qk, id_embed and
id_gemm32, and the NAX fp32 path in id_gemm32's place (gate 4), and the attention's tail keys unmasked.
Gate 5 holds the 24 launches, each reserved by its source.

Known finding: id_qk gives a head holding a NaN +-inf in its other outputs where F.normalize gives NaN, as
Metal's max drops the NaN norm that clamp_min keeps.
…awn N(0, 1) from a seed

--synthetic-conditioning --cond-seed N replaces the encoders' features with seeded normal draws at the shapes and
dtypes tf-idol reads, so a case holds nothing from a third-party encoder and can be shared. The denoiser run, its
seed, schedule and files are unchanged; reference.json records the conditioning seed.
…build file

metal_targets.zig was 600 lines on main and tf-idol's row made it 601, so the
image families' program rows (tf-qwen-image, tf-moss-image*, tf-idol and
tf-uocr-*) move to zig/build/metal_image_programs.zig, which also names the
program struct; the table joins them in the same place, so no step changes.
tensorfold.zig's idol export gets a doc comment like its neighbours'.
CHANGELOG gains the line for #1766, and the recipe gains jayleaton's
synthetic-case run at 9aaf5d3 on an M5 Ultra.
…-voices; inline voices under --request-voices

The served catalog moves into a store (drama_voice_store.zig): a request copies its voice's
references when it arrives, so a change frees the old catalog at once and never reaches a request
already running. With --manage-voices, POST /v1/voices adds or replaces a voice from an attested
voice file's fields or from a base64 WAV with its transcript, and DELETE /v1/voices/NAME deletes one
(never the configured default voice); both need the admin scope and write or remove DIR/NAME.json
under --voices DIR through a temporary renamed into place. A WAV is checked for attestation and
transcript first, then encoded on the speech host's thread by an idle lane's codec (the engine's new
optional encode_voice hook; a file the codec refuses keeps the engine open, a device error closes it
as advance does). With --request-voices, a speech request's voice may be an attested inline voice
object, checked as a catalog file is. Both flags are off by default: every reply, refusal and the
default voice are as before. Raw ref_audio, ref_text and references stay refused.
speech_voice_http_test.zig drives the server through speech_stream_test.zig's
socket-pair harness, which root.zig already leaves out on Windows; importing it
unguarded failed zig-windows (std.c.socketpair is void there).
`tensorfold config validate FILE` reads a cluster.json, prints every
problem the existing parser collected, and exits without planning models
or probing hosts.
… test

The release binary, tensorfold-native, has no config command, so the
smoke check line now says the command comes from a source build. The
"unknown key" test checks an unknown backend value, so its name says so.
TENSORFOLD_REQUEST_JOURNAL=PATH journals each chat and completion request
as three JSON lines: start before any work (reply id, route, fingerprint,
the client's seed, the redacted body), prepared before the engine sees it
(the seed and sampling the server resolved, the prompt's token count and
SHA-256), and finish once the reply has gone (status, outcome, the reply's
size, SHA-256 and token hash, and its bytes when they fit 4 MiB).

- Privacy: off unless set. PATH and PATH.lock are created 0600, a link or
 a file others can read is refused, and one server holds the lock. Image
 URLs and PDF data are redacted as in TENSORFOLD_REQUEST_LOG, which is
 unchanged; no header is journaled; benchmark child servers drop the
 variable.
- Size: a file rotates at 64 MiB and four are kept; a record is at most
 8 MiB, past which a body or reply keeps its size and hash. Each record is
 one write with no sync: a failed write loses that record, is logged once,
 and the request goes on.
- Quarantine: the next start flags every request a crash left unfinished.
 A fingerprint (the API key's label, the route, the body) in flight at two
 crashes is refused with a 400 request_quarantined before the engine sees
 it; other keys and other bodies are served. It lapses after a day, a
 clear record lifts it, and a clean stop flags nothing.
- tools/replay_request.py lists, clears and replays a request, adding the
 drawn seed when the client sent none, and compares the reply's output
 and token hash, or every byte with --whole-body.

With the variable unset the trace hands back the caller's own output and
writes nothing. Host tests on a fake engine cover the records and reply
bytes, replay by the drawn seed, redaction and file modes, the two-crash
rule per key, clean stops, clears, lapses, torn and unreadable lines,
rotation, a failing write and the journal-off path
(zig build test-request-journal-host).

Fixes #3188
…lel fabric, pictures and video settings read through platform/environment.zig
@ashhart

ashhart commented Nov 19, 2026

Copy link
Copy Markdown
Owner Author

Landed: #3140 #3189 #3221 #3407 #3558 as main 92332b2. This PR only carried their CI.

@ashhart ashhart closed this Nov 19, 2026
@ashhart
ashhart deleted the lead/train-1119013628 branch November 19, 2026 05:46
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.

8 participants