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
f1ed4c5e
"vscode:/vscode.git/clone" did not exist on "993295b9862af7f4a8d469789ce115c503e46c6f"
Commit
f1ed4c5e
authored
Mar 08, 2023
by
ltqin
Browse files
add lib gemm softmax gemm files
parent
1e59eb3b
Changes
3
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
265 additions
and
0 deletions
+265
-0
include/ck/tensor_operation/gpu/element/element_wise_operation.hpp
...k/tensor_operation/gpu/element/element_wise_operation.hpp
+43
-0
library/src/tensor_operation_instance/gpu/batched_gemm_softmax_gemm_permute/CMakeLists.txt
...ance/gpu/batched_gemm_softmax_gemm_permute/CMakeLists.txt
+1
-0
library/src/tensor_operation_instance/gpu/batched_gemm_softmax_gemm_permute/device_batched_gemm_bias_softmax_gemm_permute_xdl_cshuffle_gmk_gnk_gno_gmo_instance.cpp
...ax_gemm_permute_xdl_cshuffle_gmk_gnk_gno_gmo_instance.cpp
+221
-0
No files found.
include/ck/tensor_operation/gpu/element/element_wise_operation.hpp
View file @
f1ed4c5e
...
...
@@ -389,6 +389,49 @@ struct UnaryTypeConvert<ck::bhalf_t, float>
}
};
struct
ScaleMask
{
ScaleMask
(
float
scale
,
float
mask_filter_value
)
:
scale_
(
scale
),
mask_filter_value_
(
mask_filter_value
)
{
}
// scale, masked
template
<
typename
Y
,
typename
X0
,
typename
X1
>
__host__
__device__
constexpr
void
operator
()(
Y
&
y
,
const
X0
&
x
,
const
X1
&
mask
)
const
;
__host__
__device__
constexpr
void
operator
()(
float
&
y
,
const
float
&
x
,
const
int32_t
&
mask
)
const
{
float
filter_value
=
(
mask
==
1
?
0.0
f
:
mask_filter_value_
);
y
=
scale_
*
x
+
filter_value
;
}
const
float
scale_
;
const
float
mask_filter_value_
;
};
struct
ScaleBiasMask
{
ScaleBiasMask
(
float
scale
,
float
mask_filter_value
)
:
scale_
(
scale
),
mask_filter_value_
(
mask_filter_value
)
{
}
// biased, masked
template
<
typename
Y
,
typename
X0
,
typename
X1
,
typename
X2
>
__host__
__device__
constexpr
void
operator
()(
Y
&
y
,
const
X0
&
x
,
const
X1
&
bias
,
const
X2
&
mask
)
const
;
template
<
>
__host__
__device__
constexpr
void
operator
()(
float
&
y
,
const
float
&
x
,
const
F16
&
bias
,
const
int32_t
&
mask
)
const
{
float
filter_value
=
(
mask
==
1
?
0.0
f
:
mask_filter_value_
);
y
=
scale_
*
x
+
ck
::
type_convert
<
float
>
(
bias
)
+
filter_value
;
}
const
float
scale_
;
const
float
mask_filter_value_
;
};
}
// namespace element_wise
}
// namespace tensor_operation
}
// namespace ck
library/src/tensor_operation_instance/gpu/batched_gemm_softmax_gemm_permute/CMakeLists.txt
View file @
f1ed4c5e
...
...
@@ -3,5 +3,6 @@ add_instance_library(device_batched_gemm_softmax_gemm_permute_instance
device_batched_gemm_softmax_gemm_permute_xdl_cshuffle_bf16_bf16_bf16_bf16_gmk_gnk_gno_gmo_instance.cpp
device_batched_gemm_bias_softmax_gemm_permute_xdl_cshuffle_f16_f16_f16_f16_gmk_gnk_gno_gmo_instance.cpp
device_batched_gemm_bias_softmax_gemm_permute_xdl_cshuffle_bf16_bf16_bf16_bf16_gmk_gnk_gno_gmo_instance.cpp
device_batched_gemm_bias_softmax_gemm_permute_xdl_cshuffle_gmk_gnk_gno_gmo_instance.cpp
)
library/src/tensor_operation_instance/gpu/batched_gemm_softmax_gemm_permute/device_batched_gemm_bias_softmax_gemm_permute_xdl_cshuffle_gmk_gnk_gno_gmo_instance.cpp
0 → 100644
View file @
f1ed4c5e
This diff is collapsed.
Click to expand it.
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