Repository navigation
Conversation
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.
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.
The Metal and residency builds give qwen27 its own core roots, which lacked image_rows after the shared module moved into core.
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.
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.
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.
Load Mini's packed attention projections and routed experts on CUDA. Validate projection widths against the pack metadata and size admission from the text shards that the engine loads.
Maxrio9
force-pushed
the
inkling2-mini-exl3-pack
branch
from
November 24, 2026 22:38
2b5e21c to
2947678
Compare
This branch has not been deployed
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.
What this changes
Inkling 2 Mini on CUDA serves only the ModelOpt NVFP4/MXFP8 checkpoint today. With this PR it also serves text from a stock exllamav3 1.x EXL3 pack (
mul1codebook), on one GPU, using the EXL3 reader from #4841 and the core grouped expert kernels from #4127:The five attention projections of each layer load as EXL3 and run on core's
exl3.Dense; routed experts load as EXL3 and run on core's grouped kernel with the capped SwiGLU epilogue, with mixed per-expert widths read from the pack.Each projection's width is checked against the pack's per-tensor metadata before a byte is uploaded; mismatches are refused by name.
Admission sizes the weight arena from the text shards the engine actually opens (the drafter and vision files are not counted).
The NVFP4 path is unchanged in behaviour (same tokens, same speed, same memory; see below).
tf-inkling2-mini-exl3-testadds a mixed-width grouped-expert contract at Mini's shape (with planted controls) and a teacher-forced check on fixed histories.Issue: Refs docs: a plan for Inkling 2 Mini on CUDA and Metal in claimable slices #4274 (Mini plan) and Inkling 2 Small on four DGX Sparks: a native CUDA family #3476. No separate issue: the Mini plan covers the stored NVFP4 checkpoint, and this adds a second stored format on the same family without new arithmetic. Opened as a draft so it can be discussed before review.
Stacked on: Inkling-2-Small: Serve on two GB10s from an EXL3 pack #4841's loader commit (
inkling2: load standard exllamav3 packs with two-rank cuts) and Inkling-2-Small: Add grouped-expert and vision kernels #4127 below it, rebased onto main9a38b1f7bwith their authorship kept. Only the last commit,inkling2 cuda: serve Mini from a stock EXL3 pack, is new here. Inkling-2-Small: Serve on two GB10s from an EXL3 pack #4841's later serving commits are not needed and not included. One rebase conflict with main was resolved inzig/tests/cuda/contract_inkling2_experts.zig(Inkling-2-Small: Add grouped-expert and vision kernels #4127's two projections plus main's 13 ModelOpt cases). I'll rebase onto Inkling-2-Small: Serve on two GB10s from an EXL3 pack #4841/Inkling-2-Small: Add grouped-expert and vision kernels #4127 as they land.atc overlap --json(ATC 0.9.6, baseupstream/main9a38b1f7b, 2026-11-24 22:37 UTC, coverage incomplete: 151 overlaps checked, 141 unknown, 2 clean, 8 conflicts). The conflicts are Inkling-2-Small: Add grouped-expert and vision kernels #4127 (inherited: this branch carries it) and CHANGELOG/shared-file conflicts with lfm3: serve LFM3-1.7B on CUDA: NVFP4 and FP8 weight-only, MLX 4-bit (stacked on #1513, #1492 and #1503) #1508, Nemotron 3.5 Transcribe: audio input, the 65,536-token window, an hour of audio, MTP drafts #1632, lfm3 CUDA: serve the block FP8 export weight-only and the MLX 4-bit export as stored (stacked on #1508) #1634, Implement GLP control vectors with a fused Metal kernel for Qwen3.8-27B #1835, Flash Next: config-driven top-k and shared expert width #3523, qwen27 metal: draft SenseNova-Loop-9B with published mtp.safetensors (MTP) #3868 and CUDA: an int4 W4A16 kernel for GPTQ group-128 routed experts and the LM head #4183, none in the Mini EXL3 files of this commit.Checks on this head
2947678a4. Measurements ran on2b5e21cb9;2947678a4only adds this PR's number toCHANGELOG.md.tools/pr_check.py --base upstream/main: 0 errors.zig build -Dfixed-cpu test-host --test-timeout 20m: 2554/2554 steps, 22709 passed, 146 skipped, 0 failed.zig build test-cuda-host: 493/493 steps, 7575 passed, 37 skipped.zig build test-inkling2-cuda-host: 62/62 passed.zig fmt --check build.zig zig,git diff --check: clean.zig build fatbins kernel-contract-fatbins -Dsm=120,121: 372/372 steps.Receipt
Main against branch: NVFP4 checkpoint on main and on this branch, six alternating server starts; EXL3 only on the branch (main refuses the pack).
Boxes it reaches: one NVIDIA RTX PRO 4500 Blackwell 32 GB (sm_120). Compiled for sm_120 and sm_121.
New switch: none.
Environment: main
9a38b1f7b, branch2b5e21cb9; Zig 0.17.0, nvcc 13.4.92, driver 615.78.08, Linux 7.2, x86_64, 32 GB RAM class. Checkpoints:thinkingmachines/Inkling-2-Miniated40e7da(NVFP4), andMaxrio/Inkling-2-Mini-exl3branch3.3bpwatb57f9b6c(EXL3, 3.3 bits per weight on average, mixed per-expert widths). Drafts off,--parallel 1,--context 8704,--prompt-cache-gib 0.Paths and platforms: the Mini CUDA loader, admission and forward (
cuda_native,loop_engine,loop_weights) for both formats. Ran sm_120; sm_121 compiled only on this head.Exactness:
bench_concurrent.py --levels 1,4 --alone --serial: 3/3 equal at one stream and 12/12 at four requests for both prompts. With one advertised stream the four requests queue, so the concurrent check is vacuous, as is the drafted check (drafts off).SUMMARY Mini mixed-width EXL3: 3/3 shapes bit-equal, 3/3 planted controls caught).Decode speed before and after, from
tools/bench_openai.py --tokens 256 --reps 3 --temperatures 0, NVFP4, tok/s medians per start, in run order:Main's first start was about 3% faster than every later start of either build; starts 2 to 6 agree within 0.4%. Means: main 26.31 / 26.44, branch 26.02 / 26.18.
EXL3 on the branch: 69.78 and 69.65 tok/s (256 tokens, one stream), and 69.5 / 67.1 tok/s at one stream in
bench_concurrent.py.Prompt speed before and after: cold first request at 8,192 prompt tokens,
tools/bench_cache.py --require-cold, 0 cached tokens. NVFP4ttft_smain 15.65 / 15.69, branch 15.68 / 15.66 (alternating starts). EXL3 on the branch: 3.43 s.Memory (
/v1/memorypeak): NVFP4 20,547,927,576 bytes on both builds; EXL3 14,861,091,864 bytes.Licence of any new weights or drafter: n/a, no weights shipped. The EXL3 pack keeps the Apache-2.0 licence of the original model.
The full Mini EXL3 work this was split from (DSpark drafts, CUDA graphs, several streams on the shared forward from #4786) is on the fork branch https://github.com/Maxrio9/TensorFold/tree/inkling2-mini-exl3, with release builds at https://github.com/Maxrio9/TensorFold/releases/tag/inkling2-mini-exl3-v1. Those parts depend on open PRs (#4128, #4786, #4858) and are not part of this PR.
Thanks to @ajensenwaud for the EXL3 reader and grouped expert kernels this builds on, and to @jschmied for the Mini loop-gate split already on main.
Checklist
"draft": false, a resumed prompt equals a fresh one, and concurrent equals solo. (Concurrent equals solo at queued four requests; drafted and resumed paths are not exercised for EXL3 here.)--drafter, no slower than without it, greedy and sampled. (NVFP4 one stream as above; one stream is the widest admitted at these settings.)