-
Notifications
You must be signed in to change notification settings - Fork 383
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix issues with unwrapping modules with accelerate (#963)
There were a few issues at once that are now being fixed: - When unwrapping, pass keep_fp32_wrapper=True, or else the modules are not completely unwrapped and could not be pickled. - Only net.module_ was unwrapped, but there can be other modules and criteria. Those are now also unwrapped. - In some circumstances, unwrapping is undesired. For instance, when users want to continue training or benefit from AMP during inference. Therefore, an option was added to prevent automatic unwrapping: set unwrap_after_train=False.
- Loading branch information
1 parent
994cca1
commit a218ebc
Showing
3 changed files
with
72 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters