Skip to content

train 1119193444: #2772 (CI only) - #4051

Closed
ashhart wants to merge 20 commits into
mainfrom
lead/train-1119193444
Closed

ashhart wants to merge 20 commits into
mainfrom
lead/train-1119193444

Conversation

@ashhart

@ashhart ashhart commented Nov 19, 2026

Copy link
Copy Markdown
Owner

CI for a landing train: #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.

laudney and others added 20 commits November 19, 2026 19:32
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
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
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.
#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.
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.
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.
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 19, 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.

2 participants