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
ecef4987
Commit
ecef4987
authored
Jun 19, 2023
by
Po-Yen, Chen
Browse files
Extract reading A tile logic out of Run() method
parent
3943aab3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
13 deletions
+25
-13
include/ck/tensor_operation/gpu/block/blockwise_gemm_xdlops.hpp
...e/ck/tensor_operation/gpu/block/blockwise_gemm_xdlops.hpp
+19
-10
include/ck/tensor_operation/gpu/grid/gridwise_gemm_pipeline_v2.hpp
...k/tensor_operation/gpu/grid/gridwise_gemm_pipeline_v2.hpp
+6
-3
No files found.
include/ck/tensor_operation/gpu/block/blockwise_gemm_xdlops.hpp
View file @
ecef4987
...
@@ -306,17 +306,12 @@ struct BlockwiseGemmXdlops_k0mk1_k0nk1_m0n0m1n1m2m3m4n2_v1
...
@@ -306,17 +306,12 @@ struct BlockwiseGemmXdlops_k0mk1_k0nk1_m0n0m1n1m2m3m4n2_v1
static
constexpr
auto
b_block_desc_n0_n1_n2_k
=
MakeBBlockDescriptor_N0_N1_N2_K
();
static
constexpr
auto
b_block_desc_n0_n1_n2_k
=
MakeBBlockDescriptor_N0_N1_N2_K
();
#if defined(EXTRACT_DS_READ)
#if defined(EXTRACT_DS_READ)
static_assert
(
MRepeat
==
1
);
#endif // defined(EXTRACT_DS_READ)
#endif // defined(EXTRACT_DS_READ)
template
<
typename
ABlockBuffer
,
typename
BBlockBuffer
,
typename
CThreadBuffer
>
__device__
void
Run
(
const
ABlockBuffer
&
a_block_buf
,
const
BBlockBuffer
&
b_block_buf
,
CThreadBuffer
&
c_thread_buf
)
const
{
#if defined(EXTRACT_DS_READ)
#if defined(EXTRACT_DS_READ)
static_assert
(
MRepeat
==
1
);
template
<
typename
ABlockBuffer
>
__device__
void
PrepareRun
(
const
ABlockBuffer
&
a_block_buf
)
const
{
Number
<
0
>
m0
;
Number
<
0
>
m0
;
// read A
// read A
...
@@ -326,6 +321,17 @@ struct BlockwiseGemmXdlops_k0mk1_k0nk1_m0n0m1n1m2m3m4n2_v1
...
@@ -326,6 +321,17 @@ struct BlockwiseGemmXdlops_k0mk1_k0nk1_m0n0m1n1m2m3m4n2_v1
a_thread_desc_
,
a_thread_desc_
,
make_tuple
(
I0
,
I0
,
I0
,
I0
),
make_tuple
(
I0
,
I0
,
I0
,
I0
),
a_thread_buf
);
a_thread_buf
);
}
#endif // defined(EXTRACT_DS_READ)
#if defined(EXTRACT_DS_READ)
template
<
typename
BBlockBuffer
,
typename
CThreadBuffer
>
__device__
void
Run
(
const
BBlockBuffer
&
b_block_buf
,
CThreadBuffer
&
c_thread_buf
)
const
{
Number
<
0
>
m0
;
static_for
<
0
,
NRepeat
,
1
>
{}([
&
](
auto
n0
)
{
static_for
<
0
,
NRepeat
,
1
>
{}([
&
](
auto
n0
)
{
// read B
// read B
...
@@ -360,8 +366,11 @@ struct BlockwiseGemmXdlops_k0mk1_k0nk1_m0n0m1n1m2m3m4n2_v1
...
@@ -360,8 +366,11 @@ struct BlockwiseGemmXdlops_k0mk1_k0nk1_m0n0m1n1m2m3m4n2_v1
});
});
});
});
#else
#else
static_assert
(
false
);
template
<
typename
ABlockBuffer
,
typename
BBlockBuffer
,
typename
CThreadBuffer
>
__device__
void
Run
(
const
ABlockBuffer
&
a_block_buf
,
const
BBlockBuffer
&
b_block_buf
,
CThreadBuffer
&
c_thread_buf
)
const
{
auto
a_thread_buf
=
make_static_buffer
<
AddressSpaceEnum
::
Vgpr
,
FloatAB
>
(
auto
a_thread_buf
=
make_static_buffer
<
AddressSpaceEnum
::
Vgpr
,
FloatAB
>
(
a_thread_desc_
.
GetElementSpaceSize
());
a_thread_desc_
.
GetElementSpaceSize
());
auto
b_thread_buf
=
make_static_buffer
<
AddressSpaceEnum
::
Vgpr
,
FloatAB
>
(
auto
b_thread_buf
=
make_static_buffer
<
AddressSpaceEnum
::
Vgpr
,
FloatAB
>
(
...
...
include/ck/tensor_operation/gpu/grid/gridwise_gemm_pipeline_v2.hpp
View file @
ecef4987
...
@@ -84,7 +84,8 @@ struct GridwiseGemmPipeline_v2
...
@@ -84,7 +84,8 @@ struct GridwiseGemmPipeline_v2
block_sync_lds
();
block_sync_lds
();
// GEMM i
// GEMM i
blockwise_gemm
.
Run
(
a_block_buf
,
b_block_buf
,
c_thread_buf
);
blockwise_gemm
.
PrepareRun
(
a_block_buf
);
blockwise_gemm
.
Run
(
b_block_buf
,
c_thread_buf
);
block_sync_lds
();
block_sync_lds
();
...
@@ -111,7 +112,8 @@ struct GridwiseGemmPipeline_v2
...
@@ -111,7 +112,8 @@ struct GridwiseGemmPipeline_v2
block_sync_lds
();
block_sync_lds
();
// GEMM num_loop - 2
// GEMM num_loop - 2
blockwise_gemm
.
Run
(
a_block_buf
,
b_block_buf
,
c_thread_buf
);
blockwise_gemm
.
PrepareRun
(
a_block_buf
);
blockwise_gemm
.
Run
(
b_block_buf
,
c_thread_buf
);
block_sync_lds
();
block_sync_lds
();
...
@@ -122,7 +124,8 @@ struct GridwiseGemmPipeline_v2
...
@@ -122,7 +124,8 @@ struct GridwiseGemmPipeline_v2
block_sync_lds
();
block_sync_lds
();
// GEMM num_loop - 1
// GEMM num_loop - 1
blockwise_gemm
.
Run
(
a_block_buf
,
b_block_buf
,
c_thread_buf
);
blockwise_gemm
.
PrepareRun
(
a_block_buf
);
blockwise_gemm
.
Run
(
b_block_buf
,
c_thread_buf
);
}
}
}
}
};
};
...
...
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