[CUDA] Add global scale support to gather_qmm - #4507
Merged
Merged
Conversation
nastya236
approved these changes
Sep 16, 2026
Collaborator
|
Thanks! Why "optimizes performance"? Did you notice a speed up? General overall note: after giving this some more thought, I realised that dequantization during inference would be correct if and only if it matches the training. I believe there are two possible ways to produce nvfp4 weights:
Given that in the future all quantized operations during training will be native, I think it is okay to agree on folding it into epilogue. However, probably we should do the same for metal.. |
nastya236
self-requested a review
September 16, 2026 09:56
nastya236
requested changes
Sep 16, 2026
nastya236
left a comment
Collaborator
There was a problem hiding this comment.
Some tests are failing can you have a look?
dhiltgen
force-pushed
the
cuda_g_qmm_global_scle
branch
from
September 16, 2026 16:49
fcd135f to
d3012f2
Compare
Contributor
Author
On further testing, I couldn't reproduce any speedup in the second commit so I've dropped it and the claim. |
nastya236
approved these changes
Sep 17, 2026
nastya236
approved these changes
Sep 17, 2026
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.
This adds support for global scales in gather_qmm on cuda.
mlx-lm perf data with qwen 3.6 35B tested on a 5090. (p2048/g128)
Attached wrapper script loads the Model Optimizer exports and wires up gather_qmm global scale, and adjusts dtypes for a fair comparison with the standard community model.
modelopt_nvfp4_mlxlm.py