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
deepspeed
Commits
e1bea67f
Unverified
Commit
e1bea67f
authored
Aug 13, 2020
by
Jeff Rasley
Committed by
GitHub
Aug 13, 2020
Browse files
attach empty grad to its param to ensure it's copied after reduction (#316)
parent
6855ba1c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
deepspeed/pt/deepspeed_light.py
deepspeed/pt/deepspeed_light.py
+4
-4
No files found.
deepspeed/pt/deepspeed_light.py
View file @
e1bea67f
...
@@ -1013,10 +1013,10 @@ class DeepSpeedLight(Module):
...
@@ -1013,10 +1013,10 @@ class DeepSpeedLight(Module):
# rank is reducing the same size. In some cases it may make
# rank is reducing the same size. In some cases it may make
# sense in the future to support the ability to average not
# sense in the future to support the ability to average not
# w.r.t. world size but with a different value.
# w.r.t. world size but with a different value.
grads
.
append
(
param
.
grad
=
torch
.
zeros
(
param
.
size
(),
torch
.
zeros
(
param
.
size
()
,
dtype
=
param
.
dtype
,
dtyp
e
=
param
.
d
type
,
devic
e
=
param
.
d
evice
)
device
=
param
.
device
)
)
grads
.
append
(
param
.
grad
.
data
)
else
:
else
:
grad_data
=
param
.
grad
.
data
grad_data
=
param
.
grad
.
data
if
self
.
sparse_gradients_enabled
(
if
self
.
sparse_gradients_enabled
(
...
...
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