diff options
author | Viet-Hoa Do <viet-hoa.do@arm.com> | 2023-10-13 17:40:32 +0100 |
---|---|---|
committer | Viet-Hoa Do <viet-hoa.do@arm.com> | 2023-10-31 10:16:25 +0000 |
commit | 29254aeb11a76c86449c2f38587e9144b2f2aacb (patch) | |
tree | ca2df26e81c2417b34768ac325e0f7200b5265df /arm_compute | |
parent | e5362e7e5dbccf81c5296a7e77154e11e1a14d2f (diff) | |
download | ComputeLibrary-29254aeb11a76c86449c2f38587e9144b2f2aacb.tar.gz |
Optimize CL softmax
* The new softmax implementation consists of only a single kernel.
- There are 2 versions of softmax, one for the x dimension
and one for any other dimensions.
- Softmax kernel handles both native and quantized data type.
Resolves: COMPMID-6447
Signed-off-by: Viet-Hoa Do <viet-hoa.do@arm.com>
Change-Id: I4a9ae5bc63f78aebeaa85ee48a0d102c9c245eda
Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/10489
Tested-by: Arm Jenkins <bsgcomp@arm.com>
Reviewed-by: SiCong Li <sicong.li@arm.com>
Comments-Addressed: Arm Jenkins <bsgcomp@arm.com>
Benchmark: Arm Jenkins <bsgcomp@arm.com>
Diffstat (limited to 'arm_compute')
-rw-r--r-- | arm_compute/runtime/CL/functions/CLSoftmaxLayer.h | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/arm_compute/runtime/CL/functions/CLSoftmaxLayer.h b/arm_compute/runtime/CL/functions/CLSoftmaxLayer.h index 70ef1f4402..68541e35c5 100644 --- a/arm_compute/runtime/CL/functions/CLSoftmaxLayer.h +++ b/arm_compute/runtime/CL/functions/CLSoftmaxLayer.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2021 Arm Limited. + * Copyright (c) 2017-2021, 2023 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -21,8 +21,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ -#ifndef ARM_COMPUTE_CLSOFTMAXLAYER_H -#define ARM_COMPUTE_CLSOFTMAXLAYER_H +#ifndef ACL_ARM_COMPUTE_RUNTIME_CL_FUNCTIONS_CLSOFTMAXLAYER_H +#define ACL_ARM_COMPUTE_RUNTIME_CL_FUNCTIONS_CLSOFTMAXLAYER_H #include "arm_compute/runtime/IFunction.h" #include "arm_compute/runtime/IMemoryManager.h" @@ -43,12 +43,6 @@ class CLCompileContext; * * Log Softmax is calculated by : * @f[ out = (x - max(x) * beta) - log(\sum{e^{x - max(x) * beta}}) @f] - * - * This function runs the following operators/kernels: - * -# If axis is not 0: - * -# @ref opencl::ClPermute - * -# @ref opencl::kernels::ClLogits1DNormKernel - * -# @ref opencl::kernels::ClLogits1DMaxShiftExpSumKernel */ template <bool IS_LOG = false> class CLSoftmaxLayerGeneric : public IFunction @@ -115,4 +109,4 @@ private: using CLSoftmaxLayer = CLSoftmaxLayerGeneric<false>; using CLLogSoftmaxLayer = CLSoftmaxLayerGeneric<true>; } // namespace arm_compute -#endif /* ARM_COMPUTE_CLSOFTMAXLAYER_H */ +#endif // ACL_ARM_COMPUTE_RUNTIME_CL_FUNCTIONS_CLSOFTMAXLAYER_H |