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
de1cb1ed
Commit
de1cb1ed
authored
Nov 29, 2023
by
rocking
Browse files
add layernorm 2d bwd gamma beta instances
parent
0cb58fac
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
113 additions
and
0 deletions
+113
-0
library/src/tensor_operation_instance/gpu/normalization_bwd_gamma_beta/CMakeLists.txt
..._instance/gpu/normalization_bwd_gamma_beta/CMakeLists.txt
+7
-0
library/src/tensor_operation_instance/gpu/normalization_bwd_gamma_beta/device_layernorm2d_bwd_gamma_beta_f16_instance.cpp
...a_beta/device_layernorm2d_bwd_gamma_beta_f16_instance.cpp
+24
-0
library/src/tensor_operation_instance/gpu/normalization_bwd_gamma_beta/device_layernorm2d_bwd_gamma_beta_f32_instance.cpp
...a_beta/device_layernorm2d_bwd_gamma_beta_f32_instance.cpp
+24
-0
library/src/tensor_operation_instance/gpu/normalization_bwd_gamma_beta/normalization_bwd_gamma_beta_instance_common.hpp
...mma_beta/normalization_bwd_gamma_beta_instance_common.hpp
+58
-0
No files found.
library/src/tensor_operation_instance/gpu/normalization_bwd_gamma_beta/CMakeLists.txt
0 → 100644
View file @
de1cb1ed
set
(
DEVICE_NORMALIZATION_BWD_GAMMA_BETA_INSTANCES
)
list
(
APPEND DEVICE_NORMALIZATION_BWD_GAMMA_BETA_INSTANCES
device_layernorm2d_bwd_gamma_beta_f16_instance.cpp
device_layernorm2d_bwd_gamma_beta_f32_instance.cpp
)
add_instance_library
(
device_normalization_bwd_gamma_beta_instance
${
DEVICE_NORMALIZATION_BWD_GAMMA_BETA_INSTANCES
}
)
library/src/tensor_operation_instance/gpu/normalization_bwd_gamma_beta/device_layernorm2d_bwd_gamma_beta_f16_instance.cpp
0 → 100644
View file @
de1cb1ed
// SPDX-License-Identifier: MIT
// Copyright (c) 2018-2023, Advanced Micro Devices, Inc. All rights reserved.
#include "normalization_bwd_gamma_beta_instance_common.hpp"
namespace
ck
{
namespace
tensor_operation
{
namespace
device
{
namespace
instance
{
void
add_device_layernorm2d_bwd_gamma_beta_rank_2_1_f16_instances
(
std
::
vector
<
std
::
unique_ptr
<
DeviceNormalizationBwdGammaBeta
<
F16
,
F16
,
F16
,
F16
,
F16
,
2
,
1
>>>&
instances
)
{
add_device_operation_instances
(
instances
,
device_layernorm_bwd_gamma_beta_f16_generic_instance
<
2
,
1
>
{});
add_device_operation_instances
(
instances
,
device_layernorm_bwd_gamma_beta_f16_instances
<
2
,
1
>
{});
}
}
// namespace instance
}
// namespace device
}
// namespace tensor_operation
}
// namespace ck
library/src/tensor_operation_instance/gpu/normalization_bwd_gamma_beta/device_layernorm2d_bwd_gamma_beta_f32_instance.cpp
0 → 100644
View file @
de1cb1ed
// SPDX-License-Identifier: MIT
// Copyright (c) 2018-2023, Advanced Micro Devices, Inc. All rights reserved.
#include "normalization_bwd_gamma_beta_instance_common.hpp"
namespace
ck
{
namespace
tensor_operation
{
namespace
device
{
namespace
instance
{
void
add_device_layernorm2d_bwd_gamma_beta_rank_2_1_f32_instances
(
std
::
vector
<
std
::
unique_ptr
<
DeviceNormalizationBwdGammaBeta
<
F32
,
F32
,
F32
,
F32
,
F32
,
2
,
1
>>>&
instances
)
{
add_device_operation_instances
(
instances
,
device_layernorm_bwd_gamma_beta_f32_generic_instance
<
2
,
1
>
{});
add_device_operation_instances
(
instances
,
device_layernorm_bwd_gamma_beta_f32_instances
<
2
,
1
>
{});
}
}
// namespace instance
}
// namespace device
}
// namespace tensor_operation
}
// namespace ck
library/src/tensor_operation_instance/gpu/normalization_bwd_gamma_beta/normalization_bwd_gamma_beta_instance_common.hpp
0 → 100644
View file @
de1cb1ed
// SPDX-License-Identifier: MIT
// Copyright (c) 2018-2023, Advanced Micro Devices, Inc. All rights reserved.
#pragma once
#include "ck/ck.hpp"
#include "ck/tensor_operation/gpu/device/impl/device_normalization_bwd_gamma_beta_impl.hpp"
#include "ck/utility/data_type.hpp"
#include "ck/library/tensor_operation_instance/add_device_operation_instance.hpp"
namespace
ck
{
namespace
tensor_operation
{
namespace
device
{
namespace
instance
{
using
F16
=
ck
::
half_t
;
using
F32
=
float
;
template
<
index_t
Rank
,
index_t
Reduce
>
using
device_layernorm_bwd_gamma_beta_f16_instances
=
// clang-format off
std
::
tuple
<
// DYDataType, XDataType, MeanInvStdDataType, ComputeDataType, DGammaDataType, DBetaDataType, Rank, NumReduceDim, BlockSize, MThreadClusterSize, KThreadClusterSize, MThreadSliceSize, KThreadSliceSize, IsDYFastestDimReduced, DYSrcVectorSize, IsXFastestDimReduced, XSrcVectorSize, IsMeanInvStdFastestDimReduced, MeanInvStdSrcVectorSize, DGammaDstVectorSize, DBetaDstVectorSize>
DeviceNormalizationBwdGammaBetaImpl
<
F16
,
F16
,
F16
,
F32
,
F16
,
F16
,
Rank
,
Reduce
,
256
,
1
,
256
,
2
,
1
,
false
,
2
,
false
,
2
,
true
,
1
,
2
,
2
>
,
DeviceNormalizationBwdGammaBetaImpl
<
F16
,
F16
,
F16
,
F32
,
F16
,
F16
,
Rank
,
Reduce
,
256
,
1
,
256
,
4
,
1
,
false
,
4
,
false
,
4
,
true
,
1
,
4
,
4
>
,
DeviceNormalizationBwdGammaBetaImpl
<
F16
,
F16
,
F16
,
F32
,
F16
,
F16
,
Rank
,
Reduce
,
256
,
1
,
256
,
8
,
1
,
false
,
8
,
false
,
8
,
true
,
1
,
8
,
8
>
// clang-format on
>
;
template
<
index_t
Rank
,
index_t
Reduce
>
using
device_layernorm_bwd_gamma_beta_f16_generic_instance
=
std
::
tuple
<
// clang-format off
DeviceNormalizationBwdGammaBetaImpl
<
F16
,
F16
,
F16
,
F32
,
F16
,
F16
,
Rank
,
Reduce
,
64
,
1
,
64
,
1
,
1
,
false
,
1
,
false
,
1
,
true
,
1
,
1
,
1
>
// clang-format on
>
;
template
<
index_t
Rank
,
index_t
Reduce
>
using
device_layernorm_bwd_gamma_beta_f32_instances
=
// clang-format off
std
::
tuple
<
// DYDataType, XDataType, MeanInvStdDataType, ComputeDataType, DGammaDataType, DBetaDataType, Rank, NumReduceDim, BlockSize, MThreadClusterSize, KThreadClusterSize, MThreadSliceSize, KThreadSliceSize, IsDYFastestDimReduced, DYSrcVectorSize, IsXFastestDimReduced, XSrcVectorSize, IsMeanInvStdFastestDimReduced, MeanInvStdSrcVectorSize, DGammaDstVectorSize, DBetaDstVectorSize>
DeviceNormalizationBwdGammaBetaImpl
<
F32
,
F32
,
F32
,
F32
,
F32
,
F32
,
Rank
,
Reduce
,
256
,
1
,
256
,
2
,
1
,
false
,
2
,
false
,
2
,
true
,
1
,
2
,
2
>
,
DeviceNormalizationBwdGammaBetaImpl
<
F32
,
F32
,
F32
,
F32
,
F32
,
F32
,
Rank
,
Reduce
,
256
,
1
,
256
,
4
,
1
,
false
,
4
,
false
,
4
,
true
,
1
,
4
,
4
>
// clang-format on
>
;
template
<
index_t
Rank
,
index_t
Reduce
>
using
device_layernorm_bwd_gamma_beta_f32_generic_instance
=
std
::
tuple
<
// clang-format off
DeviceNormalizationBwdGammaBetaImpl
<
F32
,
F32
,
F32
,
F32
,
F32
,
F32
,
Rank
,
Reduce
,
64
,
1
,
64
,
1
,
1
,
false
,
1
,
false
,
1
,
true
,
1
,
1
,
1
>
// clang-format on
>
;
}
// namespace instance
}
// namespace device
}
// namespace tensor_operation
}
// namespace ck
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