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
09486ebf
Commit
09486ebf
authored
Dec 29, 2024
by
Po Yen Chen
Browse files
Re-arrange move_tile_window() statements
parent
73a4d827
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
5 deletions
+24
-5
include/ck_tile/ops/fmha/pipeline/block_fmha_fwd_splitkv_pipeline_qr_ks_vs.hpp
...mha/pipeline/block_fmha_fwd_splitkv_pipeline_qr_ks_vs.hpp
+24
-5
No files found.
include/ck_tile/ops/fmha/pipeline/block_fmha_fwd_splitkv_pipeline_qr_ks_vs.hpp
View file @
09486ebf
...
@@ -454,6 +454,11 @@ struct BlockFmhaFwdSplitKVPipelineQRKSVS
...
@@ -454,6 +454,11 @@ struct BlockFmhaFwdSplitKVPipelineQRKSVS
});
});
}
}
}
}
__builtin_amdgcn_sched_barrier
(
0
);
// move K tile window
i_page_block_k
=
k_page_block_navigator
.
move_tile_window
(
i_page_block_k
,
k_dram_block_window
,
{
kN0
,
0
});
__builtin_amdgcn_sched_barrier
(
0
);
const
auto
s
=
cast_tile
<
SMPLComputeDataType
>
(
s_acc
);
// S{j}
const
auto
s
=
cast_tile
<
SMPLComputeDataType
>
(
s_acc
);
// S{j}
auto
m_local
=
block_tile_reduce
<
SMPLComputeDataType
>
(
auto
m_local
=
block_tile_reduce
<
SMPLComputeDataType
>
(
...
@@ -544,6 +549,15 @@ struct BlockFmhaFwdSplitKVPipelineQRKSVS
...
@@ -544,6 +549,15 @@ struct BlockFmhaFwdSplitKVPipelineQRKSVS
});
});
});
});
if
constexpr
(
std
::
is_same_v
<
VLayout
,
ck_tile
::
tensor_layout
::
gemm
::
RowMajor
>
)
{
__builtin_amdgcn_sched_barrier
(
0
);
// move V tile window (row major)
i_page_block_v
=
v_page_block_navigator
.
move_tile_window
(
i_page_block_v
,
v_dram_window
,
{
0
,
kK1
});
__builtin_amdgcn_sched_barrier
(
0
);
}
block_sync_lds
();
block_sync_lds
();
if
constexpr
(
std
::
is_same_v
<
VLayout
,
ck_tile
::
tensor_layout
::
gemm
::
RowMajor
>
)
if
constexpr
(
std
::
is_same_v
<
VLayout
,
ck_tile
::
tensor_layout
::
gemm
::
RowMajor
>
)
{
{
...
@@ -577,8 +591,15 @@ struct BlockFmhaFwdSplitKVPipelineQRKSVS
...
@@ -577,8 +591,15 @@ struct BlockFmhaFwdSplitKVPipelineQRKSVS
store_tile
(
v_lds_window
,
store_tile
(
v_lds_window
,
tile_elementwise_in
(
v_element_func
,
v_prefetch
));
// store the prefetch
tile_elementwise_in
(
v_element_func
,
v_prefetch
));
// store the prefetch
}
}
i_page_block_v
=
v_page_block_navigator
.
move_tile_window
(
i_page_block_v
,
v_dram_window
,
{
0
,
kK1
});
if
constexpr
(
!
std
::
is_same_v
<
VLayout
,
ck_tile
::
tensor_layout
::
gemm
::
RowMajor
>
)
{
__builtin_amdgcn_sched_barrier
(
0
);
// move V tile window (column major)
i_page_block_v
=
v_page_block_navigator
.
move_tile_window
(
i_page_block_v
,
v_dram_window
,
{
0
,
kK1
});
__builtin_amdgcn_sched_barrier
(
0
);
}
const
auto
p
=
const
auto
p
=
cast_tile
<
PDataType
>
(
tile_elementwise_in
(
p_compute_element_func
,
p_compute
));
cast_tile
<
PDataType
>
(
tile_elementwise_in
(
p_compute_element_func
,
p_compute
));
...
@@ -633,9 +654,7 @@ struct BlockFmhaFwdSplitKVPipelineQRKSVS
...
@@ -633,9 +654,7 @@ struct BlockFmhaFwdSplitKVPipelineQRKSVS
i_page_block_v_
,
v_dram_window_
,
{
0
,
kK1
});
i_page_block_v_
,
v_dram_window_
,
{
0
,
kK1
});
});
});
}
}
// move K tile windows
i_page_block_k
=
k_page_block_navigator
.
move_tile_window
(
i_page_block_k
,
k_dram_block_window
,
{
kN0
,
0
});
// tail
// tail
{
{
block_sync_lds
();
block_sync_lds
();
...
...
gaoqiong
@gaoqiong
mentioned in commit
212e9006
·
Feb 18, 2025
mentioned in commit
212e9006
mentioned in commit 212e90064b91eea64200a55608584c8cc03ef7bc
Toggle commit list
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