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
TransformerEngine
Commits
2215fa5c
Unverified
Commit
2215fa5c
authored
Aug 23, 2024
by
Alexandros Koumparoulis
Committed by
GitHub
Aug 23, 2024
Browse files
don't put master_param to state if None (#1130)
Signed-off-by:
Alexandros Koumparoulis
<
akoumparouli@nvidia.com
>
parent
309c6d49
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
3 deletions
+1
-3
transformer_engine/pytorch/optimizers/fused_adam.py
transformer_engine/pytorch/optimizers/fused_adam.py
+1
-3
No files found.
transformer_engine/pytorch/optimizers/fused_adam.py
View file @
2215fa5c
...
@@ -219,10 +219,8 @@ class FusedAdam(torch.optim.Optimizer):
...
@@ -219,10 +219,8 @@ class FusedAdam(torch.optim.Optimizer):
assert
(
assert
(
state
[
"master_param"
].
shape
==
p
.
shape
state
[
"master_param"
].
shape
==
p
.
shape
),
"Master weights shape must match model weights shape"
),
"Master weights shape must match model weights shape"
else
:
state
[
"master_param"
]
=
None
p_master
=
state
[
"master_param"
]
p_master
=
state
.
get
(
"master_param"
,
None
)
p_grad
=
p
.
grad
p_grad
=
p
.
grad
if
self
.
master_weights
and
p_master
is
not
None
and
p_master
.
grad
is
not
None
:
if
self
.
master_weights
and
p_master
is
not
None
and
p_master
.
grad
is
not
None
:
...
...
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