diff options
author | Georgios Pinitas <georgios.pinitas@arm.com> | 2021-07-16 16:16:43 +0100 |
---|---|---|
committer | Georgios Pinitas <georgios.pinitas@arm.com> | 2021-07-22 02:25:50 +0000 |
commit | 4ee8b1599dbaf7634d25607fa5ac96ba3dc6b0f2 (patch) | |
tree | 2f8362d33cdad4212f4b96995681c68184c759e1 /src/core/NEON/kernels/arm_gemm/kernels/a64_hybrid_bf16fp32_dot_6x16.hpp | |
parent | 59fd7a722e5bc7e85309d6200bc37a772721a719 (diff) | |
download | ComputeLibrary-4ee8b1599dbaf7634d25607fa5ac96ba3dc6b0f2.tar.gz |
Update GEMM assembly kernels
- Introduce Fp32 kernels with internal calculations in Bfloat16 when
fast_mode is enabled
- Improve kernel selection heuristics
Signed-off-by: Georgios Pinitas <georgios.pinitas@arm.com>
Change-Id: I68a9e7e862b6fd2721b46e0d7cc791091c4ab279
Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/5965
Tested-by: Arm Jenkins <bsgcomp@arm.com>
Comments-Addressed: Arm Jenkins <bsgcomp@arm.com>
Diffstat (limited to 'src/core/NEON/kernels/arm_gemm/kernels/a64_hybrid_bf16fp32_dot_6x16.hpp')
-rw-r--r-- | src/core/NEON/kernels/arm_gemm/kernels/a64_hybrid_bf16fp32_dot_6x16.hpp | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/src/core/NEON/kernels/arm_gemm/kernels/a64_hybrid_bf16fp32_dot_6x16.hpp b/src/core/NEON/kernels/arm_gemm/kernels/a64_hybrid_bf16fp32_dot_6x16.hpp index fca96f6028..3b8770e153 100644 --- a/src/core/NEON/kernels/arm_gemm/kernels/a64_hybrid_bf16fp32_dot_6x16.hpp +++ b/src/core/NEON/kernels/arm_gemm/kernels/a64_hybrid_bf16fp32_dot_6x16.hpp @@ -22,10 +22,11 @@ * IN THE SOFTWARE. */ #pragma once -#ifdef __aarch64__ +#ifdef __aarch64__ #include "../std_transforms_fixed.hpp" #include "../bfloat.hpp" +#include "../performance_parameters.hpp" #define ARGLIST \ unsigned int, const unsigned int *, \ @@ -43,7 +44,8 @@ void a64_hybrid_bf16fp32_dot_6x16( ARGLIST ); class cls_a64_hybrid_bf16fp32_dot_6x16 { public: - typedef bfloat16 operand_type; + typedef bfloat16 lhs_operand_type; + typedef bfloat16 rhs_operand_type; typedef float result_type; typedef void (*kern_type)( ARGLIST ); @@ -69,7 +71,23 @@ public: return true; } - StdTransformsFixed<operand_type, result_type, 6, 16, 2> transforms = {}; + StdTransformsFixed<rhs_operand_type, result_type, 6, 16, 2> transforms = {}; + template<typename T> + static inline PerformanceParameters get_performance_parameters(const CPUInfo *ci) + { + if (std::is_same<T, bfloat16>::value) { + switch (ci->get_cpu_model()) { + default: + return { 15.83 }; + case CPUModel::A510: + return { 7.28 }; + case CPUModel::V1: + return { 27.34 }; + } + } + + return { 1.0 }; + } // Default to the generic kernel kern_type kernel=a64_hybrid_bf16fp32_dot_6x16; @@ -81,4 +99,5 @@ public: } // namespace arm_gemm #undef ARGLIST + #endif // __aarch64__ |