Skip to content

Cleanup metal quantized kernel instantiations - #4741

Merged
zcbenz merged 1 commit into
mainfrom
metal-kernel-dispatch
Oct 26, 2026
Merged

zcbenz merged 1 commit into
mainfrom
metal-kernel-dispatch

Conversation

@zcbenz

@zcbenz zcbenz commented Oct 22, 2026

Copy link
Copy Markdown
Member

As we add more quantized kernels the .metal files have become a mess that it is challenging to add a new instantiation, and quite hard to find out the exact combinations that kernel has been instantiated for. This PR reorganizes the .metal files to group the kernels separately, so it becomes much easier to add new kernels and new tunable parameters.

The template parameters of some kernels are also reordered to keep a consistent style between all kernels and the instantiate macros.

@zcbenz
zcbenz force-pushed the metal-kernel-dispatch branch from 61740f1 to 3ffd012 Compare October 23, 2026 01:09

@jagrit06 jagrit06 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for taking the time

@zcbenz
zcbenz force-pushed the metal-kernel-dispatch branch from 3ffd012 to 5663920 Compare October 26, 2026 09:38
@zcbenz
zcbenz merged commit 8329918 into main Oct 26, 2026
30 checks passed
@zcbenz
zcbenz deleted the metal-kernel-dispatch branch October 26, 2026 10:23
Brooooooklyn added a commit to mlx-node/mlx that referenced this pull request Nov 29, 2026
…ge N, and keep MLX_QMM_SPLITK_MIN_M

Drop the affine qmv_wide nv6-8 hunk (now upstream via ml-explore#4728/ml-explore#4741), keep
fp_quantized.metal qmv_wide nv6-8 instantiations, cap fp qmv_wide tiles at
8 when N >= 2048 (preserving upstream affine=8 for all N), and keep the
MLX_QMM_SPLITK_MIN_M override in dispatch_qmm_t() and !transpose_.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants