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
8acbec71
Commit
8acbec71
authored
Sep 27, 2021
by
Anjali Sridhar
Browse files
revert accidental commit
parent
180c9197
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
1 deletion
+3
-1
fairscale/nn/data_parallel/fully_sharded_data_parallel.py
fairscale/nn/data_parallel/fully_sharded_data_parallel.py
+3
-1
No files found.
fairscale/nn/data_parallel/fully_sharded_data_parallel.py
View file @
8acbec71
...
...
@@ -587,12 +587,14 @@ class FullyShardedDataParallel(nn.Module):
assert
p
.
dtype
==
torch
.
float32
# If world_size is 1, then we all-reduce grads instead of sharding.
p
.
_is_sharded
=
self
.
world_size
>
1
p
.
_orig_size
=
p
.
data
.
size
()
if
self
.
world_size
==
1
:
if
not
p
.
_is_sharded
:
p
.
_is_sharded
=
False
self
.
numel_padded_per_param
.
append
(
0
)
continue
p
.
_is_sharded
=
True
# Replace p.data with the relevant shard.
orig_data
=
p
.
data
...
...
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