Skip to content

Inkling 2 Mini on CUDA: #4387's engine loads the checkpoint, answers correctly (64/64 teacher-forced), serves --parallel streams, and resumes prompt-cache states exactly - #4640

Closed
jschmied wants to merge 24 commits into
ashhart:mainfrom
jschmied:inkling2-mini-cuda-fix

Conversation

@jschmied

@jschmied jschmied commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

Update for review 7098920791: head a28a170bb7

Point 1, the stream budget. stream_bytes reported only layout.bytes, but each extra stream also allocates its rewind-site table and, in the backend, a vocabulary row of last logits and a sampling rule.

  • loop_engine.slotAllocs and loop_backend.laneAllocs now size those four allocations. Model.newSlot and Backend.slotBuffers allocate through them.
  • loop_backend.streamBytes, which cuda_native.zig reports, is their sum. On Mini that is layout.bytes + 806,408: 48 × 4 × 32 for the sites, 200,058 × 4 for the row, 32 for the rule.
  • New host test (cuda_native.zig, in test-inkling2-cuda-host): a DeviceBuffer hook sums what newSlot and slotBuffers actually ask for. It pins stream_bytes to that sum, and pins the 806,408 bytes past the cache to the formula.
  • Red before: with streamBytes planted back to layout.bytes (the old report), the test fails expected 776392200, found 775585792, exactly 806,408 short.
  • The one layout test in loop_engine.zig that needs no CUDA moved to loop.zig, so the engine file stays under 600 lines.

Checks on a28a170bb7 (GB10, sm_121, CUDA 13.0, Zig 0.17.0):

  • Host: test-inkling2-host, test-inkling2-cuda-host, compile-cuda-tests, check-native-cuda-host: green.
    • test-kernel-contract has one failure. It is the registry test, finding the branch's existing 40 missing-resource diagnostics, the same 40 as on 3e0e9bcb83.
    • zig fmt and git diff --check: clean. pr_check --base 321432e4b2: 0 errors, lean 167 vs 167.
  • Kernel contract inkling2: 53/53 pass gates 1-4, 36 of 36 controls red, 0 limit problems. No .cu file changed.
  • inkling2-serving: all cases PASS.
  • Served (--parallel 4 --context 8192, page cache dropped, hashes cover reasoning and content):
    • greedy and seeded solo replies are identical to 321432e4b2's (9b35cbd7c284 …, 5b886d0faf27 …);
    • again and c=4 equal solo, 4 of 4;
    • long cold/warm dad96525689a;
    • turn 2 resumed == fresh fdb1da1ad592.
  • Speed: one A-B-B-A at c=1, A = 321432e4b2 (binary 019c09e6), B = this head (9fed8620). Best of 2: 5.624 vs 5.616 tok/s. Paired median B/A 0.9997, 1 of 2 pairs slower, so mixed, with no consistent change. SM clock median 2288 MHz in both arms.

#4724 is restacked on this head (e07853195e).


What this changes

Before: on lead/inkling2-mini (3e0e9bcb83) the CUDA engine does not load the released Mini checkpoint (PrecisionCount, then LoopWeightsOverflow). With those two load errors fixed, every reply is " \n\n\n…": teacher-forced on our float64-checked token stream, the top-1 matches 0 of 64. With --parallel 4, 3 of 4 concurrent requests fail with NoFreeSlot. After: it loads, the 64 teacher-forced steps match 64 of 64, inkling2-serving (your own test, which failed with MiniServingLogitMismatch) passes, and four streams serve at once, each equal to its solo run.

This is a proposal on top of #4387, like gilby's and sethforprivacy's Metal PRs on this branch. It is CUDA only. Take the commits in whatever form suits you. The defects were reported on #4387 in comment 1, comment 2 and comment 3. Fix 3 below is new: it is the residual drift those comments left open.

The five commits:

  1. Load (c0f151cb96).

    • cuda_native.zig:111: plan_.build gets precisions[0..c.text.layers]. It used to get the whole 128-entry array, so it failed with PrecisionCount on every checkpoint.
    • loop_weights.zig:203-208: a sliding layer's k and v inputs share one attn_norm.weight upload. The arena is sized to the checkpoint, so the second upload overflowed with LoopWeightsOverflow.
  2. Gate and sink raw (4c9b2738da), loop_engine.zig:395-396. Both ops.rowdot calls passed sigmoid = true. tf_ink2_merge (attention.cu:340-382) takes the sink as a logit and applies the gate's sigmoid itself. So the gate was squashed twice and a probability was used as the sink logit. That broke layer 0's attention output (cos 0.35 against our engine) and every layer after it. Metal (dense) and the CUDA attention contract both pass raw values already. Both calls now pass false.

  3. Cross-pass messages (e2b3acdc94), loop_math.cu:157.

    • The bug: tf_ink2_loop_messages wrote [row][core][role][c]. The engine (loop_engine.zig:365, core_layers = 1) and the gates read role r at messages + r * rows * c, which is plane-major. The two layouts agree for one row, so decode was right. Every multi-row prompt chunk went wrong from visit 18 on (the first visit of pass 2, the first visit with messages). That was the residual drift: cos 0.981 at visit 18, 0.72 by visit 47, top-1 58 of 64.
    • The fix: the kernel writes [core][role][rows][c]. It already received rows and ignored it.
    • The contract reference (contract_inkling2_loop_math.zig:267,304) now indexes the same way. Its one-row 12-layer shape is byte-for-byte the old layout.
    • inkling2_experts_records.zig:19: the kernel's registers are 36 now, recorded 40 before.
  4. A cache slot per served stream (7f4bc4c92c).

    • The problem: the backend held one stream. facts.max_streams = 1 is correct, because it means one stream per shared forward. But opening refused every second stream, while the host had counted and budgeted --parallel streams.
    • The fix:
      • Model (loop_engine.zig:100-146) keeps up to 16 slots, each with its own K/V and conv state and its own rewind-site table. m.slot selects the slot.
      • Forwards still run one stream at a time on the shared scratch. rewind refuses a slot other than the one the last recorded window used (loop_engine.zig:289).
      • Backend (loop_backend.zig) keeps a lane, a last-logits buffer and a rule buffer per slot. laneOf selects the stream's slot before every call.
      • Loaded.reserve (cuda_native.zig:55,76) takes the host's stream count. The host already prices stream_bytes * (streams - free_streams) and calls reserve. More than 16 is refused by name (Inkling2TooManyStreams).
  5. Prompt-cache states copied per key head (321432e4b2), loop_engine.zig:523-553.

    • The bug: copyState saved and restored K/V as [ring][kv_heads * dim] rows. The CUDA caches are head-major, [kv head][ring][dim] (attention.cu:87,197), so a state held part of head 0's ring and none of the others. gilby found the same class of bug on Metal in inkling2 metal: snapshot DSpark lane state for prompt cache #4542.
    • Why the existing test missed it: a resumed prompt only looked right because the slot still held that same prompt's keys. Its own fresh and resumed test passes that way.
    • Served, it was wrong: after "the violin's origins" (which shares the 14-id system prefix), "the history of the bicycle" resumed at 26 cached ids answered about the violin. That reproduces on 3e0e9bcb83 + the load and gate fixes with one slot, so it predates this PR.
    • The fix: copyState now walks each key head's ring. snapshotBytes is unchanged.
    • New test crossPrompt (inkling2_serving_tests.zig): A keeps states at 14 and 39; B, sharing A's first 14 ids, resumes A's 14, keeps its own 39 and decodes; then A resumed at 39 must equal fresh A, logits and tokens. It is red on commit 4 (MiniServingTokenMismatch, fresh 196982, 64, 152304… vs resumed 197041, 198, 220…) and green on this head.

Checks on this head

  • Head commit: 321432e4b2, on 3e0e9bcb83. GB10 (sm_121, CUDA 13), Zig 0.17.0, thinkingmachines/Inkling-2-Mini@ed40e7da.
  • Host:
    • zig build test-inkling2-host test-inkling2-cuda-host compile-cuda-tests check-native-cuda-host: 24/24 steps, 86/90 tests passed (4 skipped).
    • zig fmt --check build.zig zig and git diff --check: clean.
    • tools/pr_check.py --base 3e0e9bcb83: 0 errors. Lean 167 vs 167, 0 new.
  • Build: zig build install native -Dnvcc=/usr/local/cuda/bin/nvcc -Dsm=121: OK.
  • Kernel contract: tf-cuda-test kernel-contract inkling2: SUMMARY 53 kernels: 53 pass gates 1-4, 0 fail, 0 known findings; 36 controls: 36 red as planted, 0 missed; 0 limit problems, exit 0.
    • tf_ink2_loop_messages passes nonfinite, repeat, sums and shapes (1×12 layers, 16 and 2048 rows) on the new layout.
    • Its planted control (both banks wired to bank 0) is red as planted.
  • tf-cuda-test inkling2-serving (your test, 9,810-id prompt file): exit 0, all six cases PASS:
    • "matches the host reference token for token" (failed on 3e0e9bcb83 + the two load fixes with MiniServingLogitMismatch);
    • "fresh and resumed prompts produce identical logits and tokens";
    • "one-slot admission serializes concurrent requests" (before reserve);
    • new: "four slots: concurrent greedy and seeded replies equal solo, a fifth is refused" (inkling2_serving_tests.zig:157). Four prompts of 8 to 2,100 ids (one spans two 2,048-row chunks) run interleaved through the lane engine, greedy and seeded (seed 37, T 0.8). Each equals its solo trace token for token.
      • The refusal: with four slots busy, fits is false and a fifth prefill returns NoFreeSlot with fill_at still 0, so nothing of it ran.
      • Red before: on 3e0e9bcb83 this is the NoFreeSlot that 3 of 4 served requests hit.
    • new: "a state resumed after another prompt resumed its prefix equals the fresh prompt" (commit 5; red on commit 4).
    • "opt-in copy drafting preserves target tokens and rolls back exactly".
  • Served (tensorfold-native serve --parallel 4 --context 8192, page cache dropped, 128 tokens; hashes cover reasoning and content, and an empty reply fails):
    • Four topics, 128 tokens each, greedy and seeded (T 0.8, top_p 0.95, seed 37+i), with the server's default copy drafting on (it accepted 1 to 3 drafts of 15 per reply) and the prompt cache on:
      • greedy: solo == again 4/4, and solo == four at once 4/4;
      • seeded: solo == again 4/4, and solo == four at once 4/4.
      • On commit 4 (before the snapshot fix) the same run gave greedy again 0/4 and c=4 0/4, seeded c=4 1/4. The cause was the prompt cache, not the drafts: with --no-drafts the hashes were the same, and with --prompt-cache-gib 0 everything was equal.
    • Drafted == plain (greedy): each topic's reply with copy drafts on has the same token sha as with --no-drafts. For example topic 0 is 82c2ff38ac0b both ways.
    • A ~7.3k-token prompt, cold (13 ids cached), then warm (7,261 cached): same token sha 5b57c420ae9c.
    • Resumed == fresh over a two-turn chat: the second turn on the warm server (7,261 cached) equals the same chat on a fresh server start (0 cached), sha 6fceca4629ec.
    • Cross-prompt: topic 0 five times (cached 26), then topics 1-3 (cached 13), then topic 0 twice more. All seven topic-0 replies are byte-equal. On 3e0e9bcb83 + load and gate fixes, and on commit 4, the last two answered about the violin.
    • Every reply is non-empty, and the hash covers reasoning and content. Greedy topic 0 opens: "The user wants a short paragraph about the history of the bicycle. Need answer concise. …"

Correctness against our engine

Same 25 prompt ids, per-visit hidden state of the last prompt row. The other side is our C4 Mini engine (dc2ca8a178), which matches a float64 reference 48 of 48. Teacher-forced on its 64 greedy tokens:

3e0e9bcb83 + load fixes + gate/sink raw + messages layout (this PR)
greedy reply " \n\n\n…" coherent coherent
teacher-forced top-1 = ours 0 / 64 58 / 64 64 / 64
ours in its top-5 7 / 64 64 / 64 64 / 64
layer 0 attention output, cos 0.348 1.00000 1.00000
visit 18 (pass 2, first messages), cos – 0.981 0.99993
visit 47, cos – 0.72 0.994
worst visit, cos – 0.72 0.961 (visit 45)

How the table was taken:

  • The taps are a local debug build of each head with a per-visit download. The last column's head is commits 1 to 3; commits 4 and 5 touch only slot selection and the snapshot copy, not the forward. That build is not in this PR; its taps are off the path.
  • Layer 0, last prompt row:
    • the embedding, the attention input, k and v are bit-equal to ours;
    • q differs by 1 bf16 ulp in a few columns (the projection's sum order);
    • the attention output is within 1 bf16 ulp (cos 1.00000).
  • Speed only for scale, not a claim: earlier, with the load and gate fixes, c=1 decode was 5.5 tok/s. This PR changes no kernel's speed path.

Still open

  • Visit 45 (layer 21, past the loop) dips to cos 0.961 on the last prompt row and recovers to 0.994 by visit 47. Every visit before it is ≥ 0.997, and all 64 teacher-forced steps pick the same token. I did not localize it. It may be the 1-ulp projection differences compounding through a global layer, or a real defect.
  • Seeded served replies are compared within this head (solo == again == c=4). They are not compared against another engine. Seeded drafted == plain was not run separately; greedy was.
  • DSpark, TP, images and TENSORFOLD_CUDA_KERNELS stay refused as on 3e0e9bcb83.
  • Speed: one stream decodes at about 1/6 of our C4 engine (report on Inkling 2 Mini on CUDA and Metal #4387). That is not in scope here.

Receipt

  • Against main: main does not serve this model (it is Inkling 2 Mini on CUDA and Metal #4387's family), so there is no main row. Against 3e0e9bcb83: it does not load (PrecisionCount). With the load fixes only, see the table above.
  • Boxes it reaches: CUDA inkling2_loop only. Metal untouched.
  • New switch? None. --parallel now works up to 16.
  • Licence of new weights: n/a.
  • Proposed CHANGELOG line (yours to place): - Inkling 2 Mini on CUDA: loads the released checkpoint, passes the attention gate and sink raw, fixes the cross-pass message layout for prompt chunks, serves --parallel streams on their own cache slots, and copies prompt-cache states per key head.

Checklist

  • The title and description match the head commit.
  • New tests fail before the change and pass after it. The four-slot case hits NoFreeSlot on the base; the cross-prompt case is red on commit 4; the serving test failed MiniServingLogitMismatch on the base + load fixes.
  • Comments and docstrings are one line. No measurements or history in the source.
  • No personal data, machine names, internal hosts or local paths in the diff. No AI attribution lines.
  • Every token still goes through the lane rounds.
  • Resumed equals fresh; concurrent equals solo. Drafted equals plain is covered by the copy-drafting case (no draft model on CUDA).
  • No precision traded for speed.
  • Decode and prompt no slower than main: main does not serve this model.

ashhart and others added 23 commits November 21, 2026 16:05
Derive per-visit cache access and exact arithmetic for the 48 visits so CUDA admission and kernels have a reference before serving is enabled.
Decode stored NVFP4 and MXFP8 expert weights to BF16 and launch them beside the grouped expert/vision kernels, with exact tensor baselines and planted faults.
Launch cross-pass messages, rank-64 gates, residual steps and split QKV with FP32 reductions, BF16 rounding controls and per-launch resource records.
Run all 48 visits with per-visit cache state, prompt snapshots and exact rollback. Refuse TP, vision and DSpark loading until those engines exist.
The merge kernel takes the sink as a logit and applies the gate's sigmoid itself; the engine applied a
sigmoid to both first, so every layer's attention output was wrong from layer 0.
…ad them

tf_ink2_loop_messages wrote [row][core][role][c]; the engine reads each role's rows as one plane at
messages + role * rows * c. The two agree for one row, so decode was right and every multi-row prompt
chunk from the first visit of pass 2 on was not. The kernel now writes [core][role][rows][c] and the
contract reference indexes the same way.
The backend held one stream, so with --parallel N every request past the first failed with NoFreeSlot.
The model now keeps a slot per stream (K/V rows, conv states, rewind sites), the loaded engine takes the
server's stream count through reserve, and forwards still run one stream at a time on shared scratch.
inkling2-serving adds four concurrent streams, greedy and seeded, equal to solo, and a fifth refused.
The CUDA caches are head-major ([kv head][ring][dim]); copyState copied rows as [ring][kv*dim], so a
state held part of head 0's ring and none of the others. A resumed prompt looked right only because the
slot still held its own keys: after another prompt resumed the shared prefix, it answered that prompt.
inkling2-serving adds that order (A keeps 14 and 39, B resumes A's 14 and decodes, A resumes 39 == fresh).
@ashhart

ashhart commented Nov 23, 2026

Copy link
Copy Markdown
Owner

Thanks @jschmied. We've reviewed all six against lead/inkling2-mini (3e0e9bcb83): #4640, #4697, #4718, #4724, #4728 and #4729. Each applies on its own, none adds a lossy format, and the lean and pin checks are clean. Nothing has run on a device yet, so this says nothing either way about tokens. Four things need changing before the device cells:

  1. Inkling 2 Mini on CUDA: #4387's engine loads the checkpoint, answers correctly (64/64 teacher-forced), serves --parallel streams, and resumes prompt-cache states exactly #4640, stream budget (the others inherit it). cuda_native.zig:131 reports only layout.bytes per stream, but each extra slot also allocates its rewind-site table (loop_engine.zig:131) and a vocabulary row plus sampling rule (loop_backend.zig:58-60). On Mini that is about 806 KB a stream that admission doesn't count. Please include it in stream_bytes.
  2. inkling2 cuda: split Mini's loop gate into a down half and an up half (decode 5.6 to 7.2 tok/s, same bits) #4697 and inkling2 cuda: Mini decode QKV a warp 32 outputs over staged 128-byte weight rows (decode 5.6 to 6.4 tok/s, same bits) #4718, kernel records. The new launches admit sm_80 onward but carry usage for sm_121 only, which adds 8 and 12 missing-resource diagnostics to the registry check, on top of the 40 the branch already has. Please add compiler numbers for the other SMs, or limit those launches to what was measured.
  3. inkling2 cuda: Mini decode QKV a warp 32 outputs over staged 128-byte weight rows (decode 5.6 to 6.4 tok/s, same bits) #4718, comparison with the old kernel. ProjectQkv has no replaces, so the contract doesn't compare it byte for byte with the projection it replaces. Please keep the old one available and register that comparison. inkling2 cuda: split Mini's loop gate into a down half and an up half (decode 5.6 to 7.2 tok/s, same bits) #4697 and inkling2 cuda: Mini decode QKV a warp 32 outputs over staged 128-byte weight rows (decode 5.6 to 6.4 tok/s, same bits) #4718 also conflict in contract_inkling2_loop_math_extra.zig, so one of them needs to go on top of the other.
  4. inkling2 cuda: Mini expert weights staged a warp in 128-byte rows, the NVFP4 factor once an expert (decode 5.6 to 9.8 tok/s, same bits) #4728, scale loads. modelopt.cu:72-76 reads whole uint32 words from unpadded scales, while modelopt.zig:157 accepts any K divisible by 32. On a small accepted shape (K = 32) the last row's NVFP4 load reads 2 bytes past the scale data. We haven't shown this on Mini's real shapes, but the guard admits it, so please either narrow the guard or load the tail safely.

#4724's own walker and host changes are ready for device checks once #4640's accounting is in, and #4729 waits on #4728's bounds. Once these are in, we'll run the device cells.

  • Synthena

…ts row and sampling rule

Admission read only the cache layout's bytes a stream, but each extra stream also allocates its rewind-site
table (four sites a visit) and, in the backend, a vocabulary row of last logits and a sampling rule: 806,408
bytes more on Mini (48 x 4 x 32 + 200,058 x 4 + 32). engine.slotAllocs and backend.laneAllocs now size those
allocations, and backend.streamBytes, which cuda_native reports, is their sum.

A host test installs a DeviceBuffer hook that sums what Model.newSlot and Backend.slotBuffers ask for and
pins stream_bytes to it, and the 806,408 bytes past the cache to the formula. The layout test that needed
no CUDA moved from loop_engine.zig to loop.zig.
@jschmied

Copy link
Copy Markdown
Contributor Author

Thanks. All four points are in. Each PR body opens with an update section that has the details; the summary is below. Everything ran on GB10 (sm_121, CUDA 13.0, Zig 0.17.0) on the head named.

PR new head stacked on
#4640 a28a170bb7 lead/inkling2-mini
#4724 e07853195e #4640 a28a170bb7 (restacked, its two commits unchanged)
#4697 ed5da93076 #4640 321432e4b2, as before
#4718 e2671d5830 #4697 ed5da93076 (rebased: the two conflicted)
#4728 fb55ed477e #4640 321432e4b2, as before
#4729 e8de695145 #4728 fb55ed477e (restacked)
  1. Inkling 2 Mini on CUDA: #4387's engine loads the checkpoint, answers correctly (64/64 teacher-forced), serves --parallel streams, and resumes prompt-cache states exactly #4640, stream budget. stream_bytes is now loop_backend.streamBytes: the cache layout, the rewind-site table, the last-logits row and the rule. These are the sizes Model.newSlot and Backend.slotBuffers allocate, through slotAllocs and laneAllocs.
  2. inkling2 cuda: split Mini's loop gate into a down half and an up half (decode 5.6 to 7.2 tok/s, same bits) #4697 and inkling2 cuda: Mini decode QKV a warp 32 outputs over staged 128-byte weight rows (decode 5.6 to 6.4 tok/s, same bits) #4718, records. Both now carry nvcc 13.0 usage on sm_80/86/89/120 for the five new launches, measured with -cubin -O3 per SM, the image's flags (no spills). The tables are in the bodies.
    • The registry test (test-kernel-contract, checkCuda over all_cuda) finds 40 on both heads, the branch's own 40. Before, it was 48 and 52.
  3. inkling2 cuda: Mini decode QKV a warp 32 outputs over staged 128-byte weight rows (decode 5.6 to 6.4 tok/s, same bits) #4718, comparison with the old kernel. projectQkvTiles keeps tf_ink2_loop_project_qkv's tile launch callable. Prompts still use it.
  4. inkling2 cuda: Mini expert weights staged a warp in 128-byte rows, the NVFP4 factor once an expert (decode 5.6 to 9.8 tok/s, same bits) #4728, scale loads. The tail now loads safely rather than the guard being narrowed. A whole word loads only while four scale bytes remain and the row's start is word-aligned; the rest loads byte by byte.
    • At K = 32 the old code also hit the alignment problem: a row's scales start at an odd half-word there, so its word loads fault before they over-read.
    • New contract cases, NVFP4 and MXFP8 decode at K = 32, put each projection's scales in an allocation of exactly their size.
      • On 3cd12eb55e they fail with CUDA_ERROR_MISALIGNED_ADDRESS, and memcheck on that synthetic test reports Invalid __global__ read of size 4 bytes … misaligned.
      • On fb55ed477e they are bit-equal to the replaced baseline, with memcheck 0 errors.
    • Their sums gate is waived, with the reason stated in the spec, because 32-term sums can't separate FP16. The Mini shapes keep 30×.
    • Mini's own shapes still take whole words. inkling2 cuda: Mini decode experts a warp 8 columns, gate and up in one launch (stacked on #4728, decode +3.8 %, same bits) #4729 is restacked on it, and the K = 32 cases pass through its NT kernel too, also with memcheck 0 errors.

On every head:

Speed: one A-B-B-A per PR against its previous head, c=1, plus c=4 and TTFT where a kernel changed.

These are paired losses of 0.01 to 0.08 %, but they are losses, so please don't land #4728 or #4729 yet. A three-round A-B-B-A is running on both, and I'll post it on each PR.

No CHANGELOG change.

@BHCC2025

Copy link
Copy Markdown
Contributor

An sm_120 data point, since the plan lists "any CUDA chip other than sm_121" as a gap. All three heads below built with -Dsm=120 and served the released checkpoint with no change.

Setup

  • One RTX PRO 4000 Blackwell (24 GB, sm_120), driver 595.99.02, Ubuntu 24.04.5, Linux 7.0.0-43. Zig 0.17.0, nvcc 13.0.88.
  • thinkingmachines/Inkling-2-Mini at ed40e7da625f.
  • tensorfold-native serve MODEL --parallel 1 --context 40960 --prompt-cache-gib 0 --no-update-check, plus --no-drafts for the plain rows.
  • Our own streaming client, not tools/bench_openai.py: chat completions, temperature 0, 256 new tokens, one unscored warm-up then 3 runs a cell. Decode is (tokens - 1) / (last chunk - first chunk). Code prompts are files from zig/src/server, prose is the wikitext-2 test split; rendered prompts are 49 / 44, 8,002 / 7,844 and 32,010 / 31,800 tokens.

Heads

Decode, tok/s (median of 3; spread at most 1.1%)

cell #4640 #4729 #4729 + #4718 #4729 + #4718, copy drafts on
code, 49 tokens 7.14 14.54 46.68 52.07
prose, 44 tokens 7.13 14.50 46.37 48.39
code, 8K 7.07 14.27 43.81 43.92
prose, 8K 7.08 14.28 43.85 45.05
code, 32K 7.01 14.02 41.52 42.72
prose, 32K 7.01 14.02 41.46 41.87

Cold prefill, tok/s (time to first token)

prompt #4640 #4729 #4729 + #4718
8K 324 (24.4 s) 398 (19.9 s) 417 (19.0 s)
32K 322 (99.1 s) 395 (80.7 s) 415 (76.8 s)

Same bits. In every cell the reply text has one sha256 across all three heads, with copy drafts on or off, over 4 requests each: daa1a53c04d7, 795b49230549, 03ba86788f14, 488baca2402f, 4a352b0ef044, 663391b55e87 (cells in the table's order, first 12 hex digits of reasoning + content).

Memory. 20,864 MiB after load at --context 40960 on every head. The server also starts at 131,072 (23,754 MiB, "0.0 GiB left after a 1.0 GiB reserve"); I only sent requests at 40,960.

Three things I noticed

  1. The merge of the two stacks is 3.2x inkling2 cuda: Mini decode experts a warp 8 columns, gate and up in one launch (stacked on #4728, decode +3.8 %, same bits) #4729 alone on this card, far more than either stack reports on its own on GB10. I did not build inkling2 cuda: Mini decode QKV a warp 32 outputs over staged 128-byte weight rows (decode 5.6 to 6.4 tok/s, same bits) #4718 by itself, so I can't say which kernel carries it. A combined run on a GB10 may be worth a look.
  2. I could not turn thinking off for Inkling. reasoning_effort: "none", chat_template_kwargs and the server's --no-thinking all gave the same 49-token prompt and a reply that is all reasoning, so every row above is reasoning text.
  3. reasoning_content begins with the raw <|message_model|><|content_thinking|> markers. That may simply be waiting on server: split Inkling 2 replies into reasoning, text and tool calls #4124.

Not run: the kernel contract on sm_120, more than one stream, images, requests above 40,960 context, #4718 alone.

I can rerun any head on this card if that helps.

@joshuaswarren

Copy link
Copy Markdown
Contributor

sm_120 gate run (RTX 5060 Ti, live): tf-cuda-test kernel-contract inkling2 on head a28a170b, nvcc 13.5.

No gate failures and no missed controls on this head - the contract exit (rc=1) is the limits problem count, not a gate miss. Independent sm_120 confirmation that the inkling2 contract cells run clean on the 5060 Ti.

@ashhart
ashhart force-pushed the lead/inkling2-mini branch 3 times, most recently from aefb063 to c41911e Compare November 24, 2026 09:43
@ashhart
ashhart deleted the branch ashhart:lead/inkling2-mini November 24, 2026 09:43
@ashhart ashhart closed this Nov 24, 2026
@ashhart ashhart reopened this Nov 24, 2026
@ashhart
ashhart changed the base branch from lead/inkling2-mini to main November 24, 2026 09:45
@ashhart

ashhart commented Nov 24, 2026

Copy link
Copy Markdown
Owner

Sorry for the noise: this was closed automatically when #4387 landed on main and its branch was removed. It is reopened and now targets main. We will rebase it onto main for you; nothing is needed from you.

  • Synthena

@ashhart

ashhart commented Nov 24, 2026

Copy link
Copy Markdown
Owner

Thank you, @jschmied. All six commits from this PR landed on main inside #4387 with your authorship kept, so Inkling 2 Mini on CUDA ships with your loader and checkpoint work in the next release. Closing this one as landed there.

  • Synthena

@ashhart ashhart closed this Nov 24, 2026
ashhart added a commit to jschmied/TensorFold that referenced this pull request Nov 24, 2026
ashhart#4786 moves each stream's window backup and history from the shared
scratch into its slot. Main's stream budget (ashhart#4640) reports per stream
exactly what newSlot and the lane buffers allocate, so slotAllocs now
sizes all four slot allocations, newSlot and histBytes take their sizes
from it, and streamBytes sums them. Without this, admission would count
each extra stream short by its backup and history.

The stream_bytes test still pins the report to what the allocation hook
sees, and its explicit formula now includes the backup and history.
ashhart added a commit to jschmied/TensorFold that referenced this pull request Nov 25, 2026
ashhart#4786 moves each stream's window backup and history from the shared
scratch into its slot. Main's stream budget (ashhart#4640) reports per stream
exactly what newSlot and the lane buffers allocate, so slotAllocs now
sizes all four slot allocations, newSlot and histBytes take their sizes
from it, and streamBytes sums them. Without this, admission would count
each extra stream short by its backup and history.

The stream_bytes test still pins the report to what the allocation hook
sees, and its explicit formula now includes the backup and history.
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.

4 participants