From 6f8b17dedb7b53b550e6210fd1c78c3a3e086271 Mon Sep 17 00:00:00 2001 From: Joseph Dobson Date: Tue, 11 Feb 2020 19:32:11 +0000 Subject: [ONCPUML-7] arm_compute support for ND parallelism Currently 1D ranges of work are specified by the scheduler via two integers, start and end. This limit opportunities for advance parallelism and scheduling This patch expands the interfaces to allow for ND parallism. `GemmCommon::get_window_size` now returns an `NDRange` specifying the work in N-dimensions rather than with the single integer it used prior (1D) Execute now takes an `NDCoordinate` which specifies an `NDRange` with a start position for that work along with an `NDCoordinate` to specify the thread location In addition to expanding the interface to enable this functionality, we have added the capability to SGEMM when the number of threads is high this has the effective of allowing a much greater degree of parallelism where te problem dimension would previously have limited the number of threads. Change-Id: I3e1a8b7276216627bec4ff6f24ac2147552ea9fb Signed-off-by: Joseph Dobson Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/2962 Tested-by: Arm Jenkins Reviewed-by: Gian Marco Iodice Comments-Addressed: Arm Jenkins --- src/core/NEON/kernels/arm_gemm/gemm_fp32.cpp | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) (limited to 'src/core/NEON/kernels/arm_gemm/gemm_fp32.cpp') diff --git a/src/core/NEON/kernels/arm_gemm/gemm_fp32.cpp b/src/core/NEON/kernels/arm_gemm/gemm_fp32.cpp index 96e3ce832c..e3355ed2d5 100644 --- a/src/core/NEON/kernels/arm_gemm/gemm_fp32.cpp +++ b/src/core/NEON/kernels/arm_gemm/gemm_fp32.cpp @@ -26,6 +26,8 @@ #include "gemm_hybrid.hpp" #include "gemm_implementation.hpp" #include "gemm_interleaved.hpp" +#include "gemm_interleaved_2d.hpp" +#include "gemm_interleaved_pretransposed_2d.hpp" #include "gemm_native.hpp" #include "gemv_batched.hpp" #include "gemv_native_transposed.hpp" @@ -144,13 +146,31 @@ static const GemmImplementation gemm_fp32_methods[] = [](const GemmArgs &args) { return new GemmInterleaved(args); } }, #endif // __ARM_FEATURE_SVE +//Pretranpose, 2D split +{ + GemmMethod::GEMM_INTERLEAVED_2D, + "sgemm_12x8", + [](const GemmArgs &args) { return args._pretransposed_hint; }, + [](const GemmArgs &args) { return args._pretransposed_hint; }, + [](const GemmArgs &args) { return new GemmInterleavedPretransposed2d(args); } +}, +//Tranpose, 2D split, no blockmanager +{ + GemmMethod::GEMM_INTERLEAVED_2D, + "sgemm_12x8", + [](const GemmArgs &args) { return (!args._pretransposed_hint) && args._maxthreads >= 8; }, + [](const GemmArgs &args) { return (!args._pretransposed_hint) && args._maxthreads >= 8; }, + [](const GemmArgs &args) { return new GemmInterleaved2d(args); } +}, +//Tranpose, 1D split, with blockmanager { GemmMethod::GEMM_INTERLEAVED, "sgemm_12x8", - nullptr, - nullptr, + [](const GemmArgs &args) { return (!args._pretransposed_hint); }, + [](const GemmArgs &args) { return (!args._pretransposed_hint); }, [](const GemmArgs &args) { return new GemmInterleaved(args); } }, + #endif // __aarch64__ #ifdef __arm__ -- cgit v1.2.1