Repository navigation
dsv41 metal: FP8 decode rows load first and meet tile roots in one simdgroup, same bits - #3287
Merged
Merged
Conversation
This was referenced Nov 14, 2026
Closed
Closed
ashhart
force-pushed
the
lead/dsv41-fp8-rows
branch
from
November 14, 2026 18:52
9ad5765 to
25153bf
Compare
Owner
Author
|
Rebased onto main 2ba55ec as part of the decode stack. It now sits on @gilby's #2973 and #2983 (#3292 needs #2983's expert rows) and lands after them in order: #2973, #2983, #3287, #3288, #3292, #3296, #3376. Measured on an M5 Ultra on the release checkpoint, the whole decode stack (#2973, #2983, #3287, #3288, #3292, #3296, #3376) against main 2ba55ec: 48 of 48 replies equal (greedy, sampled and "draft": false; 16 prompts, 512 tokens). Greedy 73.1 -> 91.8 tok/s, sampled 60.1 -> 74.8, "draft": false 46.4 -> 51.3. test-dsv41-metal passes and the lean check finds nothing new.
|
This was referenced Nov 14, 2026
ashhart
force-pushed
the
lead/dsv41-fp8-rows
branch
2 times, most recently
from
November 18, 2026 02:44
336ece2 to
a067c33
Compare
ashhart
added a commit
that referenced
this pull request
Nov 18, 2026
ashhart
force-pushed
the
lead/dsv41-fp8-rows
branch
2 times, most recently
from
November 18, 2026 19:31
499ac71 to
1551b48
Compare
This was referenced Nov 20, 2026
…olumn a simdgroup for big K The one-launch FP8 row kernel now issues every weight and scale load before its chains, and an output's tile roots meet in one simdgroup's butterfly (lane k holds tile k's root, zero past the tiles), the same zero-padded pair tree that one thread used to walk over 32 roots. A new block kind d takes one column a simdgroup over 32-group tiles. kindOf picks d for K in whole 1024s with 2048 or more columns in the batch at 1 and 3-5 rows, and b otherwise; c is no longer picked. The contract's row invariance covers every kind. Bits unchanged: release layers 2 and 21 give main's output and KV hashes at 1 and 4 rows, 20 of 20 concurrent launches equal, and the float64 real-layer checks pass. M5 Ultra, release layer 2, the 8 FP8 launches timed alone: 1 row 247 -> 215 us, 4 rows 325 -> 281 us, 5 rows 360 -> 316 us. x40 round: 1 row 25.1 -> 24.6 ms, 4 rows 41.9 -> 40.0 ms, 5 rows 47.5 -> 45.7 ms.
ashhart
force-pushed
the
lead/dsv41-fp8-rows
branch
from
November 20, 2026 09:05
1551b48 to
71368e2
Compare
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.
DeepSeek-V4.1 decode on Metal spends about 40% of a layer in the dense FP8 projections (
fp8_rows.metal). At one row they read about 675 GB/s on an M5 Ultra, which streams one large read at about 1.1 TB/s. This change gets them closer and keeps every output bit.kindOfpicks it for K in whole 1024s with 2048 or more columns in the launch's batch, at 1 and 3-5 rows, and b otherwise. c is no longer picked.Measured on an M5 Ultra (512 GB) on release layer 2, the eight FP8 launches each timed alone (
time-dsv41-metal-real,TF_DSV41_TIMING_FP8=1, mean of two balanced runs):Engram's wkv (6144 x 25600) moves to kind d: 311-365 → 230-237 µs at one row.
Served on the release weights with dsv41 metal: launches of 6 to 16 rows run their FP8 projections on a matrix tile (stacked on #1720) #2973 and dsv41 metal: decode experts decode an expert's weights once for all of its rows (stacked on #1720, #2973) #2983 underneath, 16 prompts of 512 tokens: draft:false 46.4 → 49.5 tok/s and greedy 82.2 → 84.3, with every reply's text equal to main's (48 of 48).
Bits: release layers 2 and 21 give main's output and KV hashes at 1 and 4 rows, 20 of 20 concurrent launches equal, and the float64 real-layer checks pass (layer 2: 362 passes, layer 21: 266).
Kernel contract,
--only "dsv41_fp8_rows": 6 kernels pass gates 1-4, 4 controls red, and 288 invariance launches byte-equal. The probe's invariance loop now covers every kind.zig build test-dsv41-metal -Dcpu=apple_m1andtest-dsv41-metal-servepass on an M5 Max. Lean: 0 new.Tried and dropped: kind c for K=1280, 2-4 adjacent groups a lane, 2-4 column blocks a threadgroup, X held in registers across columns, applying the scale once at the end of a chain (changes subnormal and overflow bits).
Synthena (Ash's Agent)