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
cfce1f11
Commit
cfce1f11
authored
Jul 06, 2022
by
rocking
Browse files
Support different YVectorDim in GridwiseLayernorm
parent
53607c7d
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
4 deletions
+10
-4
include/ck/tensor_operation/gpu/device/device_layernorm.hpp
include/ck/tensor_operation/gpu/device/device_layernorm.hpp
+2
-0
include/ck/tensor_operation/gpu/grid/gridwise_layernorm.hpp
include/ck/tensor_operation/gpu/grid/gridwise_layernorm.hpp
+8
-4
No files found.
include/ck/tensor_operation/gpu/device/device_layernorm.hpp
View file @
cfce1f11
...
@@ -122,6 +122,7 @@ struct DeviceLayernorm : public BaseOperator
...
@@ -122,6 +122,7 @@ struct DeviceLayernorm : public BaseOperator
XSrcVectorSize
,
XSrcVectorSize
,
GammaSrcVectorSize
,
GammaSrcVectorSize
,
BetaSrcVectorSize
,
BetaSrcVectorSize
,
XSrcVectorDim
,
YDstVectorSize
,
YDstVectorSize
,
false
>
;
false
>
;
...
@@ -142,6 +143,7 @@ struct DeviceLayernorm : public BaseOperator
...
@@ -142,6 +143,7 @@ struct DeviceLayernorm : public BaseOperator
XSrcVectorSize
,
XSrcVectorSize
,
GammaSrcVectorSize
,
GammaSrcVectorSize
,
BetaSrcVectorSize
,
BetaSrcVectorSize
,
XSrcVectorDim
,
YDstVectorSize
,
YDstVectorSize
,
true
>
;
true
>
;
...
...
include/ck/tensor_operation/gpu/grid/gridwise_layernorm.hpp
View file @
cfce1f11
...
@@ -65,13 +65,17 @@ template <typename XDataType,
...
@@ -65,13 +65,17 @@ template <typename XDataType,
index_t
XSrcVectorSize
,
index_t
XSrcVectorSize
,
index_t
GammaSrcVectorSize
,
index_t
GammaSrcVectorSize
,
index_t
BetaSrcVectorSize
,
index_t
BetaSrcVectorSize
,
index_t
YDstVectorDim
,
index_t
YDstVectorSize
,
index_t
YDstVectorSize
,
bool
SweepOnce
>
bool
SweepOnce
>
struct
GridwiseLayernorm_mk_to_mk
struct
GridwiseLayernorm_mk_to_mk
{
{
static_assert
(((
XSrcVectorDim
==
0
&&
MThreadSliceSize
%
XSrcVectorSize
==
0
)
||
static_assert
((
XSrcVectorDim
==
0
&&
MThreadSliceSize
%
XSrcVectorSize
==
0
)
||
(
XSrcVectorDim
==
1
&&
KThreadSliceSize
%
XSrcVectorSize
==
0
))
&&
(
XSrcVectorDim
==
1
&&
KThreadSliceSize
%
XSrcVectorSize
==
0
),
(
KThreadSliceSize
%
YDstVectorSize
==
0
),
"Invalid thread slice sizes and/or vector sizes configuration, please check!"
);
static_assert
((
YDstVectorDim
==
0
&&
MThreadSliceSize
%
YDstVectorSize
==
0
)
||
(
YDstVectorDim
==
1
&&
KThreadSliceSize
%
YDstVectorSize
==
0
),
"Invalid thread slice sizes and/or vector sizes configuration, please check!"
);
"Invalid thread slice sizes and/or vector sizes configuration, please check!"
);
static
constexpr
bool
reorder_thread_cluster
=
(
XSrcVectorDim
==
0
);
static
constexpr
bool
reorder_thread_cluster
=
(
XSrcVectorDim
==
0
);
...
@@ -231,7 +235,7 @@ struct GridwiseLayernorm_mk_to_mk
...
@@ -231,7 +235,7 @@ struct GridwiseLayernorm_mk_to_mk
AccElementwiseOperation
,
AccElementwiseOperation
,
ThreadBufferLengths_M_K
,
ThreadBufferLengths_M_K
,
ThreadBufferDimAccessOrder
,
ThreadBufferDimAccessOrder
,
XSrc
VectorDim
,
YDst
VectorDim
,
YDstVectorSize
,
YDstVectorSize
,
InMemoryDataOperationEnum
::
Set
,
InMemoryDataOperationEnum
::
Set
,
1
,
1
,
...
...
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