Skip to content

feat(quant): thread a mode argument through gather_qmm - #358

Open
sergey-scherbina wants to merge 1 commit into
oxiglade:mainfrom
sergey-scherbina:feat/gather-qmm-mode
Open

feat(quant): thread a mode argument through gather_qmm#358
sergey-scherbina wants to merge 1 commit into
oxiglade:mainfrom
sergey-scherbina:feat/gather-qmm-mode

Conversation

@sergey-scherbina

Copy link
Copy Markdown

Summary

gather_qmm hardcodes DEFAULT_MODE ("affine") when calling
mlx_gather_qmm, so it cannot gather over weights stored in a microscaling
format such as "mxfp4" (scales only, no zero-point biases) — even though the
underlying C API accepts a mode, and quantize / dequantize (and the
nvfp4/mxfp8 helpers) already expose one.

Change

Add an optional mode: impl Into<Option<&str>> parameter to gather_qmm,
defaulting to "affine" so existing behavior is unchanged. The plumbing mirrors
the existing mode handling on the nvfp4/mxfp8 quantization helpers (CString

  • mode_cstr.as_ptr()).

Existing test_gather_qmm callers are updated to pass the new optional
argument; they continue to exercise the default affine path.

`gather_qmm` hardcoded `DEFAULT_MODE` ("affine"), so it could not gather over
weights stored in a microscaling format such as "mxfp4" (scales only, no
zero-point biases), even though the underlying `mlx_gather_qmm` C API and
`quantize`/`dequantize` already accept a `mode`. Add an optional `mode`
parameter (default "affine", so existing behavior is unchanged), mirroring the
existing `mode` plumbing on the nvfp4/mxfp8 quantization helpers.

Existing `test_gather_qmm` callers updated to pass the new optional argument.
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.

1 participant