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
90729bc8
Commit
90729bc8
authored
Mar 31, 2020
by
Kexin Yu
Browse files
fix parameter type
parent
32d2c4e2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
apex/contrib/csrc/optimizers/fused_lamb_cuda_kernel.cu
apex/contrib/csrc/optimizers/fused_lamb_cuda_kernel.cu
+2
-2
No files found.
apex/contrib/csrc/optimizers/fused_lamb_cuda_kernel.cu
View file @
90729bc8
...
@@ -41,7 +41,7 @@ struct LAMBStage1Functor
...
@@ -41,7 +41,7 @@ struct LAMBStage1Functor
const
float
epsilon
,
const
float
epsilon
,
adamMode_t
mode
,
adamMode_t
mode
,
const
float
decay
,
const
float
decay
,
float
*
global_grad_norm
,
float
global_grad_norm
,
float
max_global_grad_norm
)
float
max_global_grad_norm
)
{
{
// I'd like this kernel to propagate infs/nans.
// I'd like this kernel to propagate infs/nans.
...
@@ -52,7 +52,7 @@ struct LAMBStage1Functor
...
@@ -52,7 +52,7 @@ struct LAMBStage1Functor
int
chunk_idx
=
tl
.
block_to_chunk
[
blockIdx
.
x
];
int
chunk_idx
=
tl
.
block_to_chunk
[
blockIdx
.
x
];
int
n
=
tl
.
sizes
[
tensor_loc
];
int
n
=
tl
.
sizes
[
tensor_loc
];
float
clipped_global_grad_norm
=
(
*
global_grad_norm
)
>
max_global_grad_norm
?
(
*
global_grad_norm
)
/
max_global_grad_norm
:
1.0
f
;
float
clipped_global_grad_norm
=
global_grad_norm
>
max_global_grad_norm
?
global_grad_norm
/
max_global_grad_norm
:
1.0
f
;
T
*
g
=
(
T
*
)
tl
.
addresses
[
0
][
tensor_loc
];
T
*
g
=
(
T
*
)
tl
.
addresses
[
0
][
tensor_loc
];
g
+=
chunk_idx
*
chunk_size
;
g
+=
chunk_idx
*
chunk_size
;
...
...
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