Skip to content

Public preset quant_cfg changed from dict to list in 0.44 (breaking, undocumented?) #2001

Description

@sayakpaul

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

  1. Is the dictlist change to preset quant_cfg intentional and stable going forward?
  2. Is there a supported/public way to obtain the "default disabled quantizers" fragment (i.e. a replacement for config._default_disabled_quantizer_cfg)?
  3. 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.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions