diff options
author | Gian Marco Iodice <gianmarco.iodice@arm.com> | 2020-11-02 15:43:57 +0000 |
---|---|---|
committer | Georgios Pinitas <georgios.pinitas@arm.com> | 2020-11-03 12:55:19 +0000 |
commit | 491f30c0fff416007d97f4a5a043923861ef7b64 (patch) | |
tree | 62fa694cf1f4936380288bbf5b606a7e93b9bd9e /src/core/CL/gemm/reshaped/CLGEMMReshapedKernelConfigurationValhall.cpp | |
parent | 488f508056a2ce971cec201ebda1c7b5b11bf253 (diff) | |
download | ComputeLibrary-491f30c0fff416007d97f4a5a043923861ef7b64.tar.gz |
COMPMID-3939: Update GEMM heuristic Mali-G77
- Update heuristic for GEMM reshaped RHS only
- Fix left-over block size in CLGEMMMatrixMultiplyReshapedOlyRHSKernel
Change-Id: I34c738821ed2e4a537da4a15058eec164cb6b61f
Signed-off-by: Gian Marco Iodice <gianmarco.iodice@arm.com>
Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/4305
Tested-by: Arm Jenkins <bsgcomp@arm.com>
Reviewed-by: Georgios Pinitas <georgios.pinitas@arm.com>
Comments-Addressed: Arm Jenkins <bsgcomp@arm.com>
Diffstat (limited to 'src/core/CL/gemm/reshaped/CLGEMMReshapedKernelConfigurationValhall.cpp')
-rw-r--r-- | src/core/CL/gemm/reshaped/CLGEMMReshapedKernelConfigurationValhall.cpp | 81 |
1 files changed, 78 insertions, 3 deletions
diff --git a/src/core/CL/gemm/reshaped/CLGEMMReshapedKernelConfigurationValhall.cpp b/src/core/CL/gemm/reshaped/CLGEMMReshapedKernelConfigurationValhall.cpp index 519e903a5a..3f82dcab00 100644 --- a/src/core/CL/gemm/reshaped/CLGEMMReshapedKernelConfigurationValhall.cpp +++ b/src/core/CL/gemm/reshaped/CLGEMMReshapedKernelConfigurationValhall.cpp @@ -90,13 +90,88 @@ std::pair<GEMMLHSMatrixInfo, GEMMRHSMatrixInfo> CLGEMMReshapedKernelConfiguratio ARM_COMPUTE_UNUSED(k); ARM_COMPUTE_UNUSED(b); - if(n <= 4) + const float r_mn = static_cast<float>(m) / static_cast<float>(n); + const float workload = (static_cast<float>(m) * static_cast<float>(n) * static_cast<float>(b)) / 20.0f; + const float r_mk = static_cast<float>(m) / static_cast<float>(k); + const float r_nk = static_cast<float>(n) / static_cast<float>(k); + + if(r_mk <= 0.11824845522642136) { - return configure_lhs_rhs_info(m, n, 4, 2, 8, 8, 2, true, true, true, false); + if(workload <= 880.0) + { + return configure_lhs_rhs_info(m, n, 2, 4, 4, 1, 4, false, false, true, false, false); + } + else + { + if(r_nk <= 0.42521367967128754) + { + if(workload <= 1726.4000244140625) + { + return configure_lhs_rhs_info(m, n, 4, 4, 4, 2, 2, false, false, true, false, false); + } + else + { + return configure_lhs_rhs_info(m, n, 4, 4, 4, 2, 1, false, true, true, false, true); + } + } + else + { + if(workload <= 1241.6000366210938) + { + return configure_lhs_rhs_info(m, n, 2, 4, 4, 1, 4, false, false, true, false, false); + } + else + { + return configure_lhs_rhs_info(m, n, 4, 4, 4, 4, 4, false, false, true, false, false); + } + } + } } else { - return configure_lhs_rhs_info(m, n, 4, 8, 4, 4, 2, true, true, true, false); + if(workload <= 11404.7998046875) + { + if(r_mk <= 1.0126488208770752) + { + if(r_mn <= 2.545312523841858) + { + return configure_lhs_rhs_info(m, n, 4, 4, 4, 2, 1, false, true, true, false, true); + } + else + { + return configure_lhs_rhs_info(m, n, 2, 4, 4, 1, 4, false, false, true, false, false); + } + } + else + { + if(workload <= 2881.199951171875) + { + return configure_lhs_rhs_info(m, n, 4, 4, 4, 4, 2, false, false, true, false, true); + } + else + { + return configure_lhs_rhs_info(m, n, 4, 4, 4, 2, 1, false, true, true, false, true); + } + } + } + else + { + if(r_nk <= 0.5765306055545807) + { + if(r_mn <= 6.010416746139526) + { + return configure_lhs_rhs_info(m, n, 4, 4, 4, 2, 1, false, true, true, false, true); + } + else + { + return configure_lhs_rhs_info(m, n, 4, 4, 4, 2, 1, true, false, true, false, true); + } + } + else + { + return configure_lhs_rhs_info(m, n, 4, 4, 4, 2, 1, true, false, true, false, true); + } + } } } |