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
Megatron-LM
Commits
0b6bdca6
Commit
0b6bdca6
authored
Apr 21, 2020
by
Mohammad
Browse files
removed optimized l2 grad clipping
parent
4ff2c963
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
megatron/mpu/grads.py
megatron/mpu/grads.py
+2
-2
No files found.
megatron/mpu/grads.py
View file @
0b6bdca6
...
...
@@ -101,8 +101,8 @@ def clip_grad_norm(parameters, max_norm, norm_type=2):
if
clip_coef
<
1
:
for
p
in
parameters
:
p
.
grad
.
data
.
mul_
(
clip_coef
)
elif
norm_type
==
2
:
total_norm
=
l2_grad_clipper
(
parameters
,
max_norm
)
#
elif norm_type == 2:
#
total_norm = l2_grad_clipper(parameters, max_norm)
else
:
total_norm
=
0
...
...
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