diff options
author | Cathal Corbett <cathal.corbett@arm.com> | 2022-12-20 18:25:40 +0000 |
---|---|---|
committer | Cathal Corbett <cathal.corbett@arm.com> | 2023-01-04 09:20:20 +0000 |
commit | 80f71a8953b9ebb1136e5fedd06bdb501d0eb3d6 (patch) | |
tree | 98684a467e3051fbc2799cae4182896f99770ada /src/armnn/Network.cpp | |
parent | 2ae3224c559dcd3033be1bfd41be08113048dc50 (diff) | |
download | armnn-80f71a8953b9ebb1136e5fedd06bdb501d0eb3d6.tar.gz |
IVGCVSW-7211 Fix float16 operators being wrongly unsupported with android-nn-driver.
* Not a concern with the delegate/parser as tflite builtin operators have
little float16 support
* Will also fix float16 workloads running on the support_library.
Signed-off-by: Cathal Corbett <cathal.corbett@arm.com>
Change-Id: Iec2033dbc8ece2140b188de1f193c344a68b9c36
Diffstat (limited to 'src/armnn/Network.cpp')
-rw-r--r-- | src/armnn/Network.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/armnn/Network.cpp b/src/armnn/Network.cpp index 4ac1c459d8..42388bfbd7 100644 --- a/src/armnn/Network.cpp +++ b/src/armnn/Network.cpp @@ -626,7 +626,14 @@ OptimizationResult AttemptBackendAssignment(BackendSettings& backendSettings, // need to set the compute device on the layer // before we can check if it is supported layer->SetBackendId(backend); - if (!IWorkloadFactory::IsLayerSupported(*layer, EmptyOptional(), reasonIfUnsupported)) + + // To run FP16 operations on CpuAcc we need at least v8.2 architecture. If the available architecture + // is older than v8.2, we can check if the operator is supported by changing operator inputs & outputs + // to be FP32 and inserting convert layers around the FP32 operator. + bool isLayerSupported = IWorkloadFactory::IsLayerSupported(*layer, EmptyOptional(), reasonIfUnsupported); + std::string checkStr = "This CPU architecture does not support F16 data type, you need v8.2 or above"; + if (!isLayerSupported || + reasonIfUnsupported.find(checkStr) != std::string::npos) { if (dataTypeIn == DataType::Float16 || dataTypeOut == DataType::Float16) { |