Repository navigation
Releases
0.49.0rc0
Install this pre-release version using:
pip install "nvidia-modelopt[all] @ https://github.com/NVIDIA/Model-Optimizer/releases/download/0.49.0rc0/nvidia_modelopt-0.49.0rc0-py3-none-any.whl"ModelOpt 0.47.1 Release
Bug Fixes
- Fix NVFP4 fake quantization (e.g.
NVFP4_DEFAULT_CFG) with Triton 3.9, as in the PyTorch 26.11 container, on GPUs with compute capability 8.9 or newer: it failed withNotImplementedError: Block pointers have been removed in favor of the tensor descriptor API.
0.47.1rc0
ModelOpt 0.48.0 Release
New Features
Sparsity
- Add skip-softmax calibration through vLLM for FlashAttention and FlashInfer, requiring
--validation_prompts_fileand validating serving sparsity on calibration and held-out prompts before exporting prefill/decode fits and their validation scope assparse_attention_config. Calibration uses single-sequence, unchunked eager execution; serving preserves the calibrated 128-token KV-tile granularity and 128-row prefill Q tiles, autotunes only its execution schedule, and uses a smaller Q tile for one-token decode. - Sparse-only vLLM installs now reject unsupported DCP, DBO/ubatching, speculative decoding, and FULL mixed-batch CUDA graphs; calibrated decode also rejects FULL decode graphs.
Quantization
- Add metadata-only export specifications and non-mutating per-weight quantizer-state capture.
- Add functional quantized-weight packing, topology-aligned state merge/select and transport APIs, and canonical Hugging Face quantization-config construction.
- HF export records canonical activation schemes, group/block sizes and weight-only MXFP4 metadata; mixed-format exports retain unquantized-layer exclusions, and non-square FP8 block layouts are rejected.
- Add Q8_0 weight-only quantization with 32-value GGML blocks, packed unified HF and Megatron export, and a built-in
q8_0PTQ recipe. - Add Hugging Face PTQ calibration and export support for Nemotron-H MTP modules, preserving calibrated expert input scales.
- Add the
models/nvidia/NVIDIA-Nemotron-3.5-Super-VL-120B-A12B-BF16/ptq/nvfp4-msePTQ recipe, the PTQ stage for NVIDIA Nemotron 3.5 Super VL: weight-MSE calibrated NVFP4 routed and shared MoE experts, FP8 attention projections, Mambain_proj/out_projandlm_head, and an FP8 KV cache. The latent MoE, router, embeddings and the vision and audio encoders stay in BF16, and the MTP rules apply only to checkpoints that carry an MTP tail. It reproduces the released precision assignment, not the released weights: the published NVFP4 checkpoint adds quantization-aware distillation after this stage. - Backfill checkpoint aliases for three more published NVFP4 releases:
moonshotai/Kimi-K2.7-Code,google/gemma-4-26B-A4B-itandgoogle/diffusiongemma-26B-A4B-it. Each imports an existing general recipe wholesale rather than copying its body. - Backfill checkpoint aliases for nine more published NVFP4 releases, so each is reachable from its source model's hub path:
zai-org/GLM-5.1andGLM-5.2,MiniMaxAI/MiniMax-M2.5andMiniMax-M3,deepseek-ai/DeepSeek-V3.1andDeepSeek-V3.2,Qwen/Qwen3-235B-A22B-Instruct-2507and-Thinking-2507, andQwen/Qwen3.6-27B. Each imports an existing general or architecture recipe wholesale rather than copying its body. - Add composed Hugging Face AutoQuantize recipes that run fixed PTQ or weight AutoQuantize before
a separate KV-cache AutoQuantize stage, with independent resumable checkpoints for the weight and
KV searches. Uniform-weight plus layer-wise mixed-KV exports are marked unsupported for deployment
until a runtime consumes that metadata combination. - Add IQ1_S and IQ2_XS weight-only quantization with GGML-compatible 256-value block encoders, built-in
iq1_s/iq2_xsPTQ recipes, and unified HF and Megatron export of the packed blocks. Quantized weights must have a final dimension divisible by 256, and Megatron export requires tensor and pipeline parallel sizes of 1. - Add
iq2_xxsweight-only quantization with a CUDA encoder and ageneral/ptqrecipe, at 2.0625 bits per weight betweeniq1_sandiq2_xs. The same 256-value block constraint applies. - Add
iq2_sweight-only quantization with a CUDA encoder and ageneral/ptqrecipe, at 2.5625 bits per weight aboveiq2_xs. The same 256-value block constraint applies. - Add
iq1_mweight-only quantization with a CUDA encoder and ageneral/ptqrecipe, at 1.75 bits per weight betweeniq1_sandiq2_xxs. The same 256-value block constraint applies. - GPTQ (
algorithm: {method: gptq}) now supports the GGML formats (iq1_s,iq1_m,iq2_xxs,iq2_xs,iq2_s,q8_0). Each GGML block is quantized as a whole and its error compensated in the later columns, and export writes exactly the codes GPTQ chose.block_sizemust be a multiple of the format's block size (256 for the IQ formats). The built-iniq1_s,iq1_m,iq2_xxs,iq2_xsandiq2_srecipes now quantize only the MLP/MoE weights and calibrate them with GPTQ, so they need calibration data. - The
iq1_s,iq1_m,iq2_xxs,iq2_xsandiq2_sencoders accept an optional per-input-columnimportancethat weights each value's squared error in the codebook search, as llama.cpp's imatrix does. GPTQ's newimportance_weightedoption passes them the square root of its Hessian diagonal, and the built-in IQ1 and IQ2 recipes enable it, so each block's search favours the columns its outputs depend on most. - A recipe can now delegate its whole body to another recipe with a top-level
$import; any top-level key given alongside it overrides the imported one.metadata.recipe_typebecame optional along with it: a recipe states its kind with a# modelopt-schema:comment, withmetadata.recipe_type, or by delegating to a recipe that does, and only a recipe that another file imports has to carry the schema comment. Whatever a recipe does state must be true: a schema comment and arecipe_typemust agree, and so must a recipe and the recipe it delegates to.modelopt_recipes/models/uses this for checkpoint entries that a portable recipe already reproduces: the entry aliases that recipe instead of copying it. - Backfill the recipes behind NVIDIA's already-published checkpoints under
modelopt_recipes/models/, so a released checkpoint's quantization scheme is reachable from its own model-hub path rather than only from the general tier. For example,moonshotai/Kimi-K2.6(published asnvidia/Kimi-K2.6-NVFP4) andQwen/Qwen3.5-397B-A17B(published asnvidia/Qwen3.5-397B-A17B-NVFP4-V2) each alias a portable recipe wholesale -- the general expert-only NVFP4 recipe and theqwen3_5_moearchitecture recipe respectively -- rather than copying its body; other checkpoints follow in separate changes. - Add
layerwise.export_dir: layerwise calibration writes each decoder layer to its own quantized checkpoint shard as it finishes, so no separateexport_hf_checkpoint()pass is needed and, withlayerwise.checkpoint_dir, an interrupted run resumes without redoing finished layers. Calibration writes the layer shards;finalize()on the exporter left on the model adds the tail shard, the index and the config artifacts, and the checkpoint does not load until it runs.examples/hf_ptqdoes this for you. Supports FP8 and NVFP4 on single-process models, resident or offloaded, including multimodal models and models with MTP layers; other formats and placements raiseNotImplementedErrorbefore calibration starts. - Add support for quantizing and calibrating enabled operators outside the transformer layers, such as
lm_head, when using layerwise calibration. - Add an end-to-end BEVFormer ONNX PTQ example with temporal calibration data generation, INT8 and FP8 quantization, TensorRT engine building, and nuScenes accuracy evaluation. See examples/onnx_ptq/bevformer/README.md for details.
- Add a reusable local-Hessian NVFP4 PTQ recipe and the quantization recipe used for
nvidia/Qwen3.8-27B-NVFP4. - Add experimental dynamic FP8 fake quantization of GatedDeltaNet chunk-boundary states and WY activations for training through the standard
quant_cfginterface. The fused GDN path requiresfla-core==0.5.1and chunk size 64; state emulation requires SM89 or newer. - Add fake quantization of the sparse-attention indexer key cache and query for DeepSeek-V4 (vLLM and Megatron-Core) and GLM-5.3-Flash (vLLM) through the new
indexer_k_quantizerandindexer_q_quantizer. Enable them by importing theconfigs/ptq/units/indexer_k_nvfp4andconfigs/ptq/units/indexer_q_nvfp4units (NVFP4 with the global scale fixed to 1) into a recipe. - Add
indexer_scorer_kwargs_quantizerto pass keyword arguments, such as the numerics options of a DeepGEMM build, to the DeepGEMM indexer scorer kernel of GLM-5.3-Flash per layer in vLLM fake-quant serving; see examples/vllm_serve/README.md. - Add the
configs/ptq/units/kv_nvfp4_mlarecipe unit for fake quantization of the MLA KV cache (DeepSeek-V3, GLM-5.3-Flash, ...) in vLLM fake-quant serving: NVFP4 for the latent and FP8 for the RoPE key. See examples/vllm_serve/README.md for an example recipe. - Add fake quantization of MoE expert-parallel communication to vLLM fake-quant serving through the new
dispatch_quantizerandcombine_quantizeron vLLM's routed experts, for MoE layers built on vLLM's fused-MoE layer and any all-to-all backend, and for the DeepGEMM Mega-MoE kernel of DeepSeek-V4 and Kimi-K3 (--moe-backend deep_gemm_mega_moe). Enable them by importing theconfigs/ptq/units/moe_dispatch_nvfp4andconfigs/ptq/units/moe_combine_nvfp4units into a recipe; seeexamples/vllm_serve/README.md. - vLLM fake-quant serving now runs on pre-quantized checkpoints such as FP8 when the recipe leaves those layers unquantized (for example a KV-cache-only recipe), and on MLA models with an FP8 KV cache; both previously failed during quantization.
KV_QUANT_CFGpresets in vLLM fake-quant serving now quantize the MLA KV cache; on vLLM 0.16 and later they silently quantized nothing for MLA models.- vLLM fake-quant serving of NVFP4 and cast-mode KV-cache configs no longer needs
--enforce-eager.examples/vllm_serve/vllm_serve_fakequant.pynow setsVLLM_DISABLE_COMPILE_CACHE=1for fake-quan...
0.48.0rc2
Install this pre-release version using:
pip install "nvidia-modelopt[all] @ https://github.com/NVIDIA/Model-Optimizer/releases/download/0.48.0rc2/nvidia_modelopt-0.48.0rc2-py3-none-any.whl"
0.48.0rc1
Install this pre-release version using:
pip install "nvidia-modelopt[all] @ https://github.com/NVIDIA/Model-Optimizer/releases/download/0.48.0rc1/nvidia_modelopt-0.48.0rc1-py3-none-any.whl"
0.48.0rc0
Install this pre-release version using:
pip install "nvidia-modelopt[all] @ https://github.com/NVIDIA/Model-Optimizer/releases/download/0.48.0rc0/nvidia_modelopt-0.48.0rc0-py3-none-any.whl"
ModelOpt 0.47.0 Release
New Features
Quantization
-
ONNX quantization with Autotune now benchmarks placements in the requested runtime precision and retains calibrated INT8/FP8 Q/DQ only when it meets the configured TensorRT speedup threshold (1.02x by default); otherwise it saves the high-precision no-Q/DQ model.
-
Add a Muse Glimmer AutoQuantize recipe that searches language-model MLP projections, self-attention projections, and
lm_headover W4A16 NVFP4 Four-Over-Six, FP8, and BF16 fallback at 5.5 effective bits while leaving the vision tower unquantized. -
Add
examples/alpamayo/qad.py, which runs quantization-aware distillation on the quantized Alpamayo checkpoint produced byexamples/alpamayo/quantize.py. It distills the quantized VLM against the original FP16 VLM withQADTrainer, supports FSDP2 for multi-GPU runs, and--exportreassembles the trained VLM into a full AlpamayoR1 checkpoint thatAlpamayoR1.from_pretrainedcan reload. -
Add a calibration-free streaming Kimi-K3 converter and checkpoint-mirror recipe for NVFP4 routed experts with
input_scale=1.0and 128x128 block-FP8 KDA/MLA attention weights. The converter operates shard-by-shard on the source checkpoint's packed MXFP4 experts instead of loading the 2.8T model through the in-memoryhf_ptq.pypath. -
Add end-to-end PETRv1 and PETRv2 ONNX PTQ examples covering calibration, INT8 and FP8 VoVNet backbone quantization, TensorRT deployment, and accuracy evaluation.
-
Add opt-in FP8 Vision Encoder recipes under the
qwen3_vlandqwen3_5model types. The vision-only recipe keeps the language model and KV cache in high precision; the joint recipe quantizes Vision Encoder and language-model Linears and uses FP8 KV-cache cast. Both quantize primary and deepstack merger Linears where present, while leaving patch embedding and vision-attention BMMs in high precision. Exported checkpoints require an inference runtime that supports quantized Vision Encoder Linears. -
Add
mtq.temporarily_fold_weightsfor repeated frozen-weight inference andmtq.preserve_quantizer_attributes_contextfor restoring temporary quantizer property and type changes. Temporary folding snapshots affected fake-quant weights on a configurable device and restores them with their quantizer state; retained pre-quant scales are inactive, while shared weights, shared quantizers, andSequentialQuantizerweights are unsupported. -
Add the
nvfp4_act_headroomcalibration algorithm for NVFP4 activation global scales. Instead of setting the global scale from the largest per-block amax seen during calibration (plainmax, which leaves no room above it so any larger activation saturates), it anchors the scale to a low percentile of the per-block amax distribution, leaving the rest of the FP8 block-scale range as headroom:amax = max(rho * anchor, upper), whereanchorandupperare the per-block amaxes atanchor_percentile(default 1) andupper_percentile(default 99.99; set to 100 to never clip calibration data), andrho(default 16384) is the headroom factor. Applies only to NVFP4 dynamic-block input quantizers;SequentialQuantizeractivation quantizers raise. Weight scales are an orthogonal axis selected by a nestedweight_scale_algorithm(maxby default, ormse/local_hessian), so one recipe can combine a weight calibration with this activation policy in a single pass. Shipsmodelopt_recipes/general/ptq/nvfp4_act_headroom-kv_fp8_cast.yaml, which mirrorsnvfp4_default-kv_fp8_castwith only the calibration algorithm swapped and exports a standard NVFP4 checkpoint. -
Add PTQ support for Step-3.7 (
stepfun-ai/Step-3.7-Flash), whose routed experts were previously left unquantized. Quantize with the newhuggingface/step3p7/ptq/nvfp4_experts_only-kv_fp8_castorhuggingface/step3p7/ptq/nvfp4_mlp_only-kv_fp8recipes rather than the general ones, which select experts by module names Step does not use.
Megatron Framework (M-LM / M-Bridge)
- Add
clamp_kv_cache_scalestoexport_mcore_gpt_to_hf. Set it toFalsewhen exporting a QAT Megatron-Core model to preserve its learned FP8 KV-cache scales; the default retains the existing minimum scale of 1.0. - Add SFT-masked data support to
examples/megatron_bridge/distill.py:--sft --sft_dataset_root <dir>distills on raw prompt-completion JSONL ({"input", "output"}records) with the loss masked to the response tokens, using Megatron-Bridge'sFinetuningDatasetConfigand the model's own HuggingFace tokenizer instead of the pretrainingGPTDatasetandNullTokenizer. - Add per-expert weight quantization for Transformer Engine
TEGroupedLinear(fused MoE experts): each expert now has its ownweight_quantizer(aGroupedQuantizerholding oneTensorQuantizerper expert) with an independentamax, instead of a single sharedamaxacross all experts. Applies tomtq.quantizecalibration, HF / Megatron export, and QAD. - Add opt-in
torch.compileexecution for Transformer Engine grouped-linear per-expert weight quantizers while preserving their native checkpoint amax shapes. SetMODELOPT_TEGROUPED_COMPILE_WEIGHT_LOOP=1before quantized-module conversion; the default path remains eager. - Add HuggingFace unified export of quantized Qwen3-VL and Qwen3.5-VL checkpoints (PTQ or QAD) via
examples/megatron_bridge/export_quantized_megatron_to_hf.py, Qwen3.5-VL additionally covering GatedDeltaNet linear-attention layers and MoE shared experts. Only the language model is quantized; the vision tower is copied from the source HuggingFace checkpoint. - Megatron-Bridge scripts now choose the MoE expert layout automatically from the model config: the faster fused
TEGroupedMLP(grouped GEMM) unless the architecture cannot export it to HuggingFace, in which caseSequentialMLPkeeps the checkpoint exportable and--no_moe_grouped_gemmforces it explicitly. For the affected architectures this changes MoE activation scales from one shared scale to per-expert.
Misc
- Add
modelopt.torch.utils.mlflow.MlflowRunLoggerfor recording a script run on an MLflow tracking server: the invocation, the ModelOpt version, the run log (captured by teeingstdout/stderr) and any caller-supplied artifacts, with configuration as searchable params.mlflowis an optional dependency, imported only when tracking is enabled. - Add
--mlflow <tracking-uri>toexamples/hf_ptq/hf_ptq.py(MLflow's ownMLFLOW_TRACKING_URIis honoured too). A tracked run records the invocation, the resolved recipe ($imports expanded), the run log and the quantization summaries, with every command-line argument as a searchable param; failed runs are recorded with their traceback. The experiment defaults to$USER/hf_ptq/<checkpoint basename>-<recipe name or --qformat>and can be overridden with--mlflow_experiment/--mlflow_run_name. - Add
--mlflow <tracking-uri>toexamples/vllm_serve/vllm_serve_fakequant.py(MLflow's ownMLFLOW_TRACKING_URIis honoured too), so a fake-quant serve records what it quantized and an evaluation of that endpoint can be traced back to a recipe. A tracked run uploads the launcher command, the resolvedRECIPE_PATH(or the mergedQUANT_CFG/KV_QUANT_CFGwhen presets are used), the worker log and the quantizer summary; the experiment defaults to$USER/vllm_serve_fakequant/<model basename>-<recipe name or quantization config>and can be overridden with--mlflow-experiment/--mlflow-run-name.
Backward Breaking Changes
- Migrate the FAR3D ONNX PTQ example to the shared evaluator and ModelOpt containers and
quantize_vovnet.py. Only the encoder supports INT8 and FP8; decoder calibration, quantization, and related CLI flags are removed, and the decoder remains in its exported mixed FP16/FP32 precision. - Image-text calibration with
--calib_with_imagesnow forwards multimodal batches through the complete VLM for all VLM families, so existing non-Nemotron commands may produce different language-model activation ranges and output scales. Recipe-based VLM PTQ also targets the complete VLM: vision modules stay in high precision by default and are quantized only when a model-specific recipe enables them, so custom recipes must explicitly exclude vision modules when required. - Move the checkpoint-mirror recipe tier from
huggingface/models/<org>/<checkpoint>/to the top-levelmodels/<org>/<model_id>/, keyed by each recipe's canonical Hugging Face Hub id — so the Step 3.5 Flash recipe moves tomodels/stepfun-ai/Step-3.5-Flash/ptq/and the NVIDIA Nemotron recipes gain theNVIDIA-prefix (e.g.models/nvidia/NVIDIA-Nemotron-3-Super-120B-A12B-BF16/ptq/nvfp4-mse). Update any saved--recipepaths for these checkpoint recipes accordingly; the per-model_typerecipes underhuggingface/are unchanged. - Move the Mistral Medium 3.5 checkpoint-mirror recipe from
huggingface/models/nvidia/Mistral-Medium-3.5-128B-NVFP4/ptq/nvfp4-max-calibtomodels/mistralai/Mistral-Medium-3.5-128B/ptq/nvfp4-max-calib, keying it by the canonical Hugging Face base model. Update any saved--recipepaths to the new location. - Remove the
--auto_quantize_bits,--auto_quantize_method,--auto_quantize_score_size,--auto_quantize_cost_modeland--auto_quantize_active_moe_expert_ratioflags fromexamples/hf_ptq(deprecated in 0.46). Use an AutoQuantize--recipefrommodelopt_recipes/general/auto_quantize/instead. Those recipes now also splice in the shared basecost_excluded_layersunit, which the removed CLI applied unconditionally, so a VL model keeps its vision tower and MTP layers out of the effective-bits denominator. On a VL model this changes the per-layer cost weights, so an existing--auto_quantize_checkpointfrom an earlier release is rejected with "Use a different checkpoint path"; delete or repoint it to re-run the search. - Remove the
examples/llm_ptqsymlink and theexamples/vlm_ptqforwarder (both deprecated in 0.46). Use `e...
0.47.0rc2
Install this pre-release version using:
pip install "nvidia-modelopt[all] @ https://github.com/NVIDIA/Model-Optimizer/releases/download/0.47.0rc2/nvidia_modelopt-0.47.0rc2-py3-none-any.whl"0.47.0rc1
Install this pre-release version using:
pip install "nvidia-modelopt[all] @ https://github.com/NVIDIA/Model-Optimizer/releases/download/0.47.0rc1/nvidia_modelopt-0.47.0rc1-py3-none-any.whl"