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
0cb58fac
Commit
0cb58fac
authored
Nov 29, 2023
by
rocking
Browse files
Add bwd x instance
parent
7a272c85
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
111 additions
and
0 deletions
+111
-0
library/src/tensor_operation_instance/gpu/normalization_bwd_x/CMakeLists.txt
...operation_instance/gpu/normalization_bwd_x/CMakeLists.txt
+7
-0
library/src/tensor_operation_instance/gpu/normalization_bwd_x/device_layernorm2d_bwd_x_f16_instance.cpp
...alization_bwd_x/device_layernorm2d_bwd_x_f16_instance.cpp
+23
-0
library/src/tensor_operation_instance/gpu/normalization_bwd_x/device_layernorm2d_bwd_x_f32_instance.cpp
...alization_bwd_x/device_layernorm2d_bwd_x_f32_instance.cpp
+23
-0
library/src/tensor_operation_instance/gpu/normalization_bwd_x/normalization_bwd_x_instance_common.hpp
...rmalization_bwd_x/normalization_bwd_x_instance_common.hpp
+58
-0
No files found.
library/src/tensor_operation_instance/gpu/normalization_bwd_x/CMakeLists.txt
0 → 100644
View file @
0cb58fac
set
(
DEVICE_NORMALIZATION_BWD_X_INSTANCES
)
list
(
APPEND DEVICE_NORMALIZATION_BWD_X_INSTANCES
device_layernorm2d_bwd_x_f16_instance.cpp
device_layernorm2d_bwd_x_f32_instance.cpp
)
add_instance_library
(
device_normalization_bwd_x_instance
${
DEVICE_NORMALIZATION_BWD_X_INSTANCES
}
)
library/src/tensor_operation_instance/gpu/normalization_bwd_x/device_layernorm2d_bwd_x_f16_instance.cpp
0 → 100644
View file @
0cb58fac
// SPDX-License-Identifier: MIT
// Copyright (c) 2018-2023, Advanced Micro Devices, Inc. All rights reserved.
#include "normalization_bwd_x_instance_common.hpp"
namespace
ck
{
namespace
tensor_operation
{
namespace
device
{
namespace
instance
{
void
add_device_layernorm2d_bwd_x_f16_instances
(
std
::
vector
<
std
::
unique_ptr
<
DeviceNormalizationBwdX
<
F16
,
F16
,
F16
,
F16
,
F16
,
2
,
1
>>>&
instances
)
{
add_device_operation_instances
(
instances
,
device_layernorm_bwd_x_f16_generic_instance
<
2
,
1
>
{});
add_device_operation_instances
(
instances
,
device_layernorm_bwd_x_f16_instances
<
2
,
1
>
{});
}
}
// namespace instance
}
// namespace device
}
// namespace tensor_operation
}
// namespace ck
library/src/tensor_operation_instance/gpu/normalization_bwd_x/device_layernorm2d_bwd_x_f32_instance.cpp
0 → 100644
View file @
0cb58fac
// SPDX-License-Identifier: MIT
// Copyright (c) 2018-2023, Advanced Micro Devices, Inc. All rights reserved.
#include "normalization_bwd_x_instance_common.hpp"
namespace
ck
{
namespace
tensor_operation
{
namespace
device
{
namespace
instance
{
void
add_device_layernorm2d_bwd_x_rank_2_1_f32_instances
(
std
::
vector
<
std
::
unique_ptr
<
DeviceNormalizationBwdX
<
F32
,
F32
,
F32
,
F32
,
F32
,
2
,
1
>>>&
instances
)
{
add_device_operation_instances
(
instances
,
device_layernorm_bwd_x_f32_generic_instance
<
2
,
1
>
{});
add_device_operation_instances
(
instances
,
device_layernorm_bwd_x_f32_instances
<
2
,
1
>
{});
}
}
// namespace instance
}
// namespace device
}
// namespace tensor_operation
}
// namespace ck
library/src/tensor_operation_instance/gpu/normalization_bwd_x/normalization_bwd_x_instance_common.hpp
0 → 100644
View file @
0cb58fac
// 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_x_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_x_f16_instances
=
// clang-format off
std
::
tuple
<
// DYDataType, XDataType, GammaDataType, MeanInvStdDataType, ComputeDataType, DXDataType, Rank, NumReduceDim, BlockSize, MThreadClusterSize, KThreadClusterSize, MThreadSliceSize, KThreadSliceSize, IsDYFastestDimReduced, DYSrcVectorSize, IsXFastestDimReduced, XSrcVectorSize, IsGammaFastestDimReduced, GammaSrcVectorSize, IsMeanInvStdFastestDimReduced, MeanInvStdSrcVectorSize, IsDXFastestDimReduced, DXDstVectorSize>
DeviceNormalizationBwdXImpl
<
F16
,
F16
,
F16
,
F16
,
F32
,
F16
,
Rank
,
Reduce
,
256
,
1
,
256
,
1
,
2
,
true
,
2
,
true
,
2
,
true
,
2
,
false
,
1
,
true
,
2
>
,
DeviceNormalizationBwdXImpl
<
F16
,
F16
,
F16
,
F16
,
F32
,
F16
,
Rank
,
Reduce
,
256
,
1
,
256
,
1
,
4
,
true
,
4
,
true
,
4
,
true
,
4
,
false
,
1
,
true
,
4
>
,
DeviceNormalizationBwdXImpl
<
F16
,
F16
,
F16
,
F16
,
F32
,
F16
,
Rank
,
Reduce
,
256
,
1
,
256
,
1
,
8
,
true
,
8
,
true
,
8
,
true
,
8
,
false
,
1
,
true
,
8
>
// clang-format on
>
;
template
<
index_t
Rank
,
index_t
Reduce
>
using
device_layernorm_bwd_x_f16_generic_instance
=
std
::
tuple
<
// clang-format off
DeviceNormalizationBwdXImpl
<
F16
,
F16
,
F16
,
F16
,
F32
,
F16
,
Rank
,
Reduce
,
64
,
1
,
64
,
1
,
1
,
true
,
1
,
true
,
1
,
true
,
1
,
false
,
1
,
true
,
1
>
// clang-format on
>
;
template
<
index_t
Rank
,
index_t
Reduce
>
using
device_layernorm_bwd_x_f32_instances
=
// clang-format off
std
::
tuple
<
// DYDataType, XDataType, GammaDataType, MeanInvStdDataType, ComputeDataType, DXDataType, Rank, NumReduceDim, BlockSize, MThreadClusterSize, KThreadClusterSize, MThreadSliceSize, KThreadSliceSize, IsDYFastestDimReduced, DYSrcVectorSize, IsXFastestDimReduced, XSrcVectorSize, IsGammaFastestDimReduced, GammaSrcVectorSize, IsMeanInvStdFastestDimReduced, MeanInvStdSrcVectorSize, IsDXFastestDimReduced, DXDstVectorSize>
DeviceNormalizationBwdXImpl
<
F32
,
F32
,
F32
,
F32
,
F32
,
F32
,
Rank
,
Reduce
,
256
,
1
,
256
,
1
,
2
,
true
,
2
,
true
,
2
,
true
,
2
,
false
,
1
,
true
,
2
>
,
DeviceNormalizationBwdXImpl
<
F32
,
F32
,
F32
,
F32
,
F32
,
F32
,
Rank
,
Reduce
,
256
,
1
,
256
,
1
,
4
,
true
,
4
,
true
,
4
,
true
,
4
,
false
,
1
,
true
,
4
>
// clang-format on
>
;
template
<
index_t
Rank
,
index_t
Reduce
>
using
device_layernorm_bwd_x_f32_generic_instance
=
std
::
tuple
<
// clang-format off
DeviceNormalizationBwdXImpl
<
F32
,
F32
,
F32
,
F32
,
F32
,
F32
,
Rank
,
Reduce
,
64
,
1
,
64
,
1
,
1
,
true
,
1
,
true
,
1
,
true
,
1
,
false
,
1
,
true
,
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