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
a90a32d7
Unverified
Commit
a90a32d7
authored
May 04, 2020
by
Jeff Rasley
Committed by
GitHub
May 04, 2020
Browse files
Bug fix for sparse grads (#208)
parent
3ce531c9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
2 deletions
+1
-2
deepspeed/pt/deepspeed_light.py
deepspeed/pt/deepspeed_light.py
+1
-2
No files found.
deepspeed/pt/deepspeed_light.py
View file @
a90a32d7
...
@@ -866,9 +866,8 @@ class DeepSpeedLight(Module):
...
@@ -866,9 +866,8 @@ class DeepSpeedLight(Module):
for
param_name
,
param
in
self
.
module
.
named_parameters
():
for
param_name
,
param
in
self
.
module
.
named_parameters
():
if
param
.
grad
is
not
None
:
if
param
.
grad
is
not
None
:
grad_data
=
param
.
grad
.
data
grad_data
=
param
.
grad
.
data
param_name_root
=
param_name
.
split
(
'.'
,
1
)[
0
]
if
self
.
sparse_gradients_enabled
(
if
self
.
sparse_gradients_enabled
(
)
and
param_name
_root
in
self
.
csr_tensor_module_names
:
)
and
param_name
in
self
.
csr_tensor_module_names
:
grads
.
append
(
CSRTensor
(
grad_data
))
grads
.
append
(
CSRTensor
(
grad_data
))
else
:
else
:
grads
.
append
(
grad_data
)
grads
.
append
(
grad_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