Repository navigation
AffineQuantizedVectors: rows in registers for a verify window on M5 Ultra - #373
Merged
Merged
Conversation
…ltra Two M5 Ultra 256 GB (applegpu_g17d) serving the Qwen3.8 27B tensor-parallel pair measured the rows-in-registers schedule fastest for a verify window's four and five vectors: the one-request round went from 35.3 to 33.2 ms (medians of about 540 rounds, two runs each), decode from 75.8 to 80.5 tok/s at 256 tokens and from 62.7 to 66.8 at 1,024. Every output was byte-identical: a layout only decides which threads compute what. The table is keyed by architecture ahead of the family's, so the M5 Max (applegpu_g17s) and the M3 Ultra keep theirs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2 of 5 tasks
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.
Proposed changes
AffineQuantizedVectorstakes its layout (rows per SIMD group, SIMD groups, vectors per weight read, schedule) froma per-family table. Family 17 covers both the M5 Max and the M5 Ultra, and its entries were measured on an M5 Max.
On two M5 Ultra 256 GB (
applegpu_g17d) serving the Qwen3.8 27B tensor-parallel pair, the rows-in-registersschedule (
b:2:2:4,b:2:2:5) is faster for a verify window's four and five vectors than the family'sa:2:4:4/a:2:4:5.This PR adds a table keyed by architecture, checked ahead of the family table. Only
applegpu_g17dhas an entry; theM5 Max (
applegpu_g17s) and the M3 Ultra keep theirs. A layout only decides which threads compute what. The kernelpins every operation's order, so results are unchanged.
Measured on the pair (installed Darkbloom DevNet build branch.9 with only this change in the cluster worker;
one request; medians):
a:2:4:4(family table)b:2:2:4(this PR)The layout sweep (
b:2:4:4,b:2:8:4,b:1:4:4,b:4:4:4,a:4:4:4,a:1:4:4,a:2:8:4,a:2:2:4,a:1:8:4,t:2:4:4, andb:4:4:1for one vector) produced identical outputs in every case. Only therows-in-registers schedule with two rows per SIMD group was faster.
The cluster's byte-parity tests already cover every layout, schedule and tile. d-inference pins this commit (
f98ced91) and addsan expectation that
applegpu_g17dresolvesbr2s2v4for four vectors whileapplegpu_g17sandapplegpu_g15dkeep
ar2s4v4(AffineQuantizedVectorsTests.layoutsAreValidForEveryVectorCountAndFamily).Checklist
Put an
xin the boxes that apply.pre-commit run --all-filesto format my code / installed pre-commit prior to committing changes (swift-format lintwith.swift-formatpasses; the pinned pre-commit was not run)AI usage
accurately describes the code changes.
table change and this description).
swift-format lintwith the repo's.swift-formatpasses; the pinnedpre-commit version was not run locally.