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
apex
Commits
1e0aadd5
Commit
1e0aadd5
authored
May 30, 2020
by
Thor Johnsen
Browse files
Bug fix in update norm calculation
parent
0f64f6ad
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
apex/contrib/optimizers/distributed_fused_lamb.py
apex/contrib/optimizers/distributed_fused_lamb.py
+1
-1
No files found.
apex/contrib/optimizers/distributed_fused_lamb.py
View file @
1e0aadd5
...
...
@@ -441,7 +441,7 @@ class DistributedFusedLAMB(torch.optim.Optimizer):
l2_norm
=
torch
.
zeros
(
size
=
[
self
.
_model_params_num
],
dtype
=
torch
.
float32
,
device
=
'cuda'
)
local_contrib_l2_norm
=
multi_tensor_applier
(
self
.
multi_tensor_l2norm
,
self
.
_overflow_buf
,
[
self
.
_contrib_update_frag_for_norm
],
True
)[
1
]
**
2
l2_norm
.
masked_scatter_
(
self
.
_model_param_is_contrib
,
local_contrib_l2_norm
)
torch
.
distributed
.
allreduce
(
l2_norm
,
group
=
self
.
_ag_pg
[
0
])
torch
.
distributed
.
all
_
reduce
(
l2_norm
,
group
=
self
.
_ag_pg
[
0
])
return
l2_norm
.
masked_select
(
self
.
_model_param_is_contrib
)
def
_pipeline_step
(
self
):
...
...
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