Skip to content

quantization: complete MXFP4 and NVFP4 - #26869

Open
qikpl4 wants to merge 1 commit into
ggml-org:masterfrom
qikpl4:xxfp4
Open

qikpl4 wants to merge 1 commit into
ggml-org:masterfrom
qikpl4:xxfp4

Conversation

@qikpl4

@qikpl4 qikpl4 commented Aug 10, 2026 •

Copy link
Copy Markdown

This PR/commit implements dense MXFP4 support (all tensors), and MoE NVFP4 (similar to MXFP4). It also implements the quantization routine for these types:

  • MXFP4
  • MXFP4_MOE
  • NVFP4
  • NVFP4_MOE

Overview

See above.

More specifically, it also adds NVFP4_MOE and MXFP4 quantization types which are new. The engine could already process these but with warnings, and this also is fixed.

Additional information

Unlike other implementations of finished MXFP4 and NVFP4 support, this gives the best of all the worlds. People who want a dense MXFP4 get it, people who want MoE NVFP4 get it, and now people can have NVFP4 too. This PR kills multiple birds with one stone.

Note: This PR was moved to a different account due to multiple reasons relating to GitHub ToS and Support

Requirements

@qikpl4
qikpl4 requested a review from ggerganov as a code owner August 10, 2026 21:46
@qikpl4

qikpl4 commented Aug 11, 2026

Copy link
Copy Markdown
Author

/bot review

@ggml-gh-bot

ggml-gh-bot Bot commented Aug 11, 2026

Copy link
Copy Markdown

Sorry @qikpl4, only members of the ggml-org organization can trigger /bot commands.

@alfiedotwtf

Copy link
Copy Markdown

The majority of the changes seem to be unrelated to the PR. You’ve got a better chance of this landing if the diff only contains what’s needed

@qikpl4

qikpl4 commented Aug 26, 2026 •

Copy link
Copy Markdown
Author

The majority of the changes seem to be unrelated to the PR. You’ve got a better chance of this landing if the diff only contains what’s needed

It contains everything described...maybe you're confused and saw a large rebase?

huaxel pushed a commit to huaxel/strix-llama.cpp that referenced this pull request Sep 29, 2026
… Puzzle)

Cherry-picked upstream ggml-org#25444 renamed scalar hparams.n_expert_used and
hparams.n_ff_exp to _impl fields and added per-layer accessors (matching
the previous PR ggml-org#26869 rename of the scalar fields). CachyLLama missed a
few call sites:

- llama_model_n_expert_used (C API)
- llama_moe_residency
- llama_context stats/selection populators
- qwen4exp load_arch_tensors MTP-layer loop (line 276, originally wrote
  n_ff_exp without the parenthesised accessor; pre-rename it worked because
  the field existed; post-rename it has to use the method)

All bare hparams.n_expert_used / hparams.n_ff_exp references in CachyLLama
code now use the accessors.
huaxel pushed a commit to huaxel/strix-llama.cpp that referenced this pull request Sep 29, 2026
… Puzzle)

Cherry-picked upstream ggml-org#25444 renamed scalar hparams.n_expert_used and
hparams.n_ff_exp to _impl fields and added per-layer accessors (matching
the previous PR ggml-org#26869 rename of the scalar fields). CachyLLama missed a
few call sites:

- llama_model_n_expert_used (C API)
- llama_moe_residency
- llama_context stats/selection populators
- qwen4exp load_arch_tensors MTP-layer loop (line 276, originally wrote
  n_ff_exp without the parenthesised accessor; pre-rename it worked because
  the field existed; post-rename it has to use the method)

All bare hparams.n_expert_used / hparams.n_ff_exp references in CachyLLama
code now use the accessors.
This PR/commit implements dense MXFP4 support (all tensors),
and MoE NVFP4 (similar to MXFP4). It implements the quantization
routine for all of these types.
huaxel pushed a commit to huaxel/strix-llama.cpp that referenced this pull request Oct 26, 2026
… Puzzle)

Cherry-picked upstream ggml-org#25444 renamed scalar hparams.n_expert_used and
hparams.n_ff_exp to _impl fields and added per-layer accessors (matching
the previous PR ggml-org#26869 rename of the scalar fields). CachyLLama missed a
few call sites:

- llama_model_n_expert_used (C API)
- llama_moe_residency
- llama_context stats/selection populators
- qwen4exp load_arch_tensors MTP-layer loop (line 276, originally wrote
  n_ff_exp without the parenthesised accessor; pre-rename it worked because
  the field existed; post-rename it has to use the method)

All bare hparams.n_expert_used / hparams.n_ff_exp references in CachyLLama
code now use the accessors.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants