Repository navigation
Inkling-2-Mini: Serve on two GB10s with images and 1M context window - #5059
ajensenwaud wants to merge 42 commits into
Conversation
|
Thanks @ajensenwaud. The visit slots, rank slicing and routing boundaries are in place, and the shard/config ready binding is retained. The live gate still needs main's ascending 64-term order: eight chunks plus a tree can change its FP32 result before tanh. Please also hash the optional loop as a presence tag and scalar fields rather than raw storage. After those fixes, the remaining evidence is exact same-checkpoint one-rank/two-rank tokens and logits on the final tree, with the advertised image/window cells and complete run identities. Noise-floor agreement does not close that gate.
|
|
Thank you, @ajensenwaud. The two correctness fixes are confirmed: the live gate now uses main's ascending 64-term FP32 order, and the ready digest hashes the optional loop's presence tag and scalar fields rather than its storage. Rank routing, visit cache slots and the virtual-rank exchange paths also look consistent. One source cleanup is still needed. These added comments exceed 120 columns:
Please wrap or move those comments without changing the code. The remaining qualification is final-tree, same-checkpoint one-rank/two-rank token and bit-identical logit evidence, plus the actual image, full-window and four-stream window cells. The noise-floor comparisons alone do not close that exactness gate.
|
|
Thanks, Ash. These are on
ResultsRun on 26 November 2026, 02:12-02:54 UTC, on two DGX Spark (GB10) nodes, driver 580.178.04. Head Exactness cells. Each cell ran
The 1M cell includes a 40,000-token prompt of TensorFold source. The image prompt has 1,049 tokens, 1,024 of them picture rows (picture sha256 Kernel contract. The previous head Parity. Logits move with the new order, so the TP=2 gate was rerun against the exllamav3 answer key and noise floor (five 1,024-token texts):
Prompt rows equal decode rows and four streams together equal each alone on 10 of 10 text-rank pairs. Whole prompts, 128-row chunks, 37-row chunks and decode rows are byte-equal on 10 of 10. Graph replay equals eager on 46 of 46 steps. Compiled code. On nvcc 13.0 and 13.3, for sm_80, 86, 89, 120 and 121, Blend time. Microseconds a launch inside a CUDA graph; cold reads rotate 16 copies of the weights. Every case also checked the new blend against main's chain bit for bit.
|
|
Thanks, Ash. The seven comments now sit on their own lines in |
|
Thank you, @ajensenwaud. All seven comment-width fixes are confirmed. The new commit changes comments only; no executable code changed, no added comment exceeds 120 columns, and every changed Zig file remains below 600 lines. The gate-order, ready-digest and routing fixes remain intact. No new source defect was found. SAFE TO A/B. The same ten integration conflicts remain and must preserve both sides' registry, profile, tests, notices and fixtures. Your real-versus-virtual token and per-rank logits hashes are useful evidence, but virtual mode still runs the split engine rather than main's one-rank engine. The smallest remaining exact cells therefore compare the actual one-rank engine with real TP=2 on the same checkpoint, including full reconstructed logits. For the full-window proof, fill each window exactly: one 1,048,544-token prompt plus 32 decoded tokens, and four 131,040-token prompts plus 32 decoded tokens each. Include eager/graph and concurrent/solo equality. Finish with the recorded actual-image prompt, exact repeated tokens,
|
|
Thanks, Ash. Before I build the one-rank cells, I have one question about which engine you mean.
Does the second option meet the gate? |
|
Thank you, @ajensenwaud, for the careful measurements and for laying out the one-rank options so clearly. The ascending 64-term gate order, canonical ready digest, routing boundaries and seven comment-width repairs are confirmed at the current head. Its final commit changes comments only, and I found no new executable defect. Yes, your second option is the right same-checkpoint gate. A serial one-rank mode in this EXL3 engine can be the reference, provided it preserves the two-rank computation rather than replacing it with a one-pass equivalent. It must execute the same partial computations, combine rank 0 then rank 1 in the same order and at the same rounding points, and reconstruct the two padded vocabulary spans separately. Compare tokens and every reconstructed FP32 logit byte for byte, with no tolerance. The two existing virtual world-two engines are not that serial reference. The new reference mode should be opt-in and leave ordinary one-rank routing and the two-rank path unchanged. The remaining cells are the filled single window, four filled concurrent windows, and the real image prompt, all against real two-rank execution on the integrated tree. Include eager against graph, concurrent against solo, repeated tokens, This was a read-only review; no device run is promised.
|
69e99c2 to
e320b46
Compare
The family's attention was a copy of prefill_attention.cu's vision_kernel, so the tower now calls vit.Attention.full at head dim 64, the instance and record Qwen3-ASR already brought to main.
grouped_body takes the member tiles a program as a template parameter. tf_exl3_grouped_wide_2 runs 32 members by 64 columns for prompt chunks; the existing instantiations compile to the same SASS on every SM.
nvcc 13.3 changed tf_exl3_grouped_2's sm_120 and sm_121 SASS when the wide instance followed it; defined first, every existing kernel compiles as before under 13.0 and 13.3.
The item plan was limited to mcg and slot rows written to ey. It now takes every codebook, writes scratch y when ey is 0, picks the wide kernel for 32-member items and the capped epilogue for act_mode 3.
The family's grouper and grouped projections were copies of core's. Inkling now runs exl3_experts.runWith on grouped.Router's item plan, 16-member items below 512 rows and the wide kernel from there; outputs are bit-equal to the kernels this replaces. Expert widths up to 8 bits are admitted, as core decodes them.
tf_ink2_gateup duplicated core's gate/up epilogue apart from the softcaps, which core now runs as act_mode 3. Its registration moves to tf_exl3_gateup_capped, with the swapped-caps control kept.
RADIO, MiniMax M3, Qwen 27 and Inkling 2 each kept their own copy of the placeholder span and the cut that maps a prompt pass onto it. They now share core.image_rows, started from RADIO's copy, and each family keeps only its own splice. The cut now works in usize and takes the offset before adding the buffer row, as RADIO's did. MiniMax M3 and Inkling 2 already cut in usize, so their results are unchanged. RADIO and Qwen 27 no longer overflow u32 on a span that ends past 2^32; nothing else changes.
Inkling 2's tf_ink2v_scale_add was a layer-scaled residual add, which is tf_vit_pointwise with a per-column scale between the activation and the add. vit.cu now has tf_vit_pointwise_gamma for that, and the tower calls it through vit.Kernels.pointwiseGamma. Its fp32 multiply, bf16 rounding and add are the same round-to-nearest steps the family kernel took, so the tower's results are unchanged. Every existing function in vit.cu and inkling2/vision.cu compiles to the same SASS on sm_80, 86, 89, 120 and 121 under nvcc 13.0 and 13.3. The contract now registers the core kernel, with the late-gamma control retargeted to it; its records come from cuobjdump -res-usage, and 13.2 stays pending.
The Metal and residency builds give qwen27 its own core roots, which lacked image_rows after the shared module moved into core.
Core builds exl3_experts.cu with contraction on, so the soft-capped SwiGLU's products and sum fused into FMAs, and Inkling 2 Small's tokens no longer matched the build it was validated on. Explicitly rounded operations give the SASS the old text has at the glue kernels' flags.
…ls, bit for bit With ashhart#4127, Inkling 2's softcapped gate/up epilogue and vision layer scale come from core (tf_exl3_gateup_capped, tf_vit_pointwise_gamma) in place of main's family kernels (tf_ink2_gateup, built at --fmad=false, and tf_ink2v_scale_add). A host test writes both kernels' arithmetic at their rounding points: every product and sum on its own, the same order, the shared rotation and the fp16 or bf16 store. Over 512 random 128-column blocks with saturating and non-finite inputs, and 65,536 layer-scale values, the old and new forms give the same bits. A control contracts one product into the rotation's first sum, as core's fmad=true flags would without the explicit _rn operations, and it differs, so the comparison can see one fused rounding.
Main added layer_norm_eps to the shared vision config, and the CUDA tower's test config no longer compiled. The tower now reads eps from the config instead of a constant; the release's 1e-5 is unchanged.
Reads an EXL3 pack from exllamav3 1.x on the mul1 codebook: every attention projection and the head as EXL3 linears, each layer's experts as one grouped layer, cut to a rank by key heads, columns or rows.
Rank 0 serves and sends every step to rank 1 over NCCL; the per-layer partial sums cross by RoCE writes. Decode rows from several streams share one graphed forward, prompts run in 2,048-row chunks with kept states at chunk starts, and images go through the vision tower. No drafter yet: a stream decodes one row a step.
The new map entry went in before pick scanned the lanes, so the scan read the entry's unset slot, and a failed pick left the entry behind. The slot is now chosen first and the entry added only once it has one.
checkpoint_digest stayed zero, so the ready check passed two ranks holding different packs. Each rank now hashes every shard byte beside the load and hands that digest to the check.
Buffers.deinit read ids and logits before init had made them. Both now start empty, and a fake-driver test fails each allocation in turn.
Two ranks with identical shards but different configs, such as another rms_norm_eps, passed the ready check. The digest now also covers the parsed config and the stream shape each rank was started with.
Engine.init cleaned up a stale copy of its modules, which never held the prompt projections. A failed kernel lookup leaked the GEMM workspace and a failed plan insertion leaked its descriptor and layouts.
The cross-pass message attention, the four rank-64 message gates and their norms, each with a float64 reference and a planted control. Their nvcc 13.0 records keep 13.2 pending, with the 13.3 receipt beside them.
Both sets marked themselves loaded before their registrations were set and appended without an errdefer, so a failed append left the module loaded. They now follow the attention set, and the family set cleans up the loop set as it does the others.
visits.zig orders Mini's 48 layer visits from the loop_config that config.zig reads: the prelude, three passes over the core with a cache slot per visit, then the coda. Drafter taps index visits. Small's plan is its layers in order.
The forward walks the visit plan with a cache slot per visit, so Small's plan is its layers in order and its launches stay the same. Core visits after the first pass mix in the previous pass's bank through the loop kernels. A rank whose rel columns miss the 128-wide EXL3 blocks projects r whole and copies its columns, and Mini's prompt rows keep the decode kernels. The CUDA host gives an inkling2_loop checkpoint to this engine only when two ranks are placed and the pack uses Small's tensor names. A one-GPU run and any other Mini checkpoint open on cuda_native.zig.
The ready digest hashed the optional loop config as raw storage, so its padding and an absent loop's leftover payload bytes reached the digest. Every config value now goes in as fixed-width little-endian scalars.
tf-inkling2-engine greedy --virtual loads both ranks' weights on one GPU and runs each rank's forward on its own stream, with the gathers done as copies between the two engines. Its tokens and per-rank logits hashes can then be compared byte for byte with a real two-rank run.
Each output's 64-term forget and gain dots now run as one fp32 fma chain from zero, handed lane to lane, so the blend's bits before tanh match main's gateUp. The contract checks the blend against a copy of main's chain, with the old eight-chunk tree as a control.
Main's config parser now refuses head_dim, swa_head_dim and d_rel by name before the kernels' limits are read, so the shape test checks those three cases there and the others through shape.parse as before.
e320b46 to
a956e22
Compare
|
Thank you, ajensenwaud. The ascending 64-term FP32 gate order, canonical ready digest, routing boundaries, head-width refusals and comment cleanup are confirmed. The newer changes retain those fixes, and I found no copied-code blocker. One implementation is still needed before the requested comparison can run. The current On the integrated tree and the same pinned checkpoint, the remaining evidence is exact tokens and every reconstructed FP32 logit byte between that serial reference and real two-rank CUDA execution, with no tolerance. Please include one 1,048,544-token prompt plus 32 decoded tokens, four 131,040-token prompts plus 32 decoded tokens each, eager against graph, concurrent against solo, and the real image request with exact repeated tokens, The rebase also needs to keep both sides of the two current conflicts: the expanded family registry together with the existing alias accounting, and checkpoint-sensitive routing together with the ordinary alias fallback. This was a read-only review. I ran no builds, tests or device checks.
|
Running Inkling 2 Mini on TensorFold's CUDA server today needs the whole model on one GPU and serves text only. This is because main's Mini engine runs on a single rank and refuses images, so a pair of GB10s cannot split the model or read pictures. This PR fixes that.
Stacked on #4841 and #4746; only the last three commits are new. Refs the Mini plan in #4274.
What this changes
TF_INKLING2_WORLD=2) and the pack uses Small's tensor names. A one-GPU run, Mini's own NVFP4 and MXFP8 checkpoint, and EXL3 packs in other layouts such as inkling2 cuda: serve Mini from a stock EXL3 pack (stacked on #4841) #4966's open on main's engine unchanged, so inkling2 cuda: serve Mini from a stock EXL3 pack (stacked on #4841) #4966 and this PR can both land in either order.docs/recipes/inkling-2-mini.mdlists the pack, the flags and the files.Checks on this head
zig build test test-gradient-serving compile-cuda-tests -Dfixed-cpupasses 862 of 862 steps, with 13,439 of 13,535 tests (96 skipped). An nvcc build for sm_121 passes.Receipt
stopand split into reasoning and answer. All 28 served cases give the same tokens as the earlier base's run.Run details
ajensenwaud/inkspark-mini-2dgxata2707bbdbfae47a66154dbd89603c546bf1fe634, EXL3 4.05 bpw.c358f605dlays out Mini's visit plan,5865de0a0serves Mini on two GB10s and holds the routing rule,77075cd48adds the recipe page.