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
a3f11fe9
Commit
a3f11fe9
authored
Jul 25, 2023
by
ltqin
Browse files
fix name
parent
92238f48
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
9 deletions
+9
-9
example/32_batched_gemm_scale_softmax_gemm/batched_multihead_attention_backward_v2.cpp
..._softmax_gemm/batched_multihead_attention_backward_v2.cpp
+1
-1
include/ck/tensor_operation/gpu/device/impl/device_batched_mha_bwd_xdl_cshuffle_qloop_v2.hpp
...ice/impl/device_batched_mha_bwd_xdl_cshuffle_qloop_v2.hpp
+2
-2
include/ck/tensor_operation/gpu/device/masking_specialization.hpp
...ck/tensor_operation/gpu/device/masking_specialization.hpp
+6
-6
No files found.
example/32_batched_gemm_scale_softmax_gemm/batched_multihead_attention_backward_v2.cpp
View file @
a3f11fe9
...
@@ -85,7 +85,7 @@ static constexpr ck::index_t CShuffleBlockTransferScalarPerVector_NPerBlock = 8;
...
@@ -85,7 +85,7 @@ static constexpr ck::index_t CShuffleBlockTransferScalarPerVector_NPerBlock = 8;
static
constexpr
auto
GemmSpec
=
ck
::
tensor_operation
::
device
::
GemmSpecialization
::
MNKOPadding
;
static
constexpr
auto
GemmSpec
=
ck
::
tensor_operation
::
device
::
GemmSpecialization
::
MNKOPadding
;
#if USING_MASK
#if USING_MASK
static
constexpr
auto
MaskingSpec
=
static
constexpr
auto
MaskingSpec
=
ck
::
tensor_operation
::
device
::
MaskingSpecialization
::
MaskUpperTringleFromBotto
n
Right
;
ck
::
tensor_operation
::
device
::
MaskingSpecialization
::
MaskUpperTringleFromBotto
m
Right
;
#else
#else
static
constexpr
auto
MaskingSpec
=
static
constexpr
auto
MaskingSpec
=
ck
::
tensor_operation
::
device
::
MaskingSpecialization
::
MaskDisabled
;
ck
::
tensor_operation
::
device
::
MaskingSpecialization
::
MaskDisabled
;
...
...
include/ck/tensor_operation/gpu/device/impl/device_batched_mha_bwd_xdl_cshuffle_qloop_v2.hpp
View file @
a3f11fe9
...
@@ -569,9 +569,9 @@ struct DeviceBatchedMultiheadAttentionBackward_Qloop_Xdl_CShuffle_V2
...
@@ -569,9 +569,9 @@ struct DeviceBatchedMultiheadAttentionBackward_Qloop_Xdl_CShuffle_V2
{
{
return
MaskOutUpperTrianglePredicate
{};
return
MaskOutUpperTrianglePredicate
{};
}
}
else
if
constexpr
(
MaskingSpec
==
MaskingSpecialization
::
MaskUpperTringleFromBotto
n
Right
)
else
if
constexpr
(
MaskingSpec
==
MaskingSpecialization
::
MaskUpperTringleFromBotto
m
Right
)
{
{
return
MaskUpperTringleFromBotto
n
RightPredicate
{};
return
MaskUpperTringleFromBotto
m
RightPredicate
{};
}
}
}
}
using
C0MatrixMask
=
C0MatrixMask_impl
<
decltype
(
make_MaskOutPredicate
())
>
;
using
C0MatrixMask
=
C0MatrixMask_impl
<
decltype
(
make_MaskOutPredicate
())
>
;
...
...
include/ck/tensor_operation/gpu/device/masking_specialization.hpp
View file @
a3f11fe9
...
@@ -11,7 +11,7 @@ enum struct MaskingSpecialization
...
@@ -11,7 +11,7 @@ enum struct MaskingSpecialization
{
{
MaskDisabled
,
MaskDisabled
,
MaskOutUpperTriangle
,
MaskOutUpperTriangle
,
MaskUpperTringleFromBotto
n
Right
MaskUpperTringleFromBotto
m
Right
};
};
inline
std
::
string
getMaskingSpecializationString
(
const
MaskingSpecialization
&
s
)
inline
std
::
string
getMaskingSpecializationString
(
const
MaskingSpecialization
&
s
)
...
@@ -20,8 +20,8 @@ inline std::string getMaskingSpecializationString(const MaskingSpecialization& s
...
@@ -20,8 +20,8 @@ inline std::string getMaskingSpecializationString(const MaskingSpecialization& s
{
{
case
MaskingSpecialization
::
MaskDisabled
:
return
"MaskDisabled"
;
case
MaskingSpecialization
::
MaskDisabled
:
return
"MaskDisabled"
;
case
MaskingSpecialization
::
MaskOutUpperTriangle
:
return
"MaskOutUpperTriangle"
;
case
MaskingSpecialization
::
MaskOutUpperTriangle
:
return
"MaskOutUpperTriangle"
;
case
MaskingSpecialization
::
MaskUpperTringleFromBotto
n
Right
:
case
MaskingSpecialization
::
MaskUpperTringleFromBotto
m
Right
:
return
"MaskUpperTringleFromBotto
n
Right"
;
return
"MaskUpperTringleFromBotto
m
Right"
;
default:
return
"Unrecognized specialization!"
;
default:
return
"Unrecognized specialization!"
;
}
}
}
}
...
@@ -50,9 +50,9 @@ struct MaskOutUpperTrianglePredicate
...
@@ -50,9 +50,9 @@ struct MaskOutUpperTrianglePredicate
return
operator
()(
m
+
m_tile
-
1
,
n
);
return
operator
()(
m
+
m_tile
-
1
,
n
);
}
}
};
};
struct
MaskUpperTringleFromBotto
n
RightPredicate
struct
MaskUpperTringleFromBotto
m
RightPredicate
{
{
MaskUpperTringleFromBotto
n
RightPredicate
()
:
offset_
(
0
)
{}
MaskUpperTringleFromBotto
m
RightPredicate
()
:
offset_
(
0
)
{}
__host__
__device__
void
SetOffset
(
const
index_t
offset
)
{
offset_
=
offset
;
}
__host__
__device__
void
SetOffset
(
const
index_t
offset
)
{
offset_
=
offset
;
}
__host__
__device__
constexpr
bool
operator
()(
index_t
m
,
index_t
n
)
const
__host__
__device__
constexpr
bool
operator
()(
index_t
m
,
index_t
n
)
const
{
{
...
@@ -77,7 +77,7 @@ struct C0MatrixMask_impl
...
@@ -77,7 +77,7 @@ struct C0MatrixMask_impl
C0MatrixMask_impl
(
index_t
MRaw
,
index_t
NRaw
)
:
NRaw_
(
NRaw
),
predicate_
(
MaskOutPredicate
{})
C0MatrixMask_impl
(
index_t
MRaw
,
index_t
NRaw
)
:
NRaw_
(
NRaw
),
predicate_
(
MaskOutPredicate
{})
{
{
if
constexpr
(
std
::
is_same
<
MaskOutPredicate
,
if
constexpr
(
std
::
is_same
<
MaskOutPredicate
,
MaskUpperTringleFromBotto
n
RightPredicate
>::
value
)
MaskUpperTringleFromBotto
m
RightPredicate
>::
value
)
{
{
if
(
NRaw
>
MRaw
)
if
(
NRaw
>
MRaw
)
predicate_
.
SetOffset
(
NRaw
-
MRaw
);
predicate_
.
SetOffset
(
NRaw
-
MRaw
);
...
...
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