Repository navigation
flashnext metal: tensor units take the default decode share and growing prompt steps - #2394
Merged
Merged
Conversation
ashhart
added a commit
that referenced
this pull request
Nov 6, 2026
ashhart
added a commit
that referenced
this pull request
Nov 6, 2026
ashhart
force-pushed
the
lead/m5-share
branch
from
November 6, 2026 21:03
bd94c93 to
c45c59b
Compare
9 tasks done
…ng prompt steps On a chip with tensor units, an explicit --parallel 2 or more gave a filling prompt no decode share and kept its steps beside a running reply at 32 rows, so each slowed the other. The shared host now gives every Mac the same default: replies take 0.8 of a fill step's time and a prompt's steps grow to 512 rows after eight. The flag and TENSORFOLD_PREFILL_SHARE keep their meanings, and --parallel auto still uses the single host.
ashhart
force-pushed
the
lead/m5-share
branch
from
November 7, 2026 07:58
c45c59b to
66e4dad
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.
What this changes
On a Mac with tensor units (M5), Flash Next at an explicit
--parallel 2or more broke from the other Macs' defaults in two ways:prefill.shareOfgave a filling prompt no decode share.fill_growsstayed off, so beside a running reply the prompt took 32-row steps for its whole length.Each slowed the other. Now every Mac takes the same defaults: replies take 0.8 of a fill step's time, and a prompt's steps grow to 512 rows after eight.
--decode-shareandTENSORFOLD_PREFILL_SHAREkeep their meanings, and--decode-share 0still prefills each prompt whole.--parallel autostill uses the single host. Chips without tensor units run exactly what they ran before, since both removed conditions were true only on tensor units.18ecc42d6).atc overlap --json: incomplete coverage (time limit). Eight open PRs share one file each, all clean against this head. lfm3: add native Metal vision support above the text decoder #1502 also editsdocs/api.md; that file merges cleanly with this branch, and lfm3: add native Metal vision support above the text decoder #1502's one conflict isregistry.zig, againstmain.Checks on this head
c45c59b19. It is the same code as0b1983b58, rebased ontomain18ecc42d6past a CHANGELOG-only conflict.zig build test: 715 / 715 steps, 0 failures.test-flashnext-scheduling-hostpasses.exl3_load's allocation sweep, also fails onmainwhen the checkout sits in one particular folder here, and passes from another, with and without this change. It is unrelated to this PR, and I'll look at it apart.Receipt
Environment: M5 Ultra;
TensorFold/Qwen3.8-Flash-Next-MLX-4bit-MTPat2b170fa6; ReleaseFast-Dcpu=apple_m1; one fresh server per arm; order warm, main, new, new, main; greedy withignore_eos.main8bf5dbc35. Measured:bb640e015, which is this head's code before its rebase and its known-issues line.Exactness: every request's token hash is equal across every arm,
main's and this PR's: 12 of 12 two-client requests, and both orders of the 64K cell. Drafts were on (MTP) throughout.Two clients at once, prompt cache 8 GiB,
--context 73728. An agent sends 6 growing turns (16K tokens, then 6K new a turn, 128-token replies) beside 6 short asks with 768-token replies:--parallel 2, no share flagmainOn the same box:
--parallel 1finishes both in 40.2 s, with the asks' first tokens summing to 13.7 s. This PR with--decode-share 0.95takes 43.8 s, with 8.5 s.A 64K-token prompt beside a 1,024-token reply, prompt cache off, each order once a run:
--parallel 2, no share flagmainAlone, the reply takes 4.9 s and the prompt 14.4 s.
--parallel 1gave 19.0 to 19.2 s for both, onmain86cfc3556.Decode and prompt speed at one stream:
--parallel 1andautorun the single host, which this doesn't reach. At--parallel 2, the cells above time decode beside a prompt and the prompt beside a reply.Licence of any new weights or drafter: n/a.
What it costs, and why:
main. There, the agent's prompt crawled in 32-row steps, so a short prompt rarely waited behind a pass. Each ask still finishes three times sooner.mainwith--decode-share 0.8shows the cost of 32-row steps on M5. Each one beside a reply took about 76 ms, ten times what its rows take at full speed: about 5 s of a 49 s run.Still open on #1893, as
docs/known-issues.mdnow says: on M5,--parallel 2remains slower than--parallel 1, 47 s against 40 s with two clients. A higher share and longer steps both help: 43.8 s at 0.95, and 44.1 s with 2,048-row steps at 0.8. The next measurements are 512-row steps from the start on tensor units, and the lone driver at--parallel 2, which is still off on tensor units.Checklist
main's three-argumentshareOf, so I can't show it failing there.)"draft": false, a resumed prompt equals a fresh one, and concurrent equals solo. (Scheduling only: replies equalmain's in every arm.)--parallel 2, an ask's first token comes about 0.8 s later, as above.)