Skip to content

train 1120085007: #3218 #1411 #1508 #2762 #2772 (CI only) - #4185

Closed
ashhart wants to merge 66 commits into
mainfrom
lead/train-1120085007
Closed

ashhart wants to merge 66 commits into
mainfrom
lead/train-1120085007

Conversation

@ashhart

@ashhart ashhart commented Nov 20, 2026

Copy link
Copy Markdown
Owner

CI for a landing train: #3218 #1411 #1508 #2762 #2772 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.

BadAd84 and others added 30 commits November 20, 2026 08:50
…keeps its BF16 linears

The FP4 checkpoint quantizes the backbone and leaves the drafter in BF16, 181 MB that every draft pass reads.
TF_FLASHNEXT_MTP_WEIGHTS=mxfp8 re-codes those linears to MXFP8 (E4M3 codes, one power-of-two scale a row of 32
inputs) as they load; checkpoint, the default, keeps the rows as stored and runs no new code. A draft is a proposal
the verify forward checks, so a reply is unchanged and only the rounds it takes move.
Decode cells at 1, 2 and 4 streams on main, the branch unset and the branch with mxfp8,
and the drafted, resumed and concurrent exactness table for the same three arms.
…drafter has no MXFP8 projection

mxfp8 re-codes the drafter's BF16 linears through the MXFP8 projection that an MXFP8 checkpoint's mixers load
through, and only the CUDA loader has it. Flash Next on Metal and on HIP now refuse mxfp8 by name when they load,
and on CUDA a drafter linear stored as anything but BF16 (MXFP8 or affine already) refuses it at that tensor,
naming the setting, the tensor and its stored type, rather than loading it as stored.

Unset or blank still reads checkpoint, which runs main's load. The reader moves to mtp_weights.zig so Metal and HIP
can ask without CUDA, the startup line gives the MiB re-coded, and the setting has its row on the environment page.
…le and tokens a round

Main against the branch rebased on it, as M1 U1 X1 M2 X2 U2 with U2 set blank: greedy and sampled at three seeds,
tokens a round beside tok/s, the cold prompts, a malformed start and the exactness table, and the changelog line
quotes them. One cell, chat at one stream with seed 1234, is slower again on its rerun and is reported as a loss.
…e any checkpoint or device work

HIP asks at the top of Engine.load, ahead of the runtime, the context, the kernel images, RCCL and the
checkpoint; Metal asks right after the environment check, ahead of window validation and the checkpoint admission.
The test checks that each call comes before its backend's first runtime open or admission check, and the
admission order test takes the new line.
…HTS changes

cuda_mtp.zig, cuda_projection.zig, cuda_projection_load.zig and cuda_prompt_wt.zig take their hashes at this head,
on main's files, each with a #3218 note: checkpoint keeps main's bytes.
…NEXT_MTP_WEIGHTS

The receipt names the rebased commit it measured and gives the engine allocator's resident model from the same
boots: 72.73 GiB on main and unset, 72.65 GiB with mxfp8. The changelog line moves under Unreleased after the
1.2.9 release and says main's tokens a round on code.
…g, before the backend opens a device

The HIP backend runs ready before any family code: it reads the checkpoint's context, opens a runtime for the
card's caps and, under --tp, joins the ranks. A refusal in check or in Engine.load came after that. Flash Next's
HIP native now refuses mxfp8 in refusal, the flag check the backend runs on every rank before ready, and
Engine.load no longer asks. The position test checks the hook and that no later copy remains.
…pert as stored

TF_FLASHNEXT_MTP_WEIGHTS=mxfp8 re-codes the MTP drafter's BF16 linears to MXFP8 as they load: 13 tensors,
170 MiB of them on the NVFP4 checkpoint. Re-coding all of them also moves the sampled draft acceptance at one
stream (chat, temperature 1.0, seed 1234: 2.39 tokens a round becomes 2.31), and in a screen on this tree that
cell measured 2.5% slower than main, which is the cell the gate asks to stay level.

A narrower re-code keeps three of those tensors as the checkpoint stores them and re-codes the rest:

- fc_embedding and fc_hidden (25.0 MiB), the two fusion projections that carry the previous token's embedding
  and the model's hidden state into the drafter;
- the layer's shared expert gate, up and down projections (9.4 MiB).

The other 135 MiB, the hyper-connection mixers and the attention's q/k/v and o_proj, are re-coded. A screen of
thirteen masks over those linears, one fresh server a boot, found every mask that re-coded the two fusion
projections 1.2 to 4.7% slower at that cell, where masks that kept them stayed at main's level; keeping the
shared expert as stored held the sampled cells at main's level as well.

denseFor names the loader's tensor and holds the re-code off for a linear kept as stored, so the six loaders
that pack a drafter BF16 tensor decide in one place. The startup line reports both halves:
TF_FLASHNEXT_MTP_WEIGHTS=mxfp8 re-coded 135 MiB of the drafter's BF16 linears and left 34 MiB as stored.

The kept set is one list with a test over it, a second test holds every loader to denseFor, and the four
pinned serving files are re-pinned.
…ting's name

The matcher read `for (held) |name|`, and `name` is the file's own constant for
TF_FLASHNEXT_MTP_WEIGHTS, so the tree did not compile: "capture shadows
declaration of 'name'". The capture is `keep` now; the set it walks is
unchanged.
The four files this pull request ships under docs/receipts/flashnext-mtp-weights/
carry the narrow variant's window: main 4fda6a0 against head b43b10f, one
GB10, 18 boots, 22 cells faster and 10 level of 32 for mxfp8, no cell slower,
the gate cell level, every cold cell level and every exactness contract equal.
Retain the PR recode and current main serving changes in the same files.
Follow main 2931287 flashnext cuda: the mixed PLE shard and the nested shards leave the page cache after load in zig/src/families/flashnext/cuda_prompt_wt.zig.
Retake only these merged source hashes; keep both notes and the identity checker.
…re each byte sits in its lease

The rows store's view of a GLM kept state, without the store: the words (format,
position, head rows, ring bases, KDA copy bits), the KDA prefix, each DSA layer's
latent rows, scales and whole pools by position, its rings and pools in progress
as the state's own, the head's caches at a whole verify window (rows past the
head's own read as zeros), then the tail. Copies run a page of the lease at a
time. Nothing is wired to --learn-conversations yet.
…state on disk

Rank 0's engine thread leases, fills, reads and seals each rank's copy through the follow link
(cuda_disk_ranks: blank, put, take, seal, prefixes). The store's image is rank 0's image followed by
each other rank's prefix, the one part a rank holds alone; the rest are the same bytes on every rank,
checked at start by the identity probe. A blank state is refused by restore until its seal.

A blank whose disk step fails on the link gives rank 0's lease back, and its id goes on the dropped
list, so the next step drops it on any rank the step reached; the id is not used again. An NCCL failure
there already ends every rank (the liveness lines), but a CUDA error in the step's launch or upload
returns to the disk read, which tries one shorter state and then prefills while the server goes on.
cuda_disk_ranks_test.zig runs the steps on host memory with a fake link: that failed blank, a blank state
refusing bytes past its words and front until sealed (DiskOrder), each BadStep a follower refuses before
its states or the link, and each other rank's shared bytes taken past its prefix and compared to rank 0's
(RanksDiffer, in ranks.same, which the probe calls). attach's refusals of the shared store and of more
ranks than prefix_buf holds (KvShareWithLearnConversations, TooManyRanks) have their own test in
cuda_glm_disk.zig. link and prefix_buf stay process-wide: the process serves one model.
With TF_GLM_KV_LIVE_HALF=1 a keep holds one KDA half and the disk image both, so GLM refuses
--learn-conversations with it by name at startup (cuda_refusal.zig); the test that pinned GLM refusing
--learn-conversations outright now pins that it takes the flag alone and refuses it beside live-half keeps.

Rank 0's link becomes the disk steps' link in `follow.Link.lead` (which also sets whether the other ranks begin
asleep), at TP only, and `Link.deinit` clears it, so cuda_native.zig stays at its 600 lines. cuda_disk_ranks_test.zig:
one rank leaves the steps local, two set the link, another link's deinit leaves it, its own clears it; the test fails
with the clear removed.
…sk state into that storage

A family whose kept states live in preallocated storage it reuses (GLM's snapshot pages on CUDA) and
cannot trim never had a disk read chosen: the selection counted its spare storage as fixed and its
kept states as not reclaimable, so no state ever fit. Such a family's room for a read is now its
spare storage plus what evicting unborrowed states frees, and a read is ready once the family says
its spare storage takes the state, as a keep's admission already asks. Families with trim, or
without reused storage, are unchanged.
…t, as before

The disk read's early admission for a family whose spare storage takes the state now applies only
to a family without trim, as the selection's capacity already does. A family with trim, such as
Flash Next's or Qwen3.8-27B's pools on Metal, makes room for a read by trimming its spare storage
and evicting, exactly as it did before, and a new test pins that its read stays within the budget
when its reuses answers yes.
…he state's rows

An index ring based at `base` holds the rows from `base` up to the state's position, and the image keeps
at most a ring's rows of each. The seal now checks the words' main base against the state's position and
the head's base against its rows, so an image whose words name a ring that starts past them, or too far
back to be held, is refused before the blank state is made whole.
…/O worker GLM's store uses

The write-behind gave GLM's store its own I/O worker, while the grid test wrote on the test's thread
(sync_writes). It now runs on each, drained by write.drain, so a worker path that loses the grid's
chunk starts fails the test.
…rn-conversations alone keeps its states

Since #1413 CUDA serves --spill-gib and --checkpoint-slots, and --learn-conversations admits GLM, so
--learn-conversations --spill-gib (or --checkpoint-slots) opened GLM and ignored the flag: its disk store
writes every rank's part between passes and stages nothing at eviction. GLM now refuses both by name.
Its store's spill stays off, since an eviction would gather on rank 0 mid-pass while the other ranks
wait in the gate's all-reduce. docs/api.md lists every CUDA family that keeps states on disk.
…he shared-store refusal names TF_KV_SHARE

- A kept state's device pages are read out with cuda.memory.download, which stages through the pinned buffer on an
  integrated GPU (#2103, #2289), as every other synchronous readback does; the copy back in stays a direct HtoD.
- The refusal beside share_pages names TF_KV_SHARE, the switch behind it since #2211, in its message and comment.
- The disk image test's driver answers cuCtxGetDevice and cuDeviceGetAttribute (a discrete card).
…e owner, and a read refuses another by name

The image's words gain three: the ranks that wrote it, its layout and the rank that owns its latent rows.
Every image is unsplit so far (every rank holds every row): it records this server's world, layout 0 and
no owner. A read refuses words of another world (DiskWorld) or another layout, or an owner its layout
does not have (DiskLayout), before the blank state is sealed. The words are 72 bytes, the seal step 18
words. #1431's split states fill the layout and owner without another format.

A disk read forgets a state's file refused as DiskWorld or DiskLayout after one recall, as it does one
refused as DiskWords (rows_read.refused); rows_refusal_test.zig's cases include both.
… attach, so a long state is staged whole

cuda_glm_disk.attach opened the store with rows.Rows.open, which keeps the 1 GiB default staging permit and
skips the floor rows.attach applies (the longest state's charge, within the RAM store's budget). At about
18.5 KiB a token that stopped every state past roughly 55K tokens: `imprint: saving 124928 tokens skipped
(StagingFull)`, whatever --learn-gib said, and a long conversation was recomputed cold after a restart
(found by crystal8194 on #1411).

attach now goes through rows.attach, as Qwen 3.5 27B does, with `longest` the capacity's whole pools
(`image.longest`, the last position `parts` takes; rows.attach falls back to the default when pricing it
fails, so the position matters). Spill stays off and the slots unset, as before. The start-up line gains the
permit: "a save stages up to N MiB".

Tests:
- test-cuda-disk-open-host: GLM's own open over a store of 18,944-byte tokens. A 124,928-token state's charge
  is past the 1 GiB default and within the permit, which is the longest state's charge; with a RAM store too
  small to keep the state the permit stays the default. It fails with the floor gone (the permit is 1 GiB).
  It prices the permit a save's stage step asks; it does not write 2.3 GiB.
- The GLM set: `longest` is a position the store's parts take at capacities on and off a pool's edge, and the
  next pool past it is refused.
…n one step, copied into place on the device

A restore placed every piece of a block (each layer's rows) through its own follow-link step per other rank: a
header broadcast, a payload broadcast, a download and a host copy per page on that rank, while every decoding stream
waited on rank 0's engine thread. At TP=3 the shared rows also crossed twice. Now each block's pieces go as one
table and one broadcast of their bytes (more only past the link's room), the shared rows once for every rank, and
each rank copies its pieces from the link's buffer device to device.
…g the file within 600 lines

Main now holds zig/src/native/cuda.zig at 600 lines, and the glm import this branch added took it to 601.
…o, after main's 7948cc4

Main's 7948cc4 launches GLM's CUDA kernels as dependent launches through cuda_pdl (cuLaunchKernelEx), so the follow
link's put kernel no longer goes through cuLaunchKernel. The test's fake driver sets cuLaunchKernelEx from the same
put handler, through cuda_pdl.forwardEx, as main's own GLM tests do. Nothing else changes.
…KV head

prefill_attention.cu instantiates pattn_kernel<128, 8, 4, 8>: Nemotron's <128, 8, 8, 8> needs eight query heads
a KV head, and LFM3's full-attention layers have four (16 over 4). Its launch record is measured on nvcc 13.0 and
13.2 from every SM's image (206 registers on sm_80/86/89, 231 on sm_120/121, no static shared memory).
sassid on sm_80/86/89/120/121, both toolkits: 0 functions changed, 5 added.
LiquidAI/LFM3-1.7B-NVFP4 stores only the FFN as NVFP4: w1, w3 and w2 as e2m1 codes in groups of 16 with e4m3
block scales, an fp32 tensor scale and a static input scale. Every mixer projection, the embedding and the tied
head are bf16, and the depthwise conv kernel is [channels, 1, taps].

- config.zig reads `quantization_config` with quant_method "modelopt" as Scheme.modelopt_nvfp4: quant_algo NVFP4,
  one Linear group of static FP4 g16 weights and inputs, and an ignore list that is exactly the head, the
  embedding and every layer's mixer. Anything else is UnsupportedLfm3Quantization. MLX configs parse as before
  (Scheme.mlx_affine), so a decoder that reads one scheme can refuse the other by name.
- weights.zig's schema takes that layout for the bare namespace.

tf-lfm3-check passes the published header (b30025bb): 502 text tensors, 1,829,689,408 bytes. The MLX-4bit header
still passes (594 tensors, 973,008,384 bytes). Host tests 26/26.
…tract

lfm3.cu instantiates liquid_conv<7,0> and liquid_commit<7,0>; contract_controls.cu adds their <7,1> controls.
contract_lfm2_moe.zig's Conv and Commit take the tap count; contract_lfm3.zig checks the served 7-tap shapes.
Records are identical on nvcc 13.0 and 13.2. contract_limits.zig now lists the lfm2_moe and lfm3 images.
jschmied and others added 25 commits November 20, 2026 08:50
docs/receipts/lfm-cuda-sass-fad7e142/ now compares main af9777b with the merge head 2fc30dd on
sm_80/86/89/120/121, nvcc 13.0 and 13.2 (-j 1): prefill_attention 70 of 70 functions identical (+5,
pattn_kernel<128, 8, 4, 8>), contract_controls 450 of 450 (+15, LFM3's three controls). Every digest equals the
receipt before it; only the header names the new trees.
TF_CUDA_CARVEOUT stays 0 or 1. TF_CUDA_CARVEOUT_SOURCE picks where the display
reservation comes from: drm, the default and the existing dumb-buffer route, or daemon,
where a display-memory daemon lends it in whole 2 MiB slices over a unix socket. Which
daemon a box runs is a setting, not a code path: TF_CUDA_CARVEOUT_SOCKET (default
/run/dispram/dispram.sock, kindling spark-os's dispramd, whose README publishes the
default key), and TF_CUDA_CARVEOUT_KEY, or TF_CUDA_CARVEOUT_KEY_FILE for a daemon whose
key is per box: spark-attic's atticd keeps /etc/spark-attic/key and listens on
/run/spark-attic/attic.sock.

The client, cuda/carveout_lend.zig, was written from a specification of the daemon's
observed behaviour, by an agent working in a copy of this tree that held no client for
the protocol. The specification, the probe scripts and their output are in the thread of
pull request 2762.

An ask is rounded up to a whole slice before it is sent, and a grant smaller than the ask
is refused rather than fitted. The reply's granted size is the authority, ok must be
true (a refusal carries a size field too), and a seekable descriptor's own length is
checked as well. The slice is mapped through arena.zig's Vmm.

One pair of calls serves every caller. carveout.requested decides whether the carveout
is on and reads its rows through the settings table, where TF_DRM_CARD gains a row.
Carveout.from opens the source the request names and logs a refusal once. The CLI and
Nemotron make those two calls and nothing else.

The key file is read only for the daemon source, as its claim is made. A file that is
missing, not a regular file, empty on its first line or 256 bytes long there is refused with
TF_CUDA_CARVEOUT_KEY_FILE named, and neither the path nor the file's bytes are shown.

The startup walk validates the carveout's rows when it is on and skips them when it is
off, as it already did for TF_CUDA_CARVEOUT_MIB, and reads TF_DRM_CARD only while the
carveout is on and the card is its source.

Off Linux the claim returns NoDaemon before any of the protocol code is analysed, so the
Windows host tests build.

The client gives the daemon 10 seconds to answer, and a daemon's rows are read only while
the daemon is the source, as the card's are only while the card is.

Host tests, in carveout.zig and carveout_lend_test.zig (the second runs on Linux only):
the request's rows and their defaults, the key file's accepted and refused forms, the
key file left unopened for the drm source, and a fake daemon on a real SEQPACKET socket
for a granted claim, the descriptor by SCM_RIGHTS, a refused claim, a refusal that
carries a size, a malformed reply, a short grant, an ask between two slices, a missing
descriptor, a missing socket, a daemon that never answers, a daemon that has gone away,
the key file's line on the wire, and the daemon getting the memory back when the
connection closes.

zig/tests/fixtures/gradient-serving.tsv takes carveout.zig's new hash and a row for
carveout_lend.zig.

docs/recipes/cuda.md says what each source costs, measured on a GB10, and CHANGELOG.md
gets its Unreleased bullet.

Co-authored-by: bertholomus <311723197+bertholomus@users.noreply.github.com>
…aps into Vmm's own range

receive reads the reply before it looks for a descriptor. A reply with ok
false is DaemonRefused whether or not a descriptor came with it, and its
error text is kept in a Reason that the caller passes down through claim
and slab: the first 128 bytes, marked when the text was longer. Carveout's
refusal line prints it with every byte outside printable ASCII written as
\xNN, so a wrong key now reads "missing or unknown key" and a full
reservation "not enough free carveout", where both read DaemonRefused
alone before. A descriptor is taken before the reply is judged, so one
that comes with a refusal is still closed, and one that comes with a reply
cut at the buffer's end is now closed too, where it was left open in the
process.

Vmm.mapSlice maps the slice at the next free address of the range
Vmm.open reserved, which claim sizes to the grant, instead of reserving a
second range and leaving the first unused. A slice past the end of that
range is refused before any driver call. unmapSlice only unmaps, and
Vmm.close frees the whole range, as it does for the arena's chunks.

CHANGELOG.md's line names dispramd alone, gives the long-prompt cost
measured with it on a GB10 (a 108,012-token prompt took 35.6 s to prefill
against 22.4 s with the carveout off, and decode took 11.5 against 8.85 ms
a token, with the output unchanged) and ends with the pull request's number
and the thanks. docs/recipes/cuda.md says a refused claim's line quotes the
daemon's reason, escaped and cut at 128 bytes.

Host tests: a wrong key and a full reservation, each refused with the
daemon's own text as the reference daemon sends it, and closing the
connection after it; a reason with an escape sequence and a C1 control,
longer than is kept, written escaped and marked as cut; a grant without
a descriptor, refused with no reason to report; the descriptor sent with
a refusal, and with a reply longer than the buffer, closed; the reason
reaching claim's caller. In arena.zig: a lent slice mapped at the start of
the range open reserved with no second reservation, the handle released, a
slice past a full range refused before any import, and an unmap that frees
no addresses.

The host tests' openFds reads getdents64 into a dirent64-aligned buffer.

zig/tests/fixtures/gradient-serving.tsv takes the new hashes of
carveout.zig and carveout_lend.zig.
The tower's tensors load as plain BF16 [n, k] matrices for cuBLASLt:
fc1 and fc3 stacked into one gate|up projection, and the patch weight
flattened to 588 columns and zero-padded to 592 so its rows meet the
library's alignment. Every vision_tower tensor is consumed, the device
bytes count the padding, and a failed load drains its uploads before
any buffer is freed.
--
2.54.0 (Apple Git-157)
--
2.43.0
--
2.54.0 (Apple Git-157)
--
2.43.0
The drain test called settle directly, so dropping the errdefer in
load, or registering it before the tower's own errdefer, would stay
green. A host test now runs load on a sparse checkpoint against a
fake device whose first upload's wait fails: the buffers must go only
after the context proved the copies done. The sparse checkpoint
helper moves to its own test file so the tower's tests can share it.
--
2.54.0 (Apple Git-157)
--
2.43.0
--
2.54.0 (Apple Git-157)
--
2.43.0
The dense engine's Tower contract gets its first real tower:
dots.mocr's 42-block image tower, which turns merge-ordered patches
into the decoder's rows at the rounding points of the HIP port and
of Transformers. The tower reuses the shared vit GEMMs, attention,
LayerNorm and linears, the engine's norms and SwiGLU, and the new
vision rotary and patch bias launches. It holds one call's scratch
at the processor's 57,600 patches and taps every stage for the
oracle's comparison. Host tests pin the contract, the exact weight,
scratch and open bytes against a sparse checkpoint, the rotary
inv_freq fixture, the refusals' words (the budget's naming
--vision-image-tokens, the flag the CLI accepts), the grid checks
and the patch rows; the recipe declares the tower in its own change.
The tower needs device checks that the host suite cannot run, so
tf-cuda-test gains two dots commands behind one dispatch line and a
dots-help that prints their usage. dots-stages encodes one image with
a tap that writes every stage's rows as BF16 .npy files for the
oracle's stages mode. dots-image encodes a generated page (the
processor fixture's pixel pattern, no file read) and an optional
image twice each, requires equal bytes, prints the merged rows' hash
and the time, and fails unless the page's hash equals its anchor, so
a tower drift fails without the Python oracle. The runner imports
the served dots module and its engine.
The vision-merged pin is a GB10 value, so another GPU's rows would
read as a tower drift. dots-image still encodes twice and requires
equal bytes everywhere, but on a device other than sm_121 it skips
the pin comparison and names that device's SM.
Two trailing comments ran past 120 columns (the dots runner import in
the CUDA build and a control line in the tower test); each now sits
above its line. The tower test also takes the sparse checkpoint dir
from the shared test helper instead of keeping its own copy.
The recipe now declares the tower, so the dense engine's tower
variant serves dots.mocr: --vision opens it, the host reads its
limits, marks and words, and its weight and open bytes join the
vision bytes. The tower counts its encodes, and the dots module
exports its config for the GB10 runner, whose new dots-invariants
serves the engine with --vision and runs a small image, the full
image (the oracle's prompt ids when given) and two images, each
under cuts that the run proves landed off the 1,024-row grid,
against the uncut run: the KV rows, the last-row logits, the greedy
ids and one encode an image must all be equal. Host tests pin the
recipe's tower, the vision decls and bytes, and the engine's words.
--
2.43.0
#2732's runner gains dots-text, so a decoder drift fails without the
Python oracle: three chat-templated prompts of our own (18, 578 and
2,537 ids, committed as fixtures/own-prompts.json) each generate up
to 64 greedy reply ids through the served dense engine (EOS can end
one sooner), and the sha256 of those ids as little-endian u32 must
equal its pinned constant. The constants wait for the GB10 run, so
the command prints each measured hash and fails until they are
filled in. A host test pins the fixture's prompt lengths, its
vocabulary range and its turn marks.
--
2.43.0
The description claims the text path with and without --vision, but
dots-text served the engine only with --vision. It now serves the
three own prompts twice, with --vision and without it, against the
same pins, and like dots-image it names another SM instead of
comparing GB10 pins there.
--
2.43.0
The fixture's ids could not be regenerated from the tree. The
fixtures README now names their source text, our own ownprompts.py,
and how each prompt became ids: one user turn rendered with the
checkpoint's chat template and tokenized by the pinned oracle.
--
2.43.0
--
2.43.0
--
2.54.0 (Apple Git-157)
--
2.43.0
--
2.43.0
--
2.54.0 (Apple Git-157)
--
2.43.0
--
2.43.0
--
2.54.0 (Apple Git-157)
--
2.43.0
--
2.43.0
--
2.54.0 (Apple Git-157)
--
2.43.0
The GB10 has no flash-attn, so oracle, score and text install a
stand-in for the tower's import, put the tower on SDPA and refuse
a block that is not VisionSdpaAttention; oracle and score record
the SDPA backend Torch picks, score teacher-forces image prompts
with the reference's pixel_values and image_grid_thw, oracle saves
BF16 tower taps (with the patch embed before its norm), the tower
rotary inv_freq fixture text and cos/sin, and decides once or
twice rounding of the patch bias, and a stages mode compares
native taps by max abs and BF16-ulp histogram; image references
now require pillow 12.2.0 and qwen-vl-utils 0.0.10, because
Pillow 13.0.0 changes the demo pixels from the fixture's hash. The
image modes (oracle, stages and score's pixels) move to
dots_mocr_images.py, which the reference script loads by its path,
so python -I runs it from any directory, and each file keeps room
under the 600-line limit.
Gate 2 asks each changed reduction order to be no worse than Torch's
BF16 matmul against FP64 on the same device inputs, so the dense
pass and the dots tower gain an optional tap on each projection's
input and output rows. Served passes leave the tap null. The new
dots-projections runner command encodes one image and prefills the
image prompt's first chunk with the taps set. It writes every input
row, sampled output rows and each fused class's separate GEMMs for
the tower's patch, blocks 0, 20 and 41 and merger, and for the
decoder's first and last layers and head. tools/zig/
dots_projection_check.py computes FP64 products and Torch's layers
as Transformers calls them, and fails a class past one BF16 step
plus the FP32 sum's error, worse than Torch's worst column, or with
a fused part off its own GEMM; a missing class also fails.
The oracle put the tower on SDPA on every GPU, so HIP image
references made with flash-attn would differ in the tower from the
ones behind the HIP numbers. The tower now follows --attention when
flash-attn is installed and falls back to SDPA only without it, and
only an SDPA tower refuses blocks that are not VisionSdpaAttention.
oracle and score gain --sdpa-backend auto|math: math turns flash,
memory-efficient and cuDNN SDPA off, as the math-backend reference
needs, and both record the choice in their output.
A trailing comment ran past 120 columns; it now sits above its line.
The oracle's help and the image module's docstring still promised an
SDPA tower, though the tower now follows --attention when flash-attn
is installed; both now say so, with SDPA as the fallback.
@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

Stopped at #3218.

@ashhart ashhart closed this Nov 20, 2026
@ashhart
ashhart deleted the lead/train-1120085007 branch November 20, 2026 11:51
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