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
16428e7f
"...git@developer.sourcefind.cn:cnjsdfcy/simbricks.git" did not exist on "80734692c65ec6e1b6509e2ace07c4b45eec7640"
Commit
16428e7f
authored
Dec 02, 2022
by
Anthony Chang
Browse files
more test
parent
4003fefb
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
64 additions
and
60 deletions
+64
-60
example/32_batched_gemm_scale_softmax_gemm/batched_gemm_scale_softmax_gemm_permute_xdl_fp16.cpp
...gemm/batched_gemm_scale_softmax_gemm_permute_xdl_fp16.cpp
+59
-59
profiler/include/profiler/profile_batched_gemm_softmax_gemm_impl.hpp
...clude/profiler/profile_batched_gemm_softmax_gemm_impl.hpp
+5
-1
No files found.
example/32_batched_gemm_scale_softmax_gemm/batched_gemm_scale_softmax_gemm_permute_xdl_fp16.cpp
View file @
16428e7f
...
@@ -8,7 +8,7 @@ Gemm + Softmax + Gemm fused operation. Computes C_g_m_o = Softmax(A_g_m_k * B0_g
...
@@ -8,7 +8,7 @@ Gemm + Softmax + Gemm fused operation. Computes C_g_m_o = Softmax(A_g_m_k * B0_g
|-------------------------------------|
|-------------------------------------|
Gemm1
Gemm1
*/
*/
#pragma clang diagnostic ignored "-Wunused-variable"
#include <iostream>
#include <iostream>
#include <numeric>
#include <numeric>
#include <initializer_list>
#include <initializer_list>
...
@@ -57,7 +57,7 @@ using Acc0ElementOp = ck::tensor_operation::element_wise::Scale;
...
@@ -57,7 +57,7 @@ using Acc0ElementOp = ck::tensor_operation::element_wise::Scale;
using
B1ElementOp
=
PassThrough
;
using
B1ElementOp
=
PassThrough
;
using
CElementOp
=
PassThrough
;
using
CElementOp
=
PassThrough
;
static
constexpr
auto
GemmSpec
=
ck
::
tensor_operation
::
device
::
GemmSpecialization
::
MNKOPadding
;
static
constexpr
auto
GemmSpec
=
ck
::
tensor_operation
::
device
::
GemmSpecialization
::
Default
;
static
constexpr
auto
MaskingSpec
=
static
constexpr
auto
MaskingSpec
=
ck
::
tensor_operation
::
device
::
MaskingSpecialization
::
MaskDisabled
;
ck
::
tensor_operation
::
device
::
MaskingSpecialization
::
MaskDisabled
;
...
@@ -73,65 +73,65 @@ using DeviceGemmInstance =
...
@@ -73,65 +73,65 @@ using DeviceGemmInstance =
NumDimN
,
NumDimN
,
NumDimK
,
NumDimK
,
NumDimO
,
NumDimO
,
ADataType
,
ck
::
half_t
,
B0DataType
,
ck
::
half_t
,
B1DataType
,
ck
::
half_t
,
CDataType
,
ck
::
half_t
,
Acc0BiasDataType
,
ck
::
Tuple
<>
,
Acc1BiasDataType
,
ck
::
Tuple
<>
,
AccDataType
,
float
,
CShuffleD
ata
Type
,
float
,
//
CShuffleDType,
AElementOp
,
ck
::
tensor_operation
::
element_wise
::
PassThrough
,
B0ElementOp
,
ck
::
tensor_operation
::
element_wise
::
PassThrough
,
Acc0ElementOp
,
ck
::
tensor_operation
::
element_wise
::
Scale
,
B1ElementOp
,
ck
::
tensor_operation
::
element_wise
::
PassThrough
,
CElementOp
,
ck
::
tensor_operation
::
element_wise
::
PassThrough
,
GemmSpec
,
GemmSpec
,
TensorSpecA
,
ck
::
tensor_operation
::
device
::
TensorSpecialization
::
Default
,
TensorSpecB0
,
ck
::
tensor_operation
::
device
::
TensorSpecialization
::
Default
,
TensorSpecB1
,
ck
::
tensor_operation
::
device
::
TensorSpecialization
::
Default
,
TensorSpecC
,
ck
::
tensor_operation
::
device
::
TensorSpecialization
::
Default
,
1
,
256
,
128
,
// MPerBlock
128
,
// NPerBlock
32
,
// KPerBlock
64
,
// Gemm1NPerBlock
32
,
// Gemm1KPerBlock
8
,
// AK1
8
,
// BK1
2
,
// B1K1
32
,
// MPerXDL
32
,
// NPerXDL
1
,
// MXdlPerWave
4
,
// NXdlPerWave
2
,
// Gemm1NXdlPerWave
S
<
4
,
64
,
1
>
,
// ABlockTransfer
S
<
1
,
0
,
2
>
,
S
<
1
,
0
,
2
>
,
2
,
8
,
8
,
true
,
S
<
4
,
64
,
1
>
,
// BBlockTransfer
S
<
1
,
0
,
2
>
,
S
<
1
,
0
,
2
>
,
2
,
8
,
8
,
true
,
S
<
16
,
16
,
1
>
,
// B1BlockTransfer
S
<
0
,
2
,
1
>
,
S
<
0
,
2
,
1
>
,
1
,
1
,
4
,
256
,
// block_size
2
,
64
,
// m_per_block
false
,
256
,
// n_per_block
1
,
// CShuffleMXdlPerWavePerShuffle
32
,
// k_per_block
2
,
// CShuffleNXdlPerWavePerShuffle
64
,
// Gemm1NPerBlock
S
<
1
,
32
,
1
,
8
>
,
// CShuffleBlockTransferClusterLengths_MBlock_MPerBlock_NBlock_NPerBlock
32
,
// Gemm1KPerBlock
8
,
// CShuffleBlockTransferScalarPerVector_NPerBlock
8
,
// ak1
MaskingSpec
>
;
// MaskingSpecialization
8
,
// bk1
2
,
// b1k1
16
,
// m_per_xdl
16
,
// n_per_xdl
1
,
// m_xdl_per_wave
16
,
// n_xdl_per_wave
4
,
// Gemm1NXdlPerWave
ck
::
Sequence
<
4
,
64
,
1
>
,
// thread_cluster_length
ck
::
Sequence
<
1
,
0
,
2
>
,
// thread_cluster_arrange_order
ck
::
Sequence
<
1
,
0
,
2
>
,
// src_access_order
2
,
// src_vector_dim
8
,
// src_scalar_per_vector
8
,
// dst_scalar_per_vector
1
,
// add_extra_dim
ck
::
Sequence
<
4
,
64
,
1
>
,
// thread_cluster_length
ck
::
Sequence
<
1
,
0
,
2
>
,
// thread_cluster_arrange_order
ck
::
Sequence
<
1
,
0
,
2
>
,
// src_access_order
2
,
// src_vector_dim
8
,
// src_scalar_per_vector
8
,
// dst_scalar_per_vector
1
,
// add_extra_dim
ck
::
Sequence
<
16
,
16
,
1
>
,
// thread_cluster_length
ck
::
Sequence
<
0
,
2
,
1
>
,
// thread_cluster_arrange_order
ck
::
Sequence
<
0
,
2
,
1
>
,
// src_access_order
1
,
// src_vector_dim
4
,
// src_scalar_per_vector
2
,
// dst_scalar_per_vector
0
,
// add_extra_dim
1
,
// m_xdl_per_wave
4
,
// n_xdl_per_wave
ck
::
Sequence
<
1
,
32
,
1
,
8
>
,
// m_n_block_wave_per_xdl
8
,
// scalar_per_vector
ck
::
tensor_operation
::
device
::
MaskingSpecialization
::
MaskDisabled
>
;
// causal_mask
// Ref Gemm0: fp16 in, fp32 out
// Ref Gemm0: fp16 in, fp32 out
using
ReferenceGemm0Instance
=
ck
::
tensor_operation
::
host
::
ReferenceBatchedGemm
<
ADataType
,
using
ReferenceGemm0Instance
=
ck
::
tensor_operation
::
host
::
ReferenceBatchedGemm
<
ADataType
,
...
...
profiler/include/profiler/profile_batched_gemm_softmax_gemm_impl.hpp
View file @
16428e7f
...
@@ -49,7 +49,7 @@ bool profile_batched_gemm_softmax_gemm_impl(bool do_verification,
...
@@ -49,7 +49,7 @@ bool profile_batched_gemm_softmax_gemm_impl(bool do_verification,
int
BatchStrideB0
=
-
1
,
int
BatchStrideB0
=
-
1
,
int
BatchStrideB1
=
-
1
,
int
BatchStrideB1
=
-
1
,
int
BatchStrideC
=
-
1
,
int
BatchStrideC
=
-
1
,
float
alpha
=
1.
f
)
float
alpha
=
-
1.
f
)
{
{
...
@@ -187,6 +187,10 @@ bool profile_batched_gemm_softmax_gemm_impl(bool do_verification,
...
@@ -187,6 +187,10 @@ bool profile_batched_gemm_softmax_gemm_impl(bool do_verification,
b0_g_k_n_device_buf
.
ToDevice
(
b0_g_k_n
.
mData
.
data
());
b0_g_k_n_device_buf
.
ToDevice
(
b0_g_k_n
.
mData
.
data
());
b1_g_n_o_device_buf
.
ToDevice
(
b1_g_n_o
.
mData
.
data
());
b1_g_n_o_device_buf
.
ToDevice
(
b1_g_n_o
.
mData
.
data
());
if
(
alpha
<
0
)
{
alpha
=
1.
f
/
std
::
sqrt
(
K
);
// usually 1 / sqrt(head_dim)
}
auto
a_element_op
=
AElementOp
{};
auto
a_element_op
=
AElementOp
{};
auto
b0_element_op
=
B0ElementOp
{};
auto
b0_element_op
=
B0ElementOp
{};
auto
acc0_element_op
=
Acc0ElementOp
{
alpha
};
auto
acc0_element_op
=
Acc0ElementOp
{
alpha
};
...
...
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