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
a3678d26
Commit
a3678d26
authored
Feb 12, 2025
by
Sudhir Kylasa
Browse files
Addressing code review comments.
parent
8086bbe3
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
24 additions
and
20 deletions
+24
-20
example/ck_tile/03_gemm/gemm_basic.hpp
example/ck_tile/03_gemm/gemm_basic.hpp
+6
-6
example/ck_tile/03_gemm/universal_gemm.cpp
example/ck_tile/03_gemm/universal_gemm.cpp
+17
-12
include/ck_tile/ops/epilogue/cshuffle_epilogue.hpp
include/ck_tile/ops/epilogue/cshuffle_epilogue.hpp
+0
-1
include/ck_tile/ops/gemm/kernel/gemm_kernel.hpp
include/ck_tile/ops/gemm/kernel/gemm_kernel.hpp
+1
-1
No files found.
example/ck_tile/03_gemm/gemm_basic.hpp
View file @
a3678d26
...
@@ -15,7 +15,7 @@
...
@@ -15,7 +15,7 @@
#define CK_TILE_PIPELINE_MEMORY 2
#define CK_TILE_PIPELINE_MEMORY 2
#ifndef CK_TILE_PIPELINE_DEFAULT
#ifndef CK_TILE_PIPELINE_DEFAULT
#define CK_TILE_PIPELINE_DEFAULT CK_TILE_PIPELINE_
COMPUTE
#define CK_TILE_PIPELINE_DEFAULT CK_TILE_PIPELINE_
MEMORY
#endif
#endif
#if(CK_TILE_PIPELINE_DEFAULT == CK_TILE_PIPELINE_COMPUTE)
#if(CK_TILE_PIPELINE_DEFAULT == CK_TILE_PIPELINE_COMPUTE)
...
@@ -31,10 +31,10 @@
...
@@ -31,10 +31,10 @@
#endif
#endif
template
<
typename
DataType
>
template
<
typename
DataType
>
struct
Gemm
Basic
TypeConfig
;
struct
GemmTypeConfig
;
template
<
>
template
<
>
struct
Gemm
Basic
TypeConfig
<
ck_tile
::
half_t
>
struct
GemmTypeConfig
<
ck_tile
::
half_t
>
{
{
using
ADataType
=
ck_tile
::
half_t
;
using
ADataType
=
ck_tile
::
half_t
;
using
BDataType
=
ck_tile
::
half_t
;
using
BDataType
=
ck_tile
::
half_t
;
...
@@ -44,7 +44,7 @@ struct GemmBasicTypeConfig<ck_tile::half_t>
...
@@ -44,7 +44,7 @@ struct GemmBasicTypeConfig<ck_tile::half_t>
};
};
template
<
>
template
<
>
struct
Gemm
Basic
TypeConfig
<
ck_tile
::
bf16_t
>
struct
GemmTypeConfig
<
ck_tile
::
bf16_t
>
{
{
using
ADataType
=
ck_tile
::
bf16_t
;
using
ADataType
=
ck_tile
::
bf16_t
;
using
BDataType
=
ck_tile
::
bf16_t
;
using
BDataType
=
ck_tile
::
bf16_t
;
...
@@ -53,7 +53,7 @@ struct GemmBasicTypeConfig<ck_tile::bf16_t>
...
@@ -53,7 +53,7 @@ struct GemmBasicTypeConfig<ck_tile::bf16_t>
};
};
template
<
>
template
<
>
struct
Gemm
Basic
TypeConfig
<
ck_tile
::
fp8_t
>
struct
GemmTypeConfig
<
ck_tile
::
fp8_t
>
{
{
using
ADataType
=
ck_tile
::
fp8_t
;
using
ADataType
=
ck_tile
::
fp8_t
;
using
BDataType
=
ck_tile
::
fp8_t
;
using
BDataType
=
ck_tile
::
fp8_t
;
...
@@ -62,7 +62,7 @@ struct GemmBasicTypeConfig<ck_tile::fp8_t>
...
@@ -62,7 +62,7 @@ struct GemmBasicTypeConfig<ck_tile::fp8_t>
};
};
template
<
>
template
<
>
struct
Gemm
Basic
TypeConfig
<
ck_tile
::
bf8_t
>
struct
GemmTypeConfig
<
ck_tile
::
bf8_t
>
{
{
using
ADataType
=
ck_tile
::
bf8_t
;
using
ADataType
=
ck_tile
::
bf8_t
;
using
BDataType
=
ck_tile
::
bf8_t
;
using
BDataType
=
ck_tile
::
bf8_t
;
...
...
example/ck_tile/03_gemm/universal_gemm.cpp
View file @
a3678d26
...
@@ -240,19 +240,8 @@ float gemm_calc(const ck_tile::GemmHostArgs& args, const ck_tile::stream_config&
...
@@ -240,19 +240,8 @@ float gemm_calc(const ck_tile::GemmHostArgs& args, const ck_tile::stream_config&
#include "run_gemm_example.inc"
#include "run_gemm_example.inc"
int
run_gemm_
example
(
int
argc
,
char
*
argv
[]
)
void
run_gemm_
instance
(
std
::
string
data_type
,
std
::
string
a_layout
,
std
::
string
b_layout
)
{
{
auto
[
result
,
arg_parser
]
=
create_args
(
argc
,
argv
);
if
(
!
result
)
return
-
1
;
using
Row
=
ck_tile
::
tensor_layout
::
gemm
::
RowMajor
;
using
Col
=
ck_tile
::
tensor_layout
::
gemm
::
ColumnMajor
;
std
::
string
data_type
=
arg_parser
.
get_str
(
"prec"
);
std
::
string
a_layout
=
arg_parser
.
get_str
(
"a_layout"
);
std
::
string
b_layout
=
arg_parser
.
get_str
(
"b_layout"
);
if
(
a_layout
==
"R"
&&
b_layout
==
"R"
)
if
(
a_layout
==
"R"
&&
b_layout
==
"R"
)
{
{
if
(
data_type
==
"fp16"
)
if
(
data_type
==
"fp16"
)
...
@@ -351,4 +340,20 @@ int run_gemm_example(int argc, char* argv[])
...
@@ -351,4 +340,20 @@ int run_gemm_example(int argc, char* argv[])
}
}
}
}
int
run_gemm_example
(
int
argc
,
char
*
argv
[])
{
auto
[
result
,
arg_parser
]
=
create_args
(
argc
,
argv
);
if
(
!
result
)
return
-
1
;
using
Row
=
ck_tile
::
tensor_layout
::
gemm
::
RowMajor
;
using
Col
=
ck_tile
::
tensor_layout
::
gemm
::
ColumnMajor
;
std
::
string
data_type
=
arg_parser
.
get_str
(
"prec"
);
std
::
string
a_layout
=
arg_parser
.
get_str
(
"a_layout"
);
std
::
string
b_layout
=
arg_parser
.
get_str
(
"b_layout"
);
return
run_gemm_instance
(
data_type
,
a_layout
,
b_layout
);
}
int
main
(
int
argc
,
char
*
argv
[])
{
return
!
run_gemm_example
(
argc
,
argv
);
}
int
main
(
int
argc
,
char
*
argv
[])
{
return
!
run_gemm_example
(
argc
,
argv
);
}
include/ck_tile/ops/epilogue/cshuffle_epilogue.hpp
View file @
a3678d26
...
@@ -77,7 +77,6 @@ struct CShuffleEpilogue
...
@@ -77,7 +77,6 @@ struct CShuffleEpilogue
*
*
* @return The vector store size for C tensor.
* @return The vector store size for C tensor.
*/
*/
template
<
typename
ODataType
>
CK_TILE_HOST_DEVICE
static
constexpr
auto
GetVectorSizeC
()
CK_TILE_HOST_DEVICE
static
constexpr
auto
GetVectorSizeC
()
{
{
constexpr
index_t
MaxVectorStoreSize
=
16
;
constexpr
index_t
MaxVectorStoreSize
=
16
;
...
...
include/ck_tile/ops/gemm/kernel/gemm_kernel.hpp
View file @
a3678d26
...
@@ -167,7 +167,7 @@ struct GemmKernel
...
@@ -167,7 +167,7 @@ struct GemmKernel
CK_TILE_HOST
static
bool
IsSupportedArgument
(
const
GemmKernelArgs
&
kargs
)
CK_TILE_HOST
static
bool
IsSupportedArgument
(
const
GemmKernelArgs
&
kargs
)
{
{
if
constexpr
(
EpiloguePipeline
::
template
GetVectorSizeC
<
CDataType
>
()
%
2
!=
0
&&
if
constexpr
(
EpiloguePipeline
::
GetVectorSizeC
()
%
2
!=
0
&&
is_any_of
<
CDataType
,
fp16_t
,
bf16_t
>::
value
)
is_any_of
<
CDataType
,
fp16_t
,
bf16_t
>::
value
)
{
{
if
(
kargs
.
k_batch
!=
1
)
if
(
kargs
.
k_batch
!=
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