Repository navigation
nemotron metal: one decode attention partial source for its 16 host names (#2251) - #2263
Conversation
|
Thanks @jschmied. With the name lines removed the 16 files really were one body, the 16 host names keep their own row counts, and identical IR in both fp modes settles the bits. One thing before it lands: since |
…ompt states prefill once after upgrading (ashhart#2263)
|
Added in |
|
Thanks @jschmied, that's the line. Ready to land. |
7ef13dc to
5a717f9
Compare
…ompt states prefill once after upgrading (ashhart#2263)
…ompt states prefill once after upgrading (ashhart#2263)
5a717f9 to
a25a69a
Compare
|
Rebased onto Re-checked on the rebased tree:
|
|
Our M5 Ultra run on this head, Nemotron 3.5 Lightning MLX 4-bit, against its merge base with main: no token differences in 20 prompt rows. Prefill moves -0.4% to +0.2%, decode after a prompt -0.5% to +0.2%, and the stream sweeps -0.8% to -0.2%. The sweeps all lean slightly down, but the 16 kernels compile to the same IR and the repetitions overlap, so we read it as run-to-run spread, not a change. It's in the landing queue. |
a25a69a to
aae6c0c
Compare
…ompt states prefill once after upgrading (ashhart#2263)
|
Thanks @jschmied. One small thing turned up at landing, and I've pushed the fix (
|
|
Our M5 Ultra kernel contract on this head ( |
… each of its 16 host names (ashhart#2251) The 16 attn_partial_N.metal files differed only in the SG template argument. attn_partial.metal holds the template once, and kernels.zig appends each key's single instantiation under its old host name, so each key still compiles alone at run time with CompileOptions.mlx() under the same function name; the KV page twins build from attn_partial_1's source as before. The generator these came from left the tree in 1.0.0, so kernels.zig is edited by hand. Nemotron's sourceHash changes with the text, so learned prompt states saved before this do not match. On an M3 Pro: the 16 kernels' LLVM IR (metal -std=metal4.1, safe math, fast fp32 functions) is identical before and after; tf-kernel-contract --only nemotron prints the same 1,004 lines on main and here apart from its timings (63 kernels pass gates 1-4, 29 controls red); a Nemotron greedy run gives the same 64 tokens.
…ompt states prefill once after upgrading (ashhart#2263)
…le, which the release path check reads as a path
a5f1f08 to
90f51d9
Compare
…ompt states prefill once after upgrading (#2263)
|
Thank you @jschmied. This is merged into main with your commits under your own name, so you're listed as a TensorFold contributor. It ships in the next release, credited to you in the changelog and the release notes. |
|
Thanks @jschmied! This is in TensorFold 1.2.4, out now: https://github.com/ashhart/TensorFold/releases/tag/v1.2.4 |
The first step of #2251, as asked there: Nemotron's 16 Metal decode attention partials become one source.
What changes
nemotron/attn_partial_1.metal…attn_partial_16.metaldiffered only in the template's row countSGand the host name. They become onenemotron/attn_partial.metalholding the template once.kernels.zigappends each key's one instantiation under its old host name, so all 16 host names and keys stay as they were.CompileOptions.mlx()), the library each kernel compiles into, and the paged twins.zig/kernels/metalgoes from 367 to 352 files.tools/zig/gen_nemotron_kernels.pyleft the tree at 1.0.0, sokernels.zigis edited by hand.nemotron.sourceHash()follows the source text. Nemotron prompt states saved before this get a new identity and are recomputed once, although the compiled code is the same.Same results before and after (M3 Pro, main
cde4fe7d9against this branch)tf-kernel-contract --only nemotron --rotary-accuracy rotary.json; the rotary record comes fromtf-rotary-sweep, COMPLETE over 302,008,320 cases):SUMMARY 63 kernels: 63 pass gates 1-4, 0 fail, 1 known findings; 29 controls: 29 red as planted, 0 missed; 0 limit problemsattn_partial_N+ merge inmetal_nemotron_attention.zig, the paged twins againstattn_partial_N's bytes inmetal_nemotron_pages.zig, andmetal_nemotron_unroll.zig, with their records incore/contract/nemotron_attention_records.zig.TensorUnitsRequiredon this Mac, on main as on the branch, so the run is filtered to Nemotron.xcrun metal -std=metal4.1 -S -emit-llvm, in both the safe and fast-fp32 modes; only the source path is normalized).test-metal-kv-pages45/45.zig build test691/691 steps (10695 of 10776 passed, 81 skipped).76b25cdd1535).zig build test, the no-GPU CI set,git diff --checkandzig fmt --checkpass.The other #2251 groups follow one PR each, starting with the diffed ones.
group_norm_xsis next.