Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added FSDP distributed strategy #3026

Merged
merged 2 commits into from
Jan 30, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion ludwig/distributed/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@ def load_ddp():
return DDPStrategy


def load_fsdp():
from ludwig.distributed.fsdp import FSDPStrategy

return FSDPStrategy


def load_horovod():
from ludwig.distributed.horovod import HorovodStrategy

Expand All @@ -20,7 +26,7 @@ def load_local():
return LocalStrategy


STRATEGIES = {"ddp": load_ddp, "horovod": load_horovod, "local": load_local}
STRATEGIES = {"ddp": load_ddp, "fsdp": load_fsdp, "horovod": load_horovod, "local": load_local}


def get_current_dist_strategy(allow_local=True) -> Type[DistributedStrategy]:
Expand Down
3 changes: 3 additions & 0 deletions ludwig/distributed/ddp.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@
class DDPStrategy(DistributedStrategy):
def __init__(self):
self._local_rank, self._local_size = local_rank_and_size()
self._log_on_init()

def _log_on_init(self):
logging.info("Using DDP strategy")

def wrap_model(self, model: nn.Module) -> nn.Module:
Expand Down