metal: speed up IQ2_XXS MoE prefill with half LUT and split MPP - #864
Open
mobailabs wants to merge 1 commit into
Open
metal: speed up IQ2_XXS MoE prefill with half LUT and split MPP#864mobailabs wants to merge 1 commit into
mobailabs wants to merge 1 commit into
Conversation
…IQ2_XXS dequant into a half LUT and rewrite mul_mm_id_mpp as split-tile + pipeline + tail cull (12 KiB threadgroup). On M5 Max Flash IQ2 this is about +5-8% prefill vs the same-machine baseline;decode is unchanged. Q2_K f16 down shares the same MPP kernel.
GiorgioOppo
added a commit
to GiorgioOppo/ds4
that referenced
this pull request
Aug 25, 2026
Use an exact binary16 dequantization LUT and split the Metal MPP routed matmul into double-buffered 16-row tiles with tail culling. Preserve the packed route map integration from this branch. Adapted from antirez#864. Co-authored-by: cole <imzhpe@qq.com>
Contributor
|
Great boost here! Wow! |
GiorgioOppo
added a commit
to GiorgioOppo/ds4
that referenced
this pull request
Sep 1, 2026
Use an exact binary16 dequantization LUT and split the Metal MPP routed matmul into double-buffered 16-row tiles with tail culling. Preserve the packed route map integration from this branch. Adapted from antirez#864. Co-authored-by: cole <imzhpe@qq.com>
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.
Summary
mul_mm_iddequant to a baked half LUT (0.25 * gridin binary16), then apply sign by XOR on the half bits.kernel_mul_mm_id_mppin place as split-tile (two M=16matmul2ds) + double-buffer pipeline + tail cull. MPP threadgroup is 12 KiB. Pipeline names are unchanged.Test plan
DeepSeek-V4-Flash-IQ2XXS-w2Q2K-AProjQ8-SExpQ8-OutQ8-chat-v2-imatrix-0731.ggufds4-benchsweep (promessi_sposi.txt, ctx 2048–65536 step 2048, 128 greedy tokens)c1d4597make ds4_test && ./ds4_test --metal-kernelson the PR treePrefill is about +5–8% vs the same-machine origin baseline (32-point mean about +6.4%). Decode is unchanged.