Repository navigation
flashnext metal: scale index on Macs with tensor units too - #4547
Merged
Merged
Conversation
Owner
Author
|
Prompt check on an M5 Ultra (Flash Next 4-bit MTP, one stream, main vs this change, order warm base new new base, prompts of 2K, 8K and 16K tokens at several start offsets):
With the decode sweep above (chat and code, +2.1% to +4.7%, identical tokens at temperature 0), this is exact and faster on M5, so it goes into the landing trains.
|
This was referenced Nov 22, 2026
The 4-bit expert scale and bias index (TF_FLASHNEXT_SCALE_INDEX, on by default) was limited to Macs without tensor units. It looks up the same bf16 pair through a lossless table, so it applies on M5 as well: one stream on an M5 Ultra kept every token at temperature 0 and ran 2.1-4.7% faster on chat and code.
ashhart
force-pushed
the
lead/fn-m5-scale-index
branch
from
November 22, 2026 10:05
4a4e4b3 to
4bcd9dd
Compare
ashhart
added a commit
that referenced
this pull request
Nov 22, 2026
…the scale index The Nemotron HIP page-fault test built its pool's ids with pages.Ids.init, but the family's pages.zig keeps Ids in hip_serve's shared pages and doesn't re-export it, so the test didn't compile. It now calls hip_serve.pages.Ids.init, as the pool's own field type does. #4547 turned the Flash Next scale index on for M5 too; the recipe's paragraph still said M1 through M4. Both found in @AIFlowML's PR sweep. Co-authored-by: AIFlowML <[email protected]>
ashhart
added a commit
that referenced
this pull request
Nov 22, 2026
…the scale index The Nemotron HIP page-fault test built its pool's ids with pages.Ids.init, but the family's pages.zig keeps Ids in hip_serve's shared pages and doesn't re-export it, so the test didn't compile. It now calls hip_serve.pages.Ids.init, as the pool's own field type does. #4547 turned the Flash Next scale index on for M5 too; the recipe's paragraph still said M1 through M4. Both found in @AIFlowML's PR sweep. Co-authored-by: AIFlowML <[email protected]>
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.
What this changes
TF_FLASHNEXT_SCALE_INDEX(on by default) reads each 4-bit expert group's bf16 scale and bias through a 16-bit index into a lossless table of the tensor's unique pairs, cutting about 10% of expert bytes. It was limited to Macs without tensor units; nothing in it depends on them, so this drops that condition. Docs updated.Measured
M5 Ultra, Flash Next 4-bit MTP, one stream, main vs this change, order warm base new new base:
Token hashes at temperature 0 are identical in all four runs (code and chat), and every reply matched its alone run.
Still to run
Prompt processing on the M5 (the prompt kernels also read through the index) at 2K-32K with tokens compared; queued.