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

[Fix] typo #569

Merged
merged 1 commit into from
Oct 8, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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