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
37052173
Unverified
Commit
37052173
authored
Jan 31, 2025
by
Max Podkorytov
Browse files
run clang-format
parent
0d96a891
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
25 deletions
+28
-25
example/ck_tile/18_flexattn/fmha_fwd.cpp
example/ck_tile/18_flexattn/fmha_fwd.cpp
+16
-14
include/ck_tile/ops/fmha/kernel/fmha_flex_fwd_kernel.hpp
include/ck_tile/ops/fmha/kernel/fmha_flex_fwd_kernel.hpp
+12
-11
No files found.
example/ck_tile/18_flexattn/fmha_fwd.cpp
View file @
37052173
...
...
@@ -1375,15 +1375,19 @@ bool run(const ck_tile::ArgParser& arg_parser)
ck_tile
::
identity
{},
ck_tile
::
identity
{});
#ifndef CK_TILE_SCORE_MOD_F
#error "must be defined"
#else
#define XSTR(x) STR(x)
#define STR(x) #x
#pragma message "host score_mod_f: " XSTR(CK_TILE_SCORE_MOD_F)
#endif
auto
score_mod
=
[]
(
auto
s
,
ck_tile
::
index_t
b
,
ck_tile
::
index_t
h
,
ck_tile
::
index_t
q_idx
,
ck_tile
::
index_t
v_idx
)
{
#ifndef CK_TILE_SCORE_MOD_F
#error "must be defined"
#else
#define XSTR(x) STR(x)
#define STR(x) #x
#pragma message "host score_mod_f: " XSTR(CK_TILE_SCORE_MOD_F)
#endif
auto
score_mod
=
[](
auto
s
,
ck_tile
::
index_t
b
,
ck_tile
::
index_t
h
,
ck_tile
::
index_t
q_idx
,
ck_tile
::
index_t
v_idx
)
{
ck_tile
::
detail
::
swallow
(
s
,
b
,
h
,
q_idx
,
v_idx
);
return
CK_TILE_SCORE_MOD_F
;
};
...
...
@@ -1396,9 +1400,7 @@ bool run(const ck_tile::ArgParser& arg_parser)
});
auto
scale_def
=
ck_tile
::
scales
(
scale_s
);
s_host_ref
.
ForEach
([
&
](
auto
&
self
,
auto
i
)
{
self
(
i
)
=
scale_def
(
self
(
i
));
});
s_host_ref
.
ForEach
([
&
](
auto
&
self
,
auto
i
)
{
self
(
i
)
=
scale_def
(
self
(
i
));
});
if
(
bias
.
type
==
bias_enum
::
elementwise_bias
)
{
...
...
include/ck_tile/ops/fmha/kernel/fmha_flex_fwd_kernel.hpp
View file @
37052173
...
...
@@ -1305,12 +1305,13 @@ struct FmhaFwdKernel
// may have state inside
auto
score_mod_def
=
ScoreModFunction_
{};
auto
score_mod_arg
=
[
b
=
i_batch
,
h
=
i_nhead
,
score_mod_def
](
typename
ScoreModFunction_
::
TScore
s
,
auto
score_mod_arg
=
[
b
=
i_batch
,
h
=
i_nhead
,
score_mod_def
](
typename
ScoreModFunction_
::
TScore
s
,
ck_tile
::
index_t
q_idx
,
ck_tile
::
index_t
v_idx
)
{
auto
new_score
=
score_mod_def
(
s
,
b
,
h
,
q_idx
,
v_idx
);
\
// printf("device score_mod at (%d %d %d %d), score before: %f, score after: %f score_clip: %f\n",
auto
new_score
=
score_mod_def
(
s
,
b
,
h
,
q_idx
,
v_idx
);
// printf("device score_mod at (%d %d %d %d), score
// before: %f, score after: %f score_clip: %f\n",
// b, h, q_idx, v_idx, s, new_score, new_score_after_clip);
return
new_score
;
};
...
...
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