Skip to content

nemotron cuda: skip empty pocket layers and spread the pocket over many blocks - #787

Merged
ashhart merged 6 commits into
ashhart:mainfrom
ThinkOffApp:pocket-cuda
Oct 14, 2026
Merged

ashhart merged 6 commits into
ashhart:mainfrom
ThinkOffApp:pocket-cuda

Conversation

@ThinkOffApp

@ThinkOffApp ThinkOffApp commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

What this changes

On CUDA, a Nemotron model with a Living Weights pocket decodes slower than without one, even with an empty pocket. @philip-pentatonic found and traced this in #678: on his RTX PRO 6000 with 1.0.7, undrafted decode fell from 290.4 to 199.3 tok/s, all in tf_pocket_rows, which runs each MoE layer's pocket as one 256-thread block per row over all 64 neurons. This PR implements the two fixes he proposed there:

  • Skip empty layers. Each pocket keeps a count of neurons in use, on the host and the device, and a layer with none launches nothing. Graphs read the count from the device, so they follow the learner and are recaptured only when a skipped layer gets its first neuron. The buffers stay 64 wide (our detail), so the learner still reads a loaded pocket.
  • Spread the work. tf_pocket_in (a warp per neuron and row) writes relu² into a small fp32 scratch, then tf_pocket_out (a thread per output) adds neurons 0..n-1 into the shared expert's output. The sums, their order and the final add are those of tf_pocket_rows, in the tiled prompt forms too.
  • One fix on the way. When the graphs are captured again while another sequence is bound, recapture left the captures' placeholder rule (seed 0, temperature 1) on the own sequence, so a greedy request on it would next launch the sampled set. 1.0.9 has this too; the new trigger above makes it run more often. recapture now gives the own sequence back its rule before it binds the other one, and tf-cuda-test recapture MODEL checks it.

On our GB10, 1.0.9 still pays about 1.6 ms a token for the pocket, empty or full. With this PR, taught and empty decode at the untaught speed undrafted (empty drafted too), with the same tokens. The GB10 numbers are ours; we have not measured philip's RTX PRO 6000. Metal already skipped empty pockets, and 1.0.9 has the Metal side of this work (#775).

Receipt

  • Environment: v1.0.9 (c36b536d) against this branch at 76fe1de4 (the last commit, 5dc34d9d, only adds tf-cuda-test recapture and makes recapture pub), built alike (Zig 0.17.0, CUDA 13.0, -Dsm=121). NVIDIA GB10, Ubuntu 24.04.5. Nemotron 3.5 Lightning 30B-A3B MLX 4-bit d9d758fb: untaught; taught (64 teaching attempts: 40 learned, 20 missed, 4 replaced; 440 neurons in use in 16 of 23 MoE layers); empty (64 neurons, none in use). Lines marked 1.0.8 come from the receipt before the rebase: v1.0.8 (0efbd447) against 07189f62, the same fix.
  • Exactness: on each folder, a 1.0.9 server and a server on this branch give the same token_sha on all 120 requests, including tools/bench_concurrent.py --alone --serial (concurrent equals solo, solo equals "draft": false). Taught differs from untaught on 98 of 120, so the check sees the pocket. tf-cuda-test pocket matches tf_pocket_rows byte for byte in 196 cases, up to a whole 4,096-row prompt pass.
  • Decode speed: undrafted server, 91.5 → 106.4 tok/s taught and 90.9 → 105.8 empty, against 106.1 → 105.7 untaught. Drafted, tools/bench_openai.py is 3-9% faster taught and 1-11% empty; untaught moves -2.4% to +2.2%.
  • Prompt speed: no tools/prefill_cold.py in 1.0.9. A 4,096-token prompt in the dev CLI (one 4,096-row pass in 1.0.9): 0.577 → 0.527 s taught, 0.576 → 0.517 s empty, 0.516 → 0.513 s untaught.
  • Tests: zig build test 700 of 705 passed, 5 skipped, as on 1.0.9. tf-cuda-test recapture MODEL (4 cases with distinct rules on the two sequences, each again with the sampled capture failing partway, then a full recapture) passes all 9 runs; with a3df10ea's two lines taken out, the 7 runs with the other sequence bound fail with the own sequence holding seed 0 and temperature 1. lean_check.py 538, unchanged. zig fmt --check clean.
  • Live learning: a --slide server learning on this branch writes the same files, slide graph and probe replies (logprobs included) as 1.0.9 at every checkpoint and after a restart. On 1.0.8 the same held on 07189f62, e987544e and adec42df.
  • Not run: other GPUs (sm_86 and sm_120 compile only), a full pocket, cold prefill at 2k to 64k. Not re-run on 1.0.9: the graph round timer, nsys, the fact questions, the lane core and the broken kernels; those lines below are 1.0.8.

Checklist

  • Every token still goes through the lane rounds. No serial path, and nothing that needs drafts off.
  • Drafted output equals "draft": false, a resumed prompt equals a fresh one, and concurrent equals solo. Drafted and concurrent: on every server (on 1.0.8 also in the dev CLI's lanes). Resumed equals fresh: one request pair per server (29 of 35 prompt tokens from the cache), equal on all 6.
  • No precision traded for speed. Every sum keeps its order. One bit can differ by construction: a layer with no neuron in use now leaves an exact -0.0 as -0.0, where 1.0.9 adds +0.0 and makes it +0.0. No tested reply changed.
  • Prompt processing is no slower than the last release. Measured with the dev CLI at 36 and 4,096 tokens, not with prefill_cold.py, which 1.0.9 does not have. On the taught folder a 4,096-token prompt is still 2.0% slower than untaught (12.6% on 1.0.9).
  • Platforms: CUDA on a GB10 (sm_121) only. sm_86 and sm_120 compile without spills but were not run. Not the RTX PRO 6000. Metal and HIP are untouched.
  • The new tests pass after the change. tf-cuda-test recapture fails without a3df10ea's two lines (7 of 9 runs). For tf-cuda-test pocket: on 1.0.8 it failed on four broken kernels, and its -0.0 case failed on 07189f62 and on a tf_pocket_out without its count-0 return. It cannot run on 1.0.9, where the command does not exist. It prints SKIP when built without the CUDA kernels (I read that path, I did not run such a build).
  • Comments and docstrings are one line. No measurements or history in the source.
  • No personal data, machine names, internal hosts or local paths. No AI attribution lines.

Full receipt

Builds, folders and conditions

  • Builds. Before: c36b536d (v1.0.9). After: 76fe1de4, the tip of this branch (e7b65ff4, 9803c8fc, 0ffaefc2, a3df10ea, 76fe1de4 on v1.0.9; 5dc34d9d after it adds only the recapture test). Each tree matched git archive of its commit file for file. Both were built with zig build install then zig build native, -Dsm=121 -Dversion=1.0.9, Zig 0.17.0, nvcc 13.0.88. Only nemotron_ops.fatbin differs between the two builds.
  • GPU. NVIDIA GB10 (sm_121, memory shared with the host), Ubuntu 24.04.5, driver 580.178.04, CUDA 13.0. Python 3.12 with the clients from c36b536d, which are the same files as in 1.0.8; this PR touches no tool. One model process at a time.
  • Folders, served in place and read-only. Every *.safetensors and config.json hashed the same before and after every server and run.
    • Untaught: the published checkpoint.
    • Taught: 64 teaching attempts (40 learned, 20 missed, 4 replaced); 440 neurons in use in 16 of 23 MoE layers (41-44 in ten, 1-3 in six, none in seven or in the draft head).
    • Empty: the untaught model widened to 64 pocket neurons a layer, all zero, as the engine writes a widened layer with no facts (philip-pentatonic's "pocket widened, no facts" case). It gives the untaught tokens in every run, as it must.
  • Servers. TENSORFOLD_NO_LIVE=1 tensorfold-native serve FOLDER --host 127.0.0.1 --port PORT --no-update-check, no --slide. Each server started with a fresh empty HOME, so it timed its own draft-window costs. One series of six servers, each folder's two builds next to each other in mirrored order (before first on taught and empty, after first on untaught). 120 s idle before each server. On 1.0.8 there were two such series.
  • Clients, on every server in this order:
python3 tools/bench_openai.py http://127.0.0.1:PORT MODEL
python3 tools/bench_openai.py http://127.0.0.1:PORT MODEL --tokens 256 --reps 3 --temperatures 0
python3 tools/bench_concurrent.py http://127.0.0.1:PORT MODEL --alone --serial
python3 tools/bench_concurrent.py http://127.0.0.1:PORT MODEL --tokens 256 --reps 3 --temperatures 0 --levels 1,4 --alone --serial

Between the second and third, my own client sent "draft": false requests: 8 prompts, 2 warm-up and 16 measured requests of 256 greedy tokens, thinking off.

  • Dev CLI. tensorfold run FOLDER --tokens <36 ids> --max-tokens 256, drafts off and on, and the 4,096-token prompt with --max-tokens 2 --no-drafts: 4 reps each, the folders rotated, the build order flipped every rep, 45 s idle before each rep.

Same tokens

Nemotron 3.5 Lightning 30B-A3B MLX 4-bit, NVIDIA GB10, v1.0.9 against 76fe1de4:

Check Untaught Taught Empty
Server: same token_sha before and after, every request, both servers 120 of 120 120 of 120 120 of 120
bench_concurrent.py: concurrent equals its solo run, per server 78 of 78 78 of 78 78 of 78
bench_concurrent.py --serial: solo equals "draft": false, per server 12 of 12 12 of 12 12 of 12
Dev CLI, 256 greedy tokens: one hash before and after, drafts off and on 16 of 16 runs 16 of 16 runs 16 of 16 runs
Dev CLI, 4,096-token prompt: the same first token before and after 8 of 8 runs 8 of 8 runs 8 of 8 runs

Not re-run on 1.0.9. Nemotron 3.5 Lightning 30B-A3B MLX 4-bit, NVIDIA GB10, v1.0.8 against 07189f62:

Check Untaught Taught Empty
Server, 40 fact questions, thinking off and on, drafted and "draft": false: same before and after 160 of 160 160 of 160 160 of 160
Dev CLI tensorfold lanes, 134 fact questions thinking off and 40 on, solo and 40 at once, drafted and not: same token ids before and after 428 of 428 428 of 428 428 of 428
Dev CLI: drafted equals --no-drafts, each build 174 of 174 174 of 174 174 of 174
Dev CLI: 40 at once equal their solo runs, each build 80 of 80 80 of 80 80 of 80
  • Negative control. In each build, taught differs from untaught on 98 of 120 server requests, as on 1.0.8, and in the dev CLI's 256 tokens. On 1.0.8 it also differed on 155 of 174 dev CLI fact replies. So these checks can see the pocket. Empty equals untaught everywhere.
  • Taught answers (1.0.8). The taught folder's fact replies, before and after, equal the ones a 1.0.8 server gave on that folder after teaching it: 134 of 134 with thinking off, 40 of 40 with it on.
  • Resumed. On all 6 servers, the first chat request (nothing cached) and the next one gave the same token_sha. The next one is the same prompt and seed, with 29 of its 35 prompt tokens from the cache.
  • The dev CLI hashes are the ones 1.0.8 gave on the same folders.

Kernel test. tf-cuda-test pocket runs tf_pocket_in then tf_pocket_out against tf_pocket_rows over all 64 neurons and compares every output byte.

  • Coverage: widths 2,688 and 2,728 (the second leaves remainders); 1, 2, 5, 16, 17, 40, 70, 300, 2,048 and 4,096 rows (a prompt chunk and a whole serial pass); 0, 1, 6, 10, 44 and 64 neurons in use; fp32 and bf16 out. 196 of 196 cases are equal.
  • Controls: summing the same neurons in reverse changes 17,633 and 324,472 values, and rotating the inputs by one changes 4,028 and 82,080. So the test can see a change of order.
  • Broken kernels (1.0.8): it failed with a batch of neurons added in reverse, with the relu removed, without the fused multiply-add, and with the last output dropped.
  • The -0.0 case: a layer with no neuron in use whose shared-expert output holds exact -0.0. tf_pocket_rows turns 568,064 of them into +0.0. A skipped launch and a captured launch reading a count of 0 both keep every byte. On 1.0.8 the case failed on 07189f62 (the skip lived in the forward, not the launcher) and on a tf_pocket_out without its count-0 return.

Live learning. A --slide server learned 3 facts into a fresh copy of the untaught model on 76fe1de4, with a restart after the first. 1.0.9 did the same on its own copy.

  • At all four checkpoints, the folder's files (sha256) and the slide graph equal 1.0.9's, and at the three probed ones so do 16 probe replies (thinking off and on, drafted and "draft": false, logprobs included). They equal them again after a restart, and the two folders end byte-identical.
  • In the second lesson, one layer got its first neuron in an existing pocket while the server ran, which is the case where this branch captures the graphs again.
  • 1.0.9's own run equals 1.0.8's at every checkpoint, so learning itself did not change with the release.
  • On 1.0.8 (07189f62, e987544e, adec42df) the same checks held over 7 facts, with chat requests alongside: 587 of 600 chat pairs were identical, and the 13 that differ were sent while the trainer was fitting, with the two runs at different trainer steps; we read that as timing, not a forward difference.
  • On 1.0.8, a copy of adec42df with log lines only showed the recapture firing after a restart, and a failed lesson taking a layer back from 1 to 0. The replies alone cannot prove the recapture: a build that recaptures only for new pockets also matched, and with no recapture at all 2 of 16 replies changed. So the logs are the evidence for the recapture, and the kernel test for the -0.0 bytes.

Undrafted decode speed

Nemotron 3.5 Lightning 30B-A3B MLX 4-bit, NVIDIA GB10, v1.0.9 against 76fe1de4, medians:

Instrument Untaught before after Taught before after Empty before after
Dev CLI run --no-drafts, 256 tokens, tok/s (4 reps) 107.21 107.69 91.92 107.72 92.02 107.71
Server, "draft": false, 16 × 256 tokens, tok/s (one server each) 106.09 105.67 91.46 106.39 90.93 105.77
  • Dev CLI, after over before in the same rep: taught 1.174 (1.166-1.177), empty 1.171 (1.168-1.173), untaught 0.999 (0.991-1.015). After, taught/untaught is 0.998 and empty/untaught 1.001. In ms a token: taught 10.880 → 9.283, empty 10.867 → 9.285, untaught 9.328 → 9.287.
  • Server: after, taught/untaught 1.007 and empty/untaught 1.001; before, 0.862 and 0.857.
  • 1.0.8: the captured serial decode graph (tensorfold rounds, 4 reps × 2) took 11.487 → 9.893 ms a round taught and 11.474 → 9.812 empty, against 9.864 → 9.857 untaught. Of 1.0.8's 1.6 ms a token, 0.045 ms was left on the taught folder and none with the empty pocket. Not re-run on 1.0.9.

Drafted decode speed

tools/bench_openai.py: decode tok/s, the median of the reps on the one server of each build. Nemotron 3.5 Lightning 30B-A3B MLX 4-bit, NVIDIA GB10, v1.0.9 against 76fe1de4:

Cell Untaught before after Taught before after after/before Empty before after after/before
code, 64 tokens, temperature 1 165.9 166.1 153.1 167.5 1.094 155.7 169.9 1.091
chat, 64 tokens, temperature 1 145.0 141.5 133.8 145.2 1.085 128.3 142.5 1.111
code, 64 tokens, greedy 146.3 149.5 145.8 150.3 1.031 139.9 144.2 1.031
chat, 64 tokens, greedy 166.7 166.1 164.9 169.9 1.030 164.1 165.5 1.009
code, 256 tokens, greedy 212.4 214.4 196.7 207.1 1.053 200.9 212.8 1.059
chat, 256 tokens, greedy 155.9 155.1 155.2 167.1 1.077 145.6 155.6 1.069
  • Empty writes the untaught tokens in every cell, so empty/untaught is the pocket's drafted cost on identical work: 0.89 to 0.98 before, 0.97 to 1.02 after.
  • The 0.97 is the greedy 64-token code cell. There the servers drafted the same 64 tokens in 29 rounds (untaught, after) and 30 (empty, after), each from its own timed costs. One server a build is noisier than 1.0.8's two.
  • Taught writes the untaught text only in the two greedy 64-token cells. Elsewhere its ratios to untaught are not like for like.
  • Draft-window costs each server timed at startup: a 1-row verify window took 10.42 and 10.39 ms on taught and empty before, and 8.98 and 8.88 ms after, against 9.06 and 8.92 ms untaught. So part of the drafted gain is the planner now pricing those folders like untaught.
  • bench_concurrent.py, one stream, greedy, 256 tokens: taught 1.055 and 1.075 after/before, empty 1.058 and 1.068, untaught 1.009 and 0.991. Its 4-stream greedy cells jump between two levels from rep to rep on every folder and build, untaught included, so we read no speed from them.
  • Dev CLI drafted (run, 256 greedy tokens, 4 reps): taught 135.34 → 146.13 tok/s, empty 146.55 → 160.68, untaught 160.05 → 160.75.

Prompt speed

tensorfold run MODEL --tokens-file <4,096 ids> --max-tokens 2 --no-drafts (one 4,096-row pass in 1.0.9), 4 reps, builds alternated. Nemotron 3.5 Lightning 30B-A3B MLX 4-bit, NVIDIA GB10, v1.0.9 against 76fe1de4, medians:

Folder Before, s After, s After/before, same rep Over untaught, before / after
Untaught 0.516 0.513 0.997
Taught 0.577 0.527 0.907 1.126 / 1.020
Empty 0.576 0.517 0.897 1.116 / 1.002
  • The 36-token prompt (one pass, medians of 8): untaught 51.3 → 51.2 ms, taught 52.9 → 51.1 ms, empty 53.0 → 50.8 ms.

Where the time went

nsys profile -t cuda --cuda-graph-trace=node around one dev CLI run of 256 tokens, drafts off. Nemotron 3.5 Lightning 30B-A3B MLX 4-bit, NVIDIA GB10, 1.0.8 (not re-run on 1.0.9):

Run Pocket launches in decode µs a launch, median Pocket share of kernel time ms a token under nsys
Taught, v1.0.8 5,865 tf_pocket_rows (23 layers × 255) 134.5 18.2% 11.433
Taught, 07189f62 4,080 tf_pocket_in + 4,080 tf_pocket_out (16 layers × 255) 31.3 + 13.7 4.7% 9.883
Empty, 07189f62 none 0% 9.781
Untaught, 07189f62 none 0% 9.839

Kernel time in tf-cuda-test pocket 30, with the L2 flushed before each launch and 44 neurons in use. NVIDIA GB10, 76fe1de4, one run:

Rows tf_pocket_rows, µs tf_pocket_in + tf_pocket_out, µs
1 (decode) 93.9 18.2
16 93.9 26.4
36 98.0 35.6
2,048 1,238.8 483.0

The tiled forms take over from 256 rows for the first half and from 64 rows for the second. I picked those cut-overs on the GB10; other GPUs may do better with others.

… its two halves over many blocks

tf_pocket_rows ran every MoE layer's pocket as one block of 256 threads a row over all 64 neurons, in use or not, so
an empty pocket cost as much as a full one, and one SM read the layer's 1.4 MB of fp32 weights alone. Both changes
are philip-pentatonic's proposals in ashhart#678.

- Each pocket keeps its count of neurons in use, the first ones. The loader counts through the last up row that is
  not all zero, as pocketRead does, and the learner's setter keeps the count it is given instead of dropping it. The
  forward skips a layer whose count is 0. The kernels read the count from the device, so captured graphs follow the
  learner's changes; they are captured again only when a layer they skipped gets its first neuron. The buffers stay
  64 neurons wide, so pocketRead still reads a loaded pocket.
- tf_pocket_in computes relu^2(up y) into a new [rows, 64] fp32 scratch with a warp a neuron and a row: each lane adds
  its strided products and the xor tree adds the lanes, as in tf_pocket_rows. tf_pocket_out then adds act down into
  the shared expert's slot with a thread an output, neurons in order 0..n-1, and the same bf16 or fp32 add. From 256
  rows (the first half) and 64 rows (the second) tiled forms take eight neurons by eight rows a warp and 16 rows a
  thread; every sum keeps its order. tf_pocket_rows stays in nemotron_ops as the test's reference; the engine no
  longer loads it.

Every output keeps its bits. tf-cuda-test pocket compares the two kernels with tf_pocket_rows over all 64 neurons byte
for byte: widths 2688 and 2728, 1 to 2048 rows, 0 to 64 neurons in use, fp32 and bf16 out, 194 cases. Its controls,
the same neurons summed in reverse and the inputs rotated by one, change the bytes; the test fails with a batch of
neurons added in reverse, with the relu removed, without the fused multiply-add, and with the last output dropped. A
skipped layer leaves its output as it was where tf_pocket_rows added +0.0, which can only turn an exact -0.0 to +0.0.

On the GB10, timed by the test with the L2 flushed before each launch and 44 neurons in use (two runs), a decode row
takes 18 us instead of 94, 16 rows 24 to 27 us instead of 92 to 96, and a 2048-row prompt chunk 0.49 ms instead of
1.26 to 1.28. In the dev CLI (256 greedy tokens, drafts off, two runs each), a folder with 64 facts in 16 layers
keeps its tokens at 9.66 to 9.67 ms a token instead of 11.19 to 11.28, the untaught model's 9.66 to 9.75, and the
empty pocket keeps the untaught tokens at 9.63 to 9.75 ms instead of 11.26 to 11.29. A 4,096-token prompt takes
0.556 s instead of 0.585 taught and 0.530 s instead of 0.599 empty, against 0.528 untaught (one run each).
…es into its launcher, and a test pins its -0.0

The check moves from Forward.pocket into Ops.pocketRows, so tf-cuda-test pocket reaches the code the forward runs; the
forward makes the same launches as before.

tf-cuda-test pocket gains the one case where the bytes can differ from 1.0.8: a layer with no neuron in use whose shared
expert output holds an exact -0.0. tf_pocket_rows over its 64 zero neurons adds +0.0, which turns each such -0.0 into
+0.0 and leaves every other value as it was; the launcher launches nothing and keeps every value, -0.0 included. A
graph captured while the layer held neurons still launches both kernels after its count falls to 0, and they add +0.0
as tf_pocket_rows did. 1, 16 and 300 rows, fp32 and bf16 out. Without the launcher's skip the case fails.
…nt of 0, and the count stays in its width

- tf_pocket_out returns when the count it reads is 0. A graph captured while a layer held neurons and replayed after the
  learner emptied it added +0.0 there, turning an exact -0.0 into +0.0, while the eager forward skips the layer and
  keeps it. Now both keep every bit, so a replayed graph gives the eager forward's bytes.
- The learner's setter refuses a count past the pocket's width: the kernels take their loop bounds and shared memory
  reads from the count on the device.
- tf-cuda-test pocket's -0.0 case expects a launch reading a count of 0 to keep every byte, and fails on a tf_pocket_out
  without the return. Its comments name tf_pocket_rows instead of a release.

On the GB10, tf-cuda-test pocket passes its 194 cases and the -0.0 case (1, 16 and 300 rows, fp32 and bf16 out), and the
dev CLI gives the same 256 greedy tokens as before on the untaught, taught and empty-pocket folders, drafts on and off.
…another sequence is bound

recapture binds the own sequence, records its graphs with a placeholder rule in e.sampling (null for the greedy set,
seed 0 and temperature 1 for the sampled one), then binds the other sequence back. Engine.bind stores the current
e.sampling into the sequence it leaves, so the own sequence kept the placeholder: a greedy request running on it
would next launch the sampled set. The rule the own sequence had after its bind is now put back before it is left.

The pocket now captures again when a layer gets its first neuron in an existing pocket, so this path runs more often
than when only a new pocket did.
…pt chunk

A serial prompt pass now runs up to pass_rows (4,096) rows, so the byte comparison with tf_pocket_rows covers that many
rows too, with 44 and 64 neurons in use.
…e graphs are captured again

recapture becomes pub so the test can call it; the engine is otherwise unchanged.

The test loads the model with both draw modes' windows, as cuda_native.open leaves them with drafts off, and makes a
second sequence. Four cases give the two sequences distinct rules: own greedy and other sampled, both sampled with other
seeds and temperatures, own sampled and other greedy, and the last again with the own sequence bound. Each case
captures the graphs again, then checks e.sampling, the rule each sequence keeps, and each rule once its sequence is
bound. The cases run again with the draw kernel's handle cleared, so the sampled set's first capture fails after its
placeholder rule is set; the count of graphs captured (the serial one and the greedy set) shows where it failed.

On the GB10 all 9 runs pass. With a3df10e's two lines taken out, the 7 runs with the other sequence bound fail, the
failing captures too: the own sequence keeps seed 0 and temperature 1.
@ThinkOffApp
ThinkOffApp marked this pull request as ready for review October 13, 2026 18:23
@ashhart
ashhart merged commit a695b13 into ashhart:main Oct 14, 2026
2 checks passed
ThinkOffApp pushed a commit to ThinkOffApp/TensorFold that referenced this pull request Oct 14, 2026
The pocket kernels' signatures, pocketRows and its launches, the scratch table and tf-cuda-test pocket. Line breaks, trailing commas and two format strings split with ++ only: with comments and whitespace set aside the code is the same.
ThinkOffApp pushed a commit to ThinkOffApp/TensorFold that referenced this pull request Oct 14, 2026
ThinkOffApp pushed a commit to ThinkOffApp/TensorFold that referenced this pull request Oct 14, 2026
ThinkOffApp pushed a commit to ThinkOffApp/TensorFold that referenced this pull request Oct 14, 2026
@ashhart

ashhart commented Oct 14, 2026

Copy link
Copy Markdown
Owner

Thank you, @ThinkOffApp, and @philip-pentatonic, whose #678 traced the cost and proposed both changes. On CUDA, Nemotron with a Living Weights pocket skips a layer with no neuron in use and runs a taught layer's pocket as tf_pocket_in then tf_pocket_out. Every sum keeps its order, so replies are unchanged. The one value that can differ is an exact -0.0 in the shared expert's output of a layer with no neuron in use, which tf_pocket_rows turned into +0.0. Recapture keeps the sequence's own sampling rule.

Your commits are in 1.0.10 under your name (aa44c71a5, f094fb9c0, 1f88ea2f5, c4cb2bc8d, d5145c550). The CHANGELOG line is 699f31111. Your head 76fe1de48 is merged at 67d2a1b0a with no change to the tree.

Your current head 5dc34d9d4 is the recapture test, parent 76fe1de48. It is in 1.0.10 as 3900356b1 and merged at a695b1319 with no change to the tree.

On a GB10, tf-cuda-test pocket matches tf_pocket_rows byte for byte in 196 cases (1 to 4,096 rows, 0 to 64 neurons in use). A decode row's pocket takes 19 us instead of 94, and a 2,048-row prompt chunk's takes 0.48 ms instead of 1.23. A copy of Nemotron 3.5 Lightning (MLX 4-bit) taught one fact gave the same replies token for token as before, drafted and with "draft": false, alone and concurrent, and copies taught by the old and the new build wrote the same files. On that copy "draft": false decode was 17% faster, drafted decode 5% to 10%, and cold prompts of 2k to 32k tokens 8.5% to 10.3%.

@ashhart ashhart mentioned this pull request Oct 14, 2026
BlivionIaG pushed a commit to BlivionIaG/TensorFold that referenced this pull request Oct 20, 2026
The pocket kernels' signatures, pocketRows and its launches, the scratch table and tf-cuda-test pocket. Line breaks, trailing commas and two format strings split with ++ only: with comments and whitespace set aside the code is the same.
BlivionIaG pushed a commit to BlivionIaG/TensorFold that referenced this pull request Oct 20, 2026
BlivionIaG pushed a commit to BlivionIaG/TensorFold that referenced this pull request Oct 20, 2026
BlivionIaG pushed a commit to BlivionIaG/TensorFold that referenced this pull request Oct 20, 2026
BlivionIaG pushed a commit to BlivionIaG/TensorFold that referenced this pull request Oct 20, 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