Skip to content

Commit

Permalink
Fix typo in FSDP (open-mmlab#569)
Browse files Browse the repository at this point in the history
  • Loading branch information
yhna940 authored and C1rN09 committed Nov 1, 2022
1 parent b4f5456 commit 1471aee
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions mmengine/model/wrappers/fully_sharded_distributed.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from mmengine.structures import BaseDataElement

# support customize fsdp policy
FSDP_WRAP_POLICYS = Registry('fsdp wrap policy')
FSDP_WRAP_POLICIES = Registry('fsdp wrap policy')


@MODEL_WRAPPERS.register_module()
Expand Down Expand Up @@ -60,7 +60,7 @@ class MMFullyShardedDataParallel(FullyShardedDataParallel):
users' pre-defined config in MMEngine, its type is expected to be
`None`, `str` or `Callable`. If it's `str`, then
MMFullyShardedDataParallel will try to get specified method in
``FSDP_WRAP_POLICYS`` registry,and this method will be passed to
``FSDP_WRAP_POLICIES`` registry,and this method will be passed to
FullyShardedDataParallel to finally initialize model.
Note that this policy currently will only apply to child modules of
Expand Down Expand Up @@ -122,10 +122,10 @@ def __init__(

if fsdp_auto_wrap_policy is not None:
if isinstance(fsdp_auto_wrap_policy, str):
assert fsdp_auto_wrap_policy in FSDP_WRAP_POLICYS, \
'`FSDP_WRAP_POLICYS` has no ' \
assert fsdp_auto_wrap_policy in FSDP_WRAP_POLICIES, \
'`FSDP_WRAP_POLICIES` has no ' \
f'function {fsdp_auto_wrap_policy}'
fsdp_auto_wrap_policy = FSDP_WRAP_POLICYS.get( # type: ignore
fsdp_auto_wrap_policy = FSDP_WRAP_POLICIES.get( # type: ignore
fsdp_auto_wrap_policy)
if not isinstance(fsdp_auto_wrap_policy,
Callable): # type: ignore
Expand Down

0 comments on commit 1471aee

Please sign in to comment.