Repository navigation
Conversation
Every Inkling 2 CUDA kernel but the EXL3 expert epilogues now also runs at Inkling 2 Mini's one-rank shapes (hidden 2,304, 24 over 8 key heads, k/v width 1,024, 128 experts top 8, floor 8,192, one 201,024-wide vocab row), each with its planted control. No kernel source changes: the widths were already arguments. Small's registrations keep their names, shapes and seeds. Host checks refuse what the kernels cannot hold, by name: Inkling2MixWidth, Inkling2RouterShape, Inkling2ConvHeads, Inkling2Heads.
Open
1 task done
plotarmordev
added a commit
to plotarmordev/TensorFold
that referenced
this pull request
Nov 22, 2026
…tates (C4d) and the experts' round_caps A/B switch
…SwiGLU in core Core grouped experts gain Format.mxfp8 (e4m3 codes times one E8M0 scale per row per 32 inputs, folded exactly into the bf16 mma operand, fp32 sums) and Layer.caps, Inkling's soft-capped SwiGLU epilogue (experts.cuh epilogue 4) on the NVFP4 decode and prompt kernels and on the new MXFP8 ones. NVFP4's per-expert factor is amax / denominator, each rounded to bf16 (experts_mx.nvfp4Factor, open question F1). Evidence: stored-experts contract 9 kernels pass gates 1-4, 7 short-K controls red; checkpoint layers 0 and 20 decode bit for bit on every weight of 128 experts, outputs within the fp32 bound; SASS of all 465 pre-existing (unit, sm, function) triples equal main on sm_80/86/89/120/121.
… checked on the GPU experts_mx.splitGateUp takes stored row 2j to gate j and 2j + 1 to up j before packGateUp (the kernels are unchanged); a host test plants a code in stored row 1 and requires it in the up part. The checkpoint reference reads row 2j + m. stored-experts ckpt adds E8M0 bytes 0 to 240 through tf_mxfp8_down_f32 against the host decode (byte 0 = 2^-127).
…dule on it core/visit_plan.zig walks prelude, core x passes and coda, numbering each state kind's slots in run order, with enter/leave per pass and taps as step inputs or the post-norm output. Dory's schedule.build now uses it; its Step, Schedule and tests are unchanged (test-dory-host 43 pass, 3 skip, same as main).
…an, controller and cross-pass names inkling2_loop parses its loop_config (is_varloop refused, core in whole blocks, passes >= 2, rank <= 128) and counts the drafter's taps by visit. The plan walks the visits through core/visit_plan.zig with a sliding, full and conv slot kind. names.zig adds the four controllers a core layer and the two cross-pass query tables; each layer's expert precision stays read from its w13 dtype. The quantization_config goes through core.modelopt (admitByTensors, std-only modelopt_config.zig split out so host-only tests import it). Fixtures: Mini's config.json and its two headers folded (1244 + 54 tensors, sha256 of the unfolded lines).
…ates, core experts Weights load layer by layer through core.checkpoint (ModelOpt admitted by core.modelopt). Experts run as core cuda.experts: NVFP4 in L0-19 and MXFP8 in L20-23. Each stream holds 48 visit slots (40 sliding, 8 full, 48 conv). The loop mix and controller gates (loop.cu) stand in for C2/H3 and use ashhart#4337's arithmetic. A float64 host reference (mini_ref.zig) checks the greedy tokens. tf-cuda-test inkling2-mini runs on the real checkpoint: - greedy output is coherent; - a prompt cut into chunks of 1 or 7 gives bit-equal last-row logits and equal tokens; - 4 streams together give the same tokens as each alone.
…): inkling2_loop, text only Each stream gets a cache slot of 48 visit slots. A prompt takes one 512-row chunk a step. A round runs one-row windows over every stream in a single forward. It offers no drafts and no copies: a conv state has no rollback here. Refused by name before any load: --loops (the pass count comes from loop_config), a drafter (C5) and captured kernels. A prompt holding the image token is refused (C6). Streams are fitted to the room at open, as in Dory.
…ates spread over the GPU - Decode forwards of n one-row windows replay as CUDA graphs keyed by n. - A one-row forward runs q, gate, rel, sink (and k, v when they share the input) as one product. It uses a single packed buffer per layer, with views pinned to the parts' own K slices, so the bits are unchanged. - Before this, the loop gates ran on 1-3 blocks at decode, about 35% of GPU time. They now spread over rank and output blocks. Each output keeps its summation order. Greedy ids on the real checkpoint are identical to C4a. c=1 is 22 -> 33 tok/s, c=4 63 -> 79 tok/s. The server's default drafts flag is no longer refused: there is no head, so nothing is drafted. The tiny checkpoint's 128-wide rel_logits_proj is zero-padded to the kernels' 1024. Mini's is uploaded as stored. tf-cuda-test inkling2-mini-xcheck compares top-2 logits against ashhart#4337's Metal forward on prompts teacher-forced on another engine's tokens.
…A/B switch Prompt-cache states: - A stream's state at a prompt mark holds each of the 48 visits' K and V: the full caches through the mark, and the sliding rings' last 1,023 positions. It also holds every visit's four conv states. - The states are saved and restored through the native store's snap_* hooks. - tf-cuda-test checks restored == fresh bit-equal. Its planted control restores another prompt's state and goes red. The round_caps A/B switch: - experts.Layer.round_caps rounds the gate and up sums to bf16 before Inkling's soft caps, in the EPI 4 epilogue (a negative up cap). It is off by default and the default bits are unchanged. - The float64 reference and the tests take INKLING2_ROUND_CAPS=1. - On the tiny checkpoint it does not close the one CUDA-vs-Metal top-1 difference outside Metal's tie list.
This was referenced Nov 22, 2026
jschmied
force-pushed
the
inkling2-mini-c4
branch
from
November 22, 2026 21:41
dc2ca8a to
7912af5
Compare
plotarmordev
added a commit
to plotarmordev/TensorFold
that referenced
this pull request
Nov 23, 2026
… drop ashhart#4387's loop engine and port its serving checks ashhart#4387's separate loop engine advertised structured output it always refused and duplicated ashhart#4441's registered path. Its draws, resume and two-stream checks now run against ashhart#4441's Mini; copy drafting is not checked, as that engine has no draft path.
plotarmordev
added a commit
to plotarmordev/TensorFold
that referenced
this pull request
Nov 23, 2026
…s at one stream, 117.8 at four
Contributor
Author
|
Closing as superseded. Mini on CUDA now goes through #4387's engine: #4640 for correctness, and #4697, #4718, #4728 and #4729 for speed. Those four take it from 5.6 to 28.2 tok/s stacked, bit-equal to #4640, and a PR sharing one forward across streams follows. This stack would be a second Mini engine beside it (see #4387, comment 7092191800). The branch stays on my fork, so it can be reopened if a piece of it is wanted. The likeliest candidate is #4365's core NVFP4/MXFP8 expert entries, if Mini or another family moves onto core experts. |
plotarmordev
added a commit
to plotarmordev/TensorFold
that referenced
this pull request
Nov 24, 2026
plotarmordev
added a commit
to plotarmordev/TensorFold
that referenced
this pull request
Nov 24, 2026
… of origin/main brought back unreachable ashhart#4441's engine serves inkling2_loop here (as 9f542e6 decided); the merge re-added cuda_native, loop_* and the loop_math image and contract tests without wiring them.
plotarmordev
added a commit
to plotarmordev/TensorFold
that referenced
this pull request
Nov 24, 2026
's engine Ports jschmied's crossPrompt check (c79a58f) from origin/main's serving tests.
4 tasks done
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.
Proposal for review (draft). Inkling 2 Mini served on CUDA at one rank, text only: slices H2 and C4 from #4274. It is the engine behind the numbers in my comments on #4387. Head
7912af56d0, rebased onto main14951bc65don the user's request (wasdc2ca8a178on main1587c8caee).Stacked. This branch merges the two drafts unchanged: #4364 (C1,
aeb9cb06c3, not rebased: main changed none of its files) and #4365 (C3, rebased tob2cea56fe6), in the twolocal: stackmerge commits. The new work is the six commits from4845a7e720to7912af56d0. Base: main14951bc65d.What the rebase changed (besides the merge bases):
gradient-serving.tsv:dc2ca8a178left three rows stale (cuda/kernels.zigfor theinkling2_loopimage,experts.cuhandcuda/experts.zigfor theround_capsswitch), sotest-gradient-servingfailed there. Each row now takes its file's sha256 in the commit that changes the file (C4a, C4d).core/profile.zigcuda_cacheanddocs/profiles.mdnameinkling2_loop: Mini hassnap_save, and main'scuda_keep_others_testrequires every CUDA family with a host prompt cache in theTENSORFOLD_PROMPT_CACHE_KEEP_OTHERSrow (it failed ondc2ca8a178too). The same list scopesTF_CACHE_EVICTon CUDA, so Mini now takes both switches like the other cached families. Both are off by default.tools/zig/lean_check.py's multi-line rule;dc2ca8a178had 37 new findings with C3's), andzig fmtapplied (@intFromEnumto@backingInt, table alignment) in the commits that added them; no code line changed.What it adds
core/visit_plan.zig: a looped stack's steps and state slots (layer, pass, slot per state kind, enter/leave), withvisitOfTap. Dory's schedule moves onto it with no behaviour change; Mini is the second caller. This is the core visit plan proposed in docs: a plan for Inkling 2 Mini on CUDA and Metal in claimable slices #4274.loop_configparsing;core/visit_plan;core.modelopt(admitByTensorsadded there), with the MXFP8 layers 20-23 identified from tensor dtypes.families/inkling2/mini_*):src/cuda/experts.zigthrough cuda experts: Inkling 2 Mini's stored NVFP4 and MXFP8 experts in core (C3, proposal) #4365 (NVFP4 and MXFP8, soft-capped SwiGLU);lanes.Backendwith 4 slots, and the native registry entryinkling2_loop;snap_*hooks: K/V of all 48 visits through the mark, the sliding rings, and every visit's conv states.--loops: Mini runs the passes itsloop_confignames;rel_logits_projwider than 1024 (Inkling2RelExtent).visit_plan,checkpoint/copy_source,modelopt;cuda.expertswith itsRouterand MoE glue,dense_rows;cuda.graph,lanes.Backend, the native registry;Loop kernels are a stand-in.
families/inkling2/loop.cuandloop.zig(gates and cross-pass messages) follow #4337's arithmetic only so the model runs end to end. They are akol1's H3 and atakann's C2 in #4274, and are meant to be replaced by those slices when they land; I am not claiming them.Evidence (GB10, sm_121, nvcc 13.0, original checkpoint
ed40e7da)Rerun on this head
7912af56d0(main's core code under the engine moved, #4493's expert kernels among it;tf-cuda-testmd5a649f696):inkling2(C1's Mini shapes on main's kernels)b15dd116b0's served run; repeated request equal; 4 concurrent == solo; image part 400;--loopsrefused by nameCarried from
dc2ca8a178(not rerun): the planted reference control (messages dropped in the float64 reference: 1 of 16 tokens differ, red), and the Metal cross-check below.Cross-check against #4337's Metal build (
8606b655d6), tiny checkpointee242a48, teacher-forced on Metal's 48 ids per prompt:Speed (served, greedy, 256 tokens,
--no-drafts, A-B-B-A pairs, 4 per cell). The rows were measured ondc2ca8a178; the rebase moved no code on Mini's decode path except the cache-family list, and one served run on this head gives the same figures:dc2ca8a178(A-B-B-A, carried)7912af56d0(one served run, not A-B-B-A)NoFreeSlot)This is still below the vLLM bar, so don't land yet on speed. Where the time goes now:
tf_ink2_mix4.2 % (one block per row at decode).Not in this PR (stated, not hidden)
tf-cuda-testrestored == fresh check above covers it.reasoning_contentcarries raw markers until server: split Inkling 2 replies into reasoning, text and tool calls #4124 lands.Lint and host tests on this head:
pr-readygives 0 fail.tools/pr_check.py: 0 errors, lean 165 vs 165, 0 new;zig fmt --check: clean. GB10:test-cuda-host,test-inkling2-cuda-host,test-inkling2-host,test-visit-plan-host,test-dory-host,test-gradient-servingpass. x86:check-native-cuda-host,compile-cuda-tests,test-host,test,test-golden,test-kernel-contract,test-server-security,test-pull-security,fuzz-cortheon,check-release-pathspass, exceptrequest_admission_http_test"every way an n-choices request ends returns its places". That test fails on main14951bc65don the same x86 box and passes on reruns of this head (x86 once, GB10 three times, the binary alone five times), so it is main's flaky test. Merges cleanly with main14951bc65d.Proposed CHANGELOG line:
- Inkling 2 Mini serves on CUDA at one rank, text only: 48 loop visits on core/visit_plan, NVFP4/MXFP8 experts in core cuda.experts, graphs and prompt-cache states (#4364, #4365, this PR).