Repository navigation
Conversation
Collaborator
|
Thanks for your contribution! Is there a specific model you’re optimising this kernel for? |
Author
|
Not a specific model. This targets the affine QMM kernel itself for large-M workloads on Apple Silicon. I measured five M4 Max configurations with 4/8-bit weights and BF16 activations, including M=2048 at 4-bit. I have not claimed an end-to-end model speedup; that would need a separate serving benchmark. |
This branch has not been deployed
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.
Fixes #4621. Large transposed affine QMM leaves performance on the table with the existing tile path. This adds 64x64 instantiations for 4-bit and 8-bit weights and selects them for non-NAX hardware with
B == 1when the M threshold and the existing padding and threadgroup-count gates pass:M >= 512for 4-bit andM >= 2048for 8-bit.NAX, small-M, batched, non-transposed, and split-K dispatch are unchanged. The added 90-subtest regression passes across exact and partial tiles, group sizes 32/64/128, both bit widths, and float32/float16/bfloat16.
On an Apple M4 Max with bfloat16 activations,
N = 12288,K = 4096, and group size 64, every measured shape has lower median latency on this branch. Main isc69303b00f5f61860436e832f23fa8c34b96f93a; each value is the median of three process-level medians, with 20 measured calls after three warmups and alternating main/PR order.Run this three times on main and this branch, alternating order: