Skip to content

Commit f688719

Browse files
JKSenthilfacebook-github-bot
authored andcommitted
support fsdp2 string strategy (#996)
Summary: Pull Request resolved: #996 Support "fsdp2" string as strategy Reviewed By: galrotem Differential Revision: D74410718 fbshipit-source-id: 4419cea3d1709ca89911b4743c53ae6536448015
1 parent 388572d commit f688719

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

torchtnt/utils/prepare_module.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -619,7 +619,7 @@ def prepare_module(
619619

620620
def convert_str_to_strategy(
621621
strategy: str,
622-
) -> Union[DDPStrategy, FSDPStrategy, NOOPStrategy]:
622+
) -> Union[DDPStrategy, FSDPStrategy, FSDP2Strategy, NOOPStrategy]:
623623
"""
624624
Converts strategy as a string to a default instance of the Strategy dataclass.
625625
@@ -633,6 +633,7 @@ def convert_str_to_strategy(
633633
string_to_strategy_mapping = {
634634
"ddp": DDPStrategy(),
635635
"fsdp": FSDPStrategy(),
636+
"fsdp2": FSDP2Strategy(),
636637
"noop": NOOPStrategy(),
637638
}
638639

0 commit comments

Comments
 (0)