Skip to content

Commit

Permalink
Fix for legacy quantization modifier w/ DDP (#1490)
Browse files Browse the repository at this point in the history
* Remove "module." added by DDP when identifying the submodules for quantization

* Style and quality fixes

---------

Co-authored-by: Benjamin Fineran <bfineran@users.noreply.github.com>
  • Loading branch information
anmarques and bfineran committed Mar 30, 2023
1 parent c1a7a2d commit edb398e
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -504,6 +504,8 @@ def initialize(
if self._submodules is not None:
found_submodules = []
for name, submodule in module.named_modules():
if name.startswith("module."):
name = name[7:]
if name in self._submodules:
self._modules_to_quantize.append(_ModuleToQuantize(name, submodule))
found_submodules.append(name)
Expand Down

0 comments on commit edb398e

Please sign in to comment.