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
512666ff
Commit
512666ff
authored
Jun 06, 2022
by
Chao Liu
Browse files
clean
parent
83511d7e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
15 deletions
+2
-15
include/ck/tensor_operation/gpu/element/element_wise_operation.hpp
...k/tensor_operation/gpu/element/element_wise_operation.hpp
+2
-14
include/ck/tensor_operation/gpu/grid/gridwise_gemm_bias_activation_xdl_cshuffle.hpp
...n/gpu/grid/gridwise_gemm_bias_activation_xdl_cshuffle.hpp
+0
-1
No files found.
include/ck/tensor_operation/gpu/element/element_wise_operation.hpp
View file @
512666ff
...
...
@@ -20,22 +20,10 @@ struct PassThrough
__host__
__device__
void
operator
()(
double
&
y
,
const
double
&
x
)
const
{
y
=
x
;
}
};
struct
Gelu
{
__host__
__device__
void
operator
()(
float
&
y
,
const
float
&
x
)
const
{
// Y=0.5*X*(1+tanh(0.797885*X+0.035677*X*X*X))
const
float
a
=
float
(
0.035677
)
*
x
*
x
;
const
float
b
=
float
(
0.797885
)
+
a
;
const
float
c
=
b
*
x
;
const
float
d
=
tanh
(
c
);
const
float
e
=
float
(
1.0
)
+
d
;
y
=
float
(
0.5
)
*
x
*
e
;
}
};
struct
FastGelu
{
// https://paperswithcode.com/method/gelu
// y = 0.5*x*(1+tanh(sqrt(2/pi)*(x+0.044715*x^3)))
__host__
__device__
void
operator
()(
float
&
y
,
const
float
&
x
)
const
{
const
float
u
=
float
(
2
)
*
x
*
(
float
(
0.035677
)
*
x
*
x
+
float
(
0.797885
));
...
...
include/ck/tensor_operation/gpu/grid/gridwise_gemm_bias_activation_xdl_cshuffle.hpp
View file @
512666ff
...
...
@@ -236,7 +236,6 @@ struct GridwiseGemmBiasActivation_k0mk1_k0nk1_mn_xdl_cshuffle
auto
c_grid_buf
=
make_dynamic_buffer
<
AddressSpaceEnum
::
Global
>
(
p_c_grid
,
c_grid_desc_mblock_mperblock_nblock_nperblock
.
GetElementSpaceSize
());
// divide block work by [M, N]
const
auto
block_work_idx
=
block_2_ctile_map
.
CalculateBottomIndex
(
make_multi_index
(
get_block_1d_id
()));
...
...
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