Repository navigation
Conversation
… sampling_row lfm3/backend.zig's draw was a byte copy of the general row draw core-sampler-1 moved into core/lanes/sampling_row.zig; it keeps its greedy.select fast path and maps the core errors back to NonfiniteLfmLogits / NoAllowedLfmToken. flashnext/host_sample.zig's reference (the oracle its one-pass draw is tested against) was the same copy without a mask; it now calls core under the Qwen names. Tests pin the mapped error names on both.
Two choices M1-M4 already make were switched off on GPUs with tensor units: - keepStates and keepLoneStates returned early on tensorUnits(), so an M5 wrote every window row's DeltaNet state each round and then copied the kept one, instead of keeping one state a layer and replaying the kept rows. - rows_w.nib gave generation 17 the plain converts, so the 4/32 expert, dense row and hyper-connection kernels converted each code to float one at a time instead of two a half operation. Both now apply on M5 as on M3 and M4. M1 and M2 keep the exponent trick. Replies are unchanged. On an M5 Ultra (Qwen3.8-Flash-Next MLX 4-bit MTP, one stream, 16 prompts of 512 tokens, main/new/new/main): - greedy 206.4 -> 220.2 tok/s (+6.6%), sampled 184.5 -> 196.6 (+6.5%), "draft": false 109.1 -> 111.3 (+2.0%), no prompt slower - tokens equal to main on 32 of 32 replies; drafted == "draft": false 16 of 16 - --parallel 4, distinct prompts staggered: every concurrent reply equals its solo run; sampled 1/2/4 streams +5.0/+4.7/+0.8%, greedy +7.2/+3.5/+4.9% zig build test-native passes on an M5 Max; lean 0 new.
Owner
Author
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.
CI for a landing train: #2679 #3271 stacked on main in that order. Nothing merges from this PR: each PR above lands on its own once this tip is green, and this PR is then closed.