Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
fairscale
Commits
02a8913c
Unverified
Commit
02a8913c
authored
Jan 06, 2022
by
tmarkstrum
Committed by
GitHub
Jan 06, 2022
Browse files
fix trailing space issue (#903)
parent
d3417ceb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
fairscale/nn/data_parallel/fully_sharded_data_parallel.py
fairscale/nn/data_parallel/fully_sharded_data_parallel.py
+2
-2
No files found.
fairscale/nn/data_parallel/fully_sharded_data_parallel.py
View file @
02a8913c
...
@@ -2366,8 +2366,8 @@ def _post_state_dict_hook(
...
@@ -2366,8 +2366,8 @@ def _post_state_dict_hook(
prefix
:
str
,
prefix
:
str
,
*
args
:
Any
,
*
args
:
Any
,
)
->
"OrderedDict[str, torch.Tensor]"
:
)
->
"OrderedDict[str, torch.Tensor]"
:
# When state_dict_on_rank_0_only is ``True``, ``model.state_dict()`` will only
# When state_dict_on_rank_0_only is ``True``, ``model.state_dict()`` will only
# returns full state dict on rank 0 and return empty dict non-rank 0,
# returns full state dict on rank 0 and return empty dict non-rank 0,
# which allow FullyShardedDataParallel to skip the GPU -> CPU copy on
# which allow FullyShardedDataParallel to skip the GPU -> CPU copy on
# non-rank 0 altogether and prevent OOM.
# non-rank 0 altogether and prevent OOM.
if
state_dict_on_rank_0_only
and
dist
.
get_rank
()
!=
0
:
if
state_dict_on_rank_0_only
and
dist
.
get_rank
()
!=
0
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment