Fusing module with multiple hooks causes RuntimeError: OrderedDict mutated during iteration
in fuse_known_modules
#69158
Labels
low priority
We're unlikely to get around to doing this in the near future
oncall: quantization
Quantization support in PyTorch
Stale
triaged
This issue has been looked at a team member, and triaged and prioritized into an appropriate module
Projects
馃悰 Bug
if a module that is to be fused by
torch.quantization.fuse_modules.fuse_known_modules
has multiple hooks, then aRuntimeError: OrderedDict mutated during iteration
will be raised since the loops iterate over the dictitems()
but delete from the dict during iteration.To Reproduce
A quick fix would be unwrapping the
.items()
iterations into listscc @jerryzh168 @jianyuh @raghuramank100 @jamesr66a @vkuzo @jgong5 @Xia-Weiwen @leslie-fang-intel
The text was updated successfully, but these errors were encountered: