Repository navigation
Load ModelOpt and compressed-tensors exports on the fine-grained formats - #49823
Draft
IlyasMoutawwakil wants to merge 6 commits into
Draft
IlyasMoutawwakil wants to merge 6 commits into
IlyasMoutawwakil wants to merge 6 commits into
Conversation
|
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
IlyasMoutawwakil
force-pushed
the
fg-split/9-producers
branch
from
October 21, 2026 14:52
ebf47d3 to
3841dd3
Compare
IlyasMoutawwakil
force-pushed
the
fg-split/9-producers
branch
3 times, most recently
from
October 22, 2026 07:18
0fa8fdb to
ed28d48
Compare
IlyasMoutawwakil
force-pushed
the
fg-split/9-producers
branch
from
October 23, 2026 13:03
ed28d48 to
e3114d1
Compare
- read_modelopt and read_compressed_tensors turn a producer's config into the format configs, or a FineGrainedConfig for an export that mixes formats. - Each format reads its producers' tensor layouts. FP8 gives ModelOpt's 0-d per-expert scales a 1x1 grid. NVFP4 inverts compressed-tensors' reciprocal globals. - A passed CompressedTensorsConfig keeps compressed-tensors as the backend. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A ModelOpt export names one module per expert, such as experts.3.gate_proj. The model fuses them into one experts module. Each piece's name comes from the param's reversed converter. A fused module takes one format, so its entries must cover all of its pieces in the same format. Any other entry that matches no module raises. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A big MoE lists tens of thousands of modules. One pattern per module made plan resolution scale with names times patterns, hours at that size. The names of one format now share one trie-shaped regex, which matches exactly the listed modules. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
IlyasMoutawwakil
force-pushed
the
fg-split/9-producers
branch
from
October 23, 2026 13:35
e3114d1 to
1137ef3
Compare
Contributor
|
[For maintainers] Suggested jobs to run (before merge) run-slow: finegrained, finegrained_fp8, fp8, mxfp4, mxfp8, nvfp4 |
This was referenced Nov 24, 2026
This branch has not been deployed
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.
What. The checkpoints that NVIDIA ModelOpt and compressed-tensors export load on the fine-grained formats of
#49777 to #49780. A reader turns the producer's
quantization_configinto the configs that load it, so there is noproducer quantizer.
read_modelopt: one format perquant_algo(FP8,NVFP4,W4A16_NVFP4,MXFP8,MXFP4,W4A16_MXFP4).An export that mixes formats, through
config_groupsorMIXED_PRECISION'squantized_layers, reads as aFineGrainedConfig.exclude_modulesandignorebecomeNoneentries in a plan, or the skip-list of one format.read_compressed_tensors: per-tensor and block FP8, NVFP4 and MXfloat-quantizedgroups, e.g.RedHatAI/Llama-3.2-1B-Instruct-FP8andRedHatAI/Qwen3-8B-FP8-block. Integer, per-channel, sparse, transformed andKV-cache checkpoints return
None, soCompressedTensorsConfigloads them as on main.weight_scale, the same multiplier asweight_scale_inv, so loading renames it;(
FineGrainedScalarScales);weight_packedandinput_global_scale;CompressedTensorsConfigreads the checkpoint as its own class, so it keeps compressed-tensors as thebackend.
experts.3.gate_proj. The host's plan resolution (Fine-grained quantization: a host quantizer that mixes methods per module #49818)maps them to the fused
expertsmodule. All of its pieces must have the same format.MIXED_PRECISIONexport lists every module, tens of thousands for a big MoE. The reader turns the names of oneformat into one regex that matches exactly those modules. Names that differ only in a layer or expert index share
an alternation. So the plan has one entry per format, and resolution takes well under a second at 60 layers x 256
experts. One pattern per module took hours there.
Behaviour change. Compressed-tensors FP8, NVFP4 and MX checkpoints that the fine-grained kernels serve now load
through them. Pass a
CompressedTensorsConfigto keep compressed-tensors for any checkpoint. KV-cache checkpoints staywith compressed-tensors. ModelOpt exports had no loader in transformers before.
Depends on. #49780.
How tested.
tests/quantization/finegrained/test_config_readers.py, the ModelOpt and compressed-tensors loadingtests in
tests/integrations/finegrained/test_loading_regressions.pyand each format's suite. The tiny ModelOpt andcompressed-tensors checkpoints in the tests load and save back as shipped.
nvidia/GLM-5.2-NVFP4loads and answers.The comments and docstrings that say why each change exists are there for readability. Feel free to ask for any of them to go if it's self-evident.
🤖 Generated with Claude Code