aboutsummaryrefslogtreecommitdiff
path: root/src/dynamic_fusion/sketch/gpu/components/cl/ClComponentLogits1DMaxShiftExpSum.cpp
diff options
context:
space:
mode:
authorRamy Elgammal <ramelg01@e129512.arm.com>2023-01-11 18:48:04 +0000
committerRamy Elgammal <ramy.elgammal@arm.com>2023-01-25 10:24:23 +0000
commit002e6530f6218b00a28aef9be8b21efb08cf3602 (patch)
treef3e2f9d064b985ffe283512825b34cdd59f29f50 /src/dynamic_fusion/sketch/gpu/components/cl/ClComponentLogits1DMaxShiftExpSum.cpp
parentcc2877368d5e15d9ea89d31c84ec651fc0fffd13 (diff)
downloadComputeLibrary-002e6530f6218b00a28aef9be8b21efb08cf3602.tar.gz
Implement dynamic fusion softmax operator
- Return aux tensorInfo by get_aux_tensors() at runtime to init the aux tensor with the right size. - Keep softmax unfusable for this commit - Hence, added Tensor3D to template writer arguments declaration, for sake of keeping dynamic fusion softmax componenets' kernels matching their cl counterparts. Resolves: COMPMID-5523 Change-Id: I667f39545db925f667036ef448302c79a0330373 Signed-off-by: Ramy Elgammal <ramy.elgammal@arm.com> Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/c/VisualCompute/ComputeLibrary/+/483924 Tested-by: bsgcomp <bsgcomp@arm.com> Reviewed-by: Gunes Bayir <gunes.bayir@arm.com> Comments-Addressed: bsgcomp <bsgcomp@arm.com> Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/8986 Comments-Addressed: Arm Jenkins <bsgcomp@arm.com> Reviewed-by: Jakub Sujak <jakub.sujak@arm.com> Tested-by: Arm Jenkins <bsgcomp@arm.com> Benchmark: Arm Jenkins <bsgcomp@arm.com>
Diffstat (limited to 'src/dynamic_fusion/sketch/gpu/components/cl/ClComponentLogits1DMaxShiftExpSum.cpp')
-rw-r--r--src/dynamic_fusion/sketch/gpu/components/cl/ClComponentLogits1DMaxShiftExpSum.cpp16
1 files changed, 6 insertions, 10 deletions
diff --git a/src/dynamic_fusion/sketch/gpu/components/cl/ClComponentLogits1DMaxShiftExpSum.cpp b/src/dynamic_fusion/sketch/gpu/components/cl/ClComponentLogits1DMaxShiftExpSum.cpp
index 8ab1853e84..279c77e227 100644
--- a/src/dynamic_fusion/sketch/gpu/components/cl/ClComponentLogits1DMaxShiftExpSum.cpp
+++ b/src/dynamic_fusion/sketch/gpu/components/cl/ClComponentLogits1DMaxShiftExpSum.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2022 Arm Limited.
+ * Copyright (c) 2022-2023 Arm Limited.
*
* SPDX-License-Identifier: MIT
*
@@ -27,9 +27,8 @@
#include "arm_compute/core/CL/CLHelpers.h"
#include "arm_compute/core/Validate.h"
#include "arm_compute/core/utils/misc/ShapeCalculator.h"
-#include "arm_compute/dynamic_fusion/sketch/attributes/DepthwiseConv2dAttributes.h"
+#include "arm_compute/dynamic_fusion/sketch/attributes/SoftmaxAttributes.h"
#include "src/core/CL/CLValidate.h"
-#include "src/dynamic_fusion/sketch/gpu/template_writer/cl/ClTemplateDepthwiseConv2d.h"
#include "src/dynamic_fusion/sketch/gpu/template_writer/cl/ClTemplateLogits1DMaxShiftExpSum.h"
namespace arm_compute
@@ -49,7 +48,9 @@ Status ClComponentLogits1DMaxShiftExpSum::validate(
const ITensorInfo *sum = tensors.get_const_tensor(TensorType::ACL_DST_0);
const ITensorInfo *dst = tensors.get_const_tensor(TensorType::ACL_DST_1);
- ARM_COMPUTE_RETURN_ERROR_ON_NULLPTR(src, sum, dst);
+ ARM_COMPUTE_RETURN_ERROR_ON_NULLPTR(src);
+ ARM_COMPUTE_RETURN_ERROR_ON_NULLPTR(sum);
+ ARM_COMPUTE_RETURN_ERROR_ON_NULLPTR(dst);
// 1. Check validity
// All tensor infos are initialized
@@ -61,11 +62,6 @@ Status ClComponentLogits1DMaxShiftExpSum::validate(
ARM_COMPUTE_RETURN_ERROR_ON_MISMATCHING_DATA_TYPES(src, dst, sum);
ARM_COMPUTE_RETURN_ERROR_ON_MISMATCHING_SHAPES(src, dst);
- const uint32_t src_dimensions = src->tensor_shape().num_dimensions();
- const uint32_t sum_dimensions = sum->tensor_shape().num_dimensions();
-
- ARM_COMPUTE_RETURN_ERROR_ON(src_dimensions != sum_dimensions + 1);
-
// Device requirements are met
ARM_COMPUTE_RETURN_ERROR_ON_F16_UNSUPPORTED(src);
@@ -94,4 +90,4 @@ const IGpuTemplateComponentWriter *ClComponentLogits1DMaxShiftExpSum::template_w
}
} // namespace dynamic_fusion
} // namespace experimental
-} // namespace arm_compute \ No newline at end of file
+} // namespace arm_compute