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 → list change to preset quant_cfg intentional 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_cfg under the new list format?
Context: this surfaced in 🤗 diffusers, whose ModelOpt integration composes quant_cfg from these fragments.
Summary
Between
nvidia-modelopt0.43 and 0.44, thequant_cfgfield in the public quantization preset configs (e.g.FP8_DEFAULT_CFG,INT8_DEFAULT_CFG,NVFP4_DEFAULT_CFG) changed from adictto alist. The internalmodelopt.torch.quantization.config._default_disabled_quantizer_cfgchanged the same way.Downstream code that composes a
quant_cfgby dict-merging these presets/fragments (a natural pattern) now breaks withTypeError: '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)Minimal reproducer (modelopt only)
Note
mtq.quantize(model, quant_cfg=<dict>, ...)still accepts the old dict-stylequant_cfgon 0.45, so the documented quantize path itself is intact — the break is specifically for code that reads/merges the presetquant_cfgobjects (or the_default_disabled_quantizer_cfgfragment) as mappings.Questions
dict→listchange to presetquant_cfgintentional and stable going forward?config._default_disabled_quantizer_cfg)?quant_cfgunder the new list format?Context: this surfaced in 🤗 diffusers, whose ModelOpt integration composes
quant_cfgfrom these fragments.