diff options
author | Gunes Bayir <gunes.bayir@arm.com> | 2024-02-08 12:20:06 +0000 |
---|---|---|
committer | Gunes Bayir <gunes.bayir@arm.com> | 2024-02-08 15:05:55 +0000 |
commit | a3e1b50588b89a2c0c67da2679728a422fc16402 (patch) | |
tree | ef0f87cf140ee68af17135a9f5eafb0dc856d11c /src/dynamic_fusion | |
parent | a5a81aec922f0d4c30a676098ae83f3bb73a75a6 (diff) | |
download | ComputeLibrary-a3e1b50588b89a2c0c67da2679728a422fc16402.tar.gz |
Fix the bug in GpuTanh operator in dynamic fusion
Tanh in dynamic fusion is a simple operator with no A and B coefficients, as its public interface implies. Tanh operator follows the TOSA specification.
Customization of tanh calculation with a and b can be achieved via fusion as below:
out = a * tanh(b *in) -->
x = b * in
y = tanh(x)
out = a * y;
Resolves: COMPMID-6873
Signed-off-by: Gunes Bayir <gunes.bayir@arm.com>
Change-Id: I818765192f631ae82c2094b0fc376fb87bae4fa4
Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/11109
Benchmark: Arm Jenkins <bsgcomp@arm.com>
Tested-by: Arm Jenkins <bsgcomp@arm.com>
Reviewed-by: Gian Marco Iodice <gianmarco.iodice@arm.com>
Comments-Addressed: Arm Jenkins <bsgcomp@arm.com>
Diffstat (limited to 'src/dynamic_fusion')
-rw-r--r-- | src/dynamic_fusion/sketch/gpu/ckw_driver/components/GpuCkwActivation.cpp | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/src/dynamic_fusion/sketch/gpu/ckw_driver/components/GpuCkwActivation.cpp b/src/dynamic_fusion/sketch/gpu/ckw_driver/components/GpuCkwActivation.cpp index 68f478a7ce..18fda5bd6b 100644 --- a/src/dynamic_fusion/sketch/gpu/ckw_driver/components/GpuCkwActivation.cpp +++ b/src/dynamic_fusion/sketch/gpu/ckw_driver/components/GpuCkwActivation.cpp @@ -242,12 +242,7 @@ void GpuCkwActivation::write_component_code(const ComponentGroup &comp_group, } case ActivationLayerInfo::ActivationFunction::TANH: { - // dst = B_VAL * src - writer->op_binary(tile_dst, ckw::BinaryOp::Mul, tile_src, const_B_fp); - // dst = tanh(B_VAL * src) - writer->op_unary(tile_dst, ckw::UnaryOp::Tanh, tile_dst); - // dst = A_VAL * tanh(B_VAL * src) - writer->op_binary(tile_dst, ckw::BinaryOp::Mul, tile_dst, const_A_fp); + writer->op_unary(tile_dst, ckw::UnaryOp::Tanh, tile_src); break; } case ActivationLayerInfo::ActivationFunction::RELU: |