NVIDIA / NVIDIA/Model-Optimizer
Public preset `quant_cfg` changed from dict to list in 0.44 (breaking, undocumented?)
@shengliangxu is already working on this.
Since Jul 21, 2026.
- Dominant language
- Python
- Stars
- 3.8k
- Forks
- 604
- Avg merge
- 2d 8h
- Merged PRs (30d)
- 142
Description
Summary
Between nvidia-modelopt 0.43 and 0.44, the quant_cfg field in the public quantization preset configs (e.g. FP8_DEFAULT_CFG, INT8_DEFAULT_CFG, NVFP4_DEFAULT_CFG) changed from a dict to a list. The internal modelopt.torch.quantization.config._default_disabled_quantizer_cfg changed the same way.
Downstream code that composes a quant_cfg by dict-merging these presets/fragments (a natural pattern) now breaks with TypeError: 'list' object is not a mapping. I couldn't find this called out in the changelog / migration notes — is it intentional, and is there a recommended migration path?
Environment
nvidia-modelopt: 0.45.0 (also reproduces on 0.44.0; works on 0.43.0)torch: 2.14.0.dev20260704+cu130 (the objects involved are plain Python, so this is torch-independent)- python: 3.12
Minimal reproducer (modelopt only)
import modelopt.torch.quantization as mtq
# `quant_cfg` in the public preset configs is a dict on <=0.43 and a list on >=0.44:
print(type(mtq.FP8_DEFAULT_CFG["quant_cfg"])) # 0.43: <class 'dict'> | 0.44+: <class 'list'>
print(type(mtq.config._default_disabled_quantizer_cfg)) # 0.43: <class 'dict'> | 0.44+: <class 'list'>
# Code that composes a quant_cfg by dict-merging these now raises:
base = {"*weight_quantizer": {"fake_quant": False}}
merged = {**base, **mtq.config._default_disabled_quantizer_cfg}
# TypeError: 'list' object is not a mapping
Note
mtq.quantize(model, quant_cfg=<dict>, ...) still accepts the old dict-style quant_cfg on 0.45, so the documented quantize path itself is intact — the break is specifically for code that reads/merges the preset quant_cfg objects (or the _default_disabled_quantizer_cfg fragment) as mappings.
Questions
- Is the
dict→listchange to presetquant_cfgintentional and stable going forward? - Is there a supported/public way to obtain the "default disabled quantizers" fragment (i.e. a replacement for
config._default_disabled_quantizer_cfg)? - Any migration guidance for merging user overrides into a preset
quant_cfgunder the new list format?
Context: this surfaced in 🤗 diffusers, whose ModelOpt integration composes quant_cfg from these fragments.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.