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
abc991da
Commit
abc991da
authored
May 21, 2020
by
Kexin Yu
Browse files
fix dtype
parent
f54cc1c9
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
3 deletions
+4
-3
csrc/multi_tensor_lamb.cu
csrc/multi_tensor_lamb.cu
+2
-2
csrc/multi_tensor_lamb_stage_1.cu
csrc/multi_tensor_lamb_stage_1.cu
+2
-1
No files found.
csrc/multi_tensor_lamb.cu
View file @
abc991da
...
...
@@ -52,7 +52,7 @@ struct LAMBStage1Functor
const
float
epsilon
,
adamMode_t
mode
,
const
float
decay
,
at
::
Tensor
global_grad_norm
,
const
float
global_grad_norm
,
const
float
max_global_grad_norm
)
{
// I'd like this kernel to propagate infs/nans.
...
...
@@ -387,7 +387,7 @@ void multi_tensor_lamb_cuda(
epsilon
,
(
adamMode_t
)
mode
,
weight_decay
,
global_grad_norm
,
global_grad_norm
.
data
()
,
max_grad_norm
);
)
// Compute update norms
...
...
csrc/multi_tensor_lamb_stage_1.cu
View file @
abc991da
...
...
@@ -123,7 +123,8 @@ void multi_tensor_lamb_stage1_cuda(
{
using
namespace
at
;
float
clipped_global_grad_norm
=
global_grad_norm
>
max_global_grad_norm
?
global_grad_norm
/
max_global_grad_norm
:
1.0
f
;
auto
g_grad_norm
=
global_grad_norm
.
data
();
float
clipped_global_grad_norm
=
g_grad_norm
>
max_global_grad_norm
?
g_grad_norm
/
max_global_grad_norm
:
1.0
f
;
float
next_step
=
float
(
step
+
1
);
float
beta1_correction
=
1.0
f
-
std
::
pow
(
beta1
,
next_step
);
float
beta2_correction
=
1.0
f
-
std
::
pow
(
beta2
,
next_step
);
...
...
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