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_ROCM
Commits
3b22355a
Commit
3b22355a
authored
Oct 15, 2024
by
letaoqin
Browse files
add a tuning instance
parent
12c3c3c0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
41 additions
and
5 deletions
+41
-5
example/66_gemm_bias_activation/gemm_bias_add_fp16.cpp
example/66_gemm_bias_activation/gemm_bias_add_fp16.cpp
+41
-5
No files found.
example/66_gemm_bias_activation/gemm_bias_add_fp16.cpp
View file @
3b22355a
...
@@ -36,7 +36,7 @@ static constexpr auto GemmSpec = ck::tensor_operation::device::GemmSpecializatio
...
@@ -36,7 +36,7 @@ static constexpr auto GemmSpec = ck::tensor_operation::device::GemmSpecializatio
// clang-format off
// clang-format off
template
<
typename
ADataType
,
typename
BDataType
,
typename
DsDataType
,
typename
CDataType
,
typename
CDEElementOp
>
template
<
typename
ADataType
,
typename
BDataType
,
typename
DsDataType
,
typename
CDataType
,
typename
CDEElementOp
>
using
DeviceOpInstance_
64_16_16
_64
=
ck
::
tensor_operation
::
device
::
DeviceGemmMultiD_Xdl_CShuffle_V3
<
using
DeviceOpInstance_
128_32_64
_64
=
ck
::
tensor_operation
::
device
::
DeviceGemmMultiD_Xdl_CShuffle_V3
<
ALayout
,
BLayout
,
DsLayout
,
CLayout
,
ADataType
,
BDataType
,
ALayout
,
BLayout
,
DsLayout
,
CLayout
,
ADataType
,
BDataType
,
DsDataType
,
CDataType
,
AccDataType
,
CShuffleDataType
,
DsDataType
,
CDataType
,
AccDataType
,
CShuffleDataType
,
AElementOp
,
BElementOp
,
CDEElementOp
,
GemmSpec
,
AElementOp
,
BElementOp
,
CDEElementOp
,
GemmSpec
,
...
@@ -52,6 +52,24 @@ using DeviceOpInstance_64_16_16_64 = ck::tensor_operation::device::DeviceGemmMul
...
@@ -52,6 +52,24 @@ using DeviceOpInstance_64_16_16_64 = ck::tensor_operation::device::DeviceGemmMul
1
,
1
,
1
,
1
,
S
<
1
,
16
,
1
,
8
>
,
S
<
8
,
8
>
,
ck
::
BlockGemmPipelineScheduler
::
Interwave
,
ck
::
BlockGemmPipelineVersion
::
v2
,
F16
>
;
S
<
1
,
16
,
1
,
8
>
,
S
<
8
,
8
>
,
ck
::
BlockGemmPipelineScheduler
::
Interwave
,
ck
::
BlockGemmPipelineVersion
::
v2
,
F16
>
;
template
<
typename
ADataType
,
typename
BDataType
,
typename
DsDataType
,
typename
CDataType
,
typename
CDEElementOp
>
using
DeviceOpInstance_256_128_128_64
=
ck
::
tensor_operation
::
device
::
DeviceGemmMultiD_Xdl_CShuffle_V3
<
ALayout
,
BLayout
,
DsLayout
,
CLayout
,
ADataType
,
BDataType
,
DsDataType
,
CDataType
,
AccDataType
,
CShuffleDataType
,
AElementOp
,
BElementOp
,
CDEElementOp
,
GemmSpec
,
256
,
128
,
128
,
64
,
8
,
4
,
32
,
32
,
2
,
2
,
S
<
8
,
32
,
1
>
,
S
<
1
,
0
,
2
>
,
S
<
1
,
0
,
2
>
,
2
,
8
,
8
,
0
,
S
<
16
,
16
,
1
>
,
S
<
0
,
2
,
1
>
,
S
<
0
,
2
,
1
>
,
1
,
8
,
4
,
0
,
1
,
1
,
S
<
1
,
32
,
1
,
8
>
,
S
<
8
,
8
>
,
ck
::
BlockGemmPipelineScheduler
::
Intrawave
,
ck
::
BlockGemmPipelineVersion
::
v3
,
F16
>
;
template
<
typename
ADataType
,
typename
BDataType
,
typename
DsDataType
,
typename
CDataType
,
typename
CDEElementOp
>
template
<
typename
ADataType
,
typename
BDataType
,
typename
DsDataType
,
typename
CDataType
,
typename
CDEElementOp
>
using
DeviceOpInstance_default
=
ck
::
tensor_operation
::
device
::
DeviceGemmMultiD_Xdl_CShuffle_V3
<
using
DeviceOpInstance_default
=
ck
::
tensor_operation
::
device
::
DeviceGemmMultiD_Xdl_CShuffle_V3
<
ALayout
,
BLayout
,
DsLayout
,
CLayout
,
ADataType
,
BDataType
,
ALayout
,
BLayout
,
DsLayout
,
CLayout
,
ADataType
,
BDataType
,
...
@@ -128,14 +146,32 @@ float run_impl(const GemmBiasAddArgs& args, const StreamConfig& config)
...
@@ -128,14 +146,32 @@ float run_impl(const GemmBiasAddArgs& args, const StreamConfig& config)
return
true
;
return
true
;
};
};
auto
gemm
=
do
DeviceOpInstance_64_16_16_64
<
ADataType
,
BDataType
,
DsDataType
,
CDataType
,
CDEElementOp
>
{};
if
(
!
Run
(
gemm
))
{
{
if
(
args
.
M
<=
512
)
{
auto
gemm
=
DeviceOpInstance_128_32_64_64
<
ADataType
,
BDataType
,
DsDataType
,
CDataType
,
CDEElementOp
>
{};
if
(
Run
(
gemm
))
break
;
}
else
{
auto
gemm
=
DeviceOpInstance_256_128_128_64
<
ADataType
,
BDataType
,
DsDataType
,
CDataType
,
CDEElementOp
>
{};
if
(
Run
(
gemm
))
break
;
}
auto
gemm_def
=
auto
gemm_def
=
DeviceOpInstance_default
<
ADataType
,
BDataType
,
DsDataType
,
CDataType
,
CDEElementOp
>
{};
DeviceOpInstance_default
<
ADataType
,
BDataType
,
DsDataType
,
CDataType
,
CDEElementOp
>
{};
Run
(
gemm_def
);
Run
(
gemm_def
);
}
}
while
(
0
);
return
ave_time
;
return
ave_time
;
}
}
...
...
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