Repository navigation
dsv41 metal: vector greedy picks and kept sampling scratch, same picks - #3288
Merged
Merged
Conversation
This was referenced Nov 14, 2026
Closed
ashhart
force-pushed
the
lead/dsv41-metal-choose
branch
from
November 14, 2026 18:52
9c9ba0b to
63f9830
Compare
This was referenced Nov 14, 2026
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
Merged
Closed
ashhart
force-pushed
the
lead/dsv41-metal-choose
branch
4 times, most recently
from
November 21, 2026 06:30
34b374b to
9d31a0f
Compare
…pt between picks The greedy argmax takes the first maximum in vector steps and keeps the scalar scan for a row holding a NaN, so it picks the same id; a sampled pick reuses its float64 logits and its ids instead of allocating both every row.
ashhart
force-pushed
the
lead/dsv41-metal-choose
branch
from
November 21, 2026 09:51
9d31a0f to
80eb8b9
Compare
Owner
Author
|
Thank you @gilby. This is merged into main with your commits under your own name, so you're credited as a TensorFold contributor. |
ashhart
added a commit
that referenced
this pull request
Nov 21, 2026
ashhart
added a commit
that referenced
this pull request
Nov 21, 2026
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.
On Metal, DeepSeek-V4.1 picks a row's token on the host (
metal/target.zig,choose). A greedy pick scanned all 129,280 logits one at a time. A sampled pick allocated a float64 copy of the logits and an id list, about 2 MB, on every row before calling the lane core'ssampling.choose. A drafted round picks one row per window row, so this adds up.sampling.chooseon the same values, so the draw is unchanged.On an M5 Ultra (512 GB), release weights, with #2973, #2983 and the FP8 rows change underneath, on the five prose prompts of
tools/bench_prompts.jsonat 512 tokens, one run each:Every reply's text equals main's (10 of 10).
zig build test-dsv41-metal -Dcpu=apple_m1passes on an M5 Max, and lean reports no new problems.