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
gaoqiong
composable_kernel
Commits
d5728dd3
"vscode:/vscode.git/clone" did not exist on "48328bbb8a4c17f722e6c71d8d9ff0418ee02d9b"
Commit
d5728dd3
authored
Oct 31, 2022
by
Qianfeng Zhang
Browse files
Improve the expression calculation for performance
parent
de6aad06
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
2 deletions
+5
-2
include/ck/tensor_operation/gpu/grid/gridwise_batchnorm_backward_blockwise_welford.hpp
...pu/grid/gridwise_batchnorm_backward_blockwise_welford.hpp
+5
-2
No files found.
include/ck/tensor_operation/gpu/grid/gridwise_batchnorm_backward_blockwise_welford.hpp
View file @
d5728dd3
...
...
@@ -508,6 +508,10 @@ struct GridwiseBatchNormBackwardWithBlockwiseWelford
dy_thread_buf
);
static_for
<
0
,
MThreadSliceSize
,
1
>
{}([
&
](
auto
iM
)
{
AccDataType
multiplier
=
type_convert
<
AccDataType
>
(
1.0
)
/
type_convert
<
AccDataType
>
(
reduce_size
)
*
inv_var_thread_buf
[
iM
]
*
scale_thread_buf
[
iM
];
static_for
<
0
,
KThreadSliceSize
,
1
>
{}([
&
](
auto
iK
)
{
constexpr
auto
offset
=
thread_buffer_desc_m_k
.
CalculateOffset
(
make_tuple
(
iM
,
iK
));
...
...
@@ -518,8 +522,7 @@ struct GridwiseBatchNormBackwardWithBlockwiseWelford
AccDataType
tmpVal
=
norm_x
*
dscale_thread_buf
[
iM
];
dx_thread_buf
(
Number
<
offset
>
{})
=
type_convert
<
AccDataType
>
(
1.0
)
/
type_convert
<
AccDataType
>
(
reduce_size
)
*
inv_var_thread_buf
[
iM
]
*
scale_thread_buf
[
iM
]
*
multiplier
*
(
type_convert
<
AccDataType
>
(
reduce_size
)
*
dy_thread_buf
[
Number
<
offset
>
{}]
-
dbias_thread_buf
[
iM
]
-
tmpVal
);
});
...
...
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