From 87cb761135387e19ae17c7af4e4020a12c63975a Mon Sep 17 00:00:00 2001 From: Kevin May Date: Mon, 11 Nov 2019 17:30:35 +0000 Subject: IVGCVSW-4115 Fix for armnn-driver-tests Capabilities failure * Add TensorQuant8SymmPerChannel to ArmnnDriverImpl::getCapabilities_1_2 * Add TensorQuant8Symm and TensorQuant8SymmPerChannel to Capabilities supported operands tests Signed-off-by: Kevin May Change-Id: Ifbc742c5562f243172d2f4e6a2f6a8f3b6a405ea --- 1.2/ArmnnDriverImpl.cpp | 13 +++++++++++++ test/1.2/Capabilities.cpp | 16 ++++++++++++---- 2 files changed, 25 insertions(+), 4 deletions(-) diff --git a/1.2/ArmnnDriverImpl.cpp b/1.2/ArmnnDriverImpl.cpp index 7309c2a1..6ea9bc43 100644 --- a/1.2/ArmnnDriverImpl.cpp +++ b/1.2/ArmnnDriverImpl.cpp @@ -43,6 +43,11 @@ const char *g_OperandTypeTensorQuant8SymmPerformanceExecTime = const char *g_OperandTypeTensorQuant8SymmPerformancePowerUsage = "Armnn.operandTypeTensorQuant8SymmPerformance.powerUsage"; +const char *g_OperandTypeTensorQuant8SymmPerChannelPerformanceExecTime = + "Armnn.operandTypeTensorQuant8SymmPerChannelPerformance.execTime"; +const char *g_OperandTypeTensorQuant8SymmPerChannelPerformancePowerUsage = + "Armnn.operandTypeTensorQuant8SymmPerChannelPerformance.powerUsage"; + const char *g_OperandTypeTensorInt32PerformanceExecTime = "Armnn.operandTypeTensorInt32Performance.execTime"; const char *g_OperandTypeTensorInt32PerformancePowerUsage = "Armnn.operandTypeTensorInt32Performance.powerUsage"; @@ -274,6 +279,14 @@ Return ArmnnDriverImpl::getCapabilities_1_2(const armnn::IRuntimePtr& runt .powerUsage = ParseSystemProperty(g_OperandTypeTensorQuant16SymmPerformancePowerUsage, defaultValue) }); + update(&capabilities.operandPerformance, OperandType::TENSOR_QUANT8_SYMM_PER_CHANNEL, + { + .execTime = + ParseSystemProperty(g_OperandTypeTensorQuant8SymmPerChannelPerformanceExecTime, defaultValue), + .powerUsage = + ParseSystemProperty(g_OperandTypeTensorQuant8SymmPerChannelPerformancePowerUsage, defaultValue) + }); + update(&capabilities.operandPerformance, OperandType::TENSOR_INT32, { .execTime = ParseSystemProperty(g_OperandTypeTensorInt32PerformanceExecTime, defaultValue), diff --git a/test/1.2/Capabilities.cpp b/test/1.2/Capabilities.cpp index 4424f9b0..8a769db2 100644 --- a/test/1.2/Capabilities.cpp +++ b/test/1.2/Capabilities.cpp @@ -50,6 +50,10 @@ struct CapabilitiesFixture __system_property_set("Armnn.operandTypeTensorInt32Performance.powerUsage", nullStr); __system_property_set("Armnn.operandTypeInt32Performance.execTime", nullStr); __system_property_set("Armnn.operandTypeInt32Performance.powerUsage", nullStr); + __system_property_set("Armnn.operandTypeTensorQuant8SymmPerformance.execTime", nullStr); + __system_property_set("Armnn.operandTypeTensorQuant8SymmPerformance.powerUsage", nullStr); + __system_property_set("Armnn.operandTypeTensorQuant8SymmPerChannelPerformance.execTime", nullStr); + __system_property_set("Armnn.operandTypeTensorQuant8SymmPerChannelPerformance.powerUsage", nullStr); } }; @@ -77,14 +81,14 @@ BOOST_AUTO_TEST_CASE(PerformanceCapabilitiesWithRuntime) CheckOperandType(capabilities, OperandType::TENSOR_QUANT16_SYMM, 3.0f, 3.1f); CheckOperandType(capabilities, OperandType::TENSOR_INT32, 3.2f, 3.3f); CheckOperandType(capabilities, OperandType::INT32, 3.4f, 3.5f); + CheckOperandType(capabilities, OperandType::TENSOR_QUANT8_SYMM, 2.8f, 2.9f); + CheckOperandType(capabilities, OperandType::TENSOR_QUANT8_SYMM_PER_CHANNEL, 2.8f, 2.9f); // Unsupported operands take FLT_MAX value CheckOperandType(capabilities, OperandType::UINT32, FLT_MAX, FLT_MAX); CheckOperandType(capabilities, OperandType::BOOL, FLT_MAX, FLT_MAX); - CheckOperandType(capabilities, OperandType::TENSOR_QUANT8_SYMM, FLT_MAX, FLT_MAX); CheckOperandType(capabilities, OperandType::TENSOR_QUANT16_ASYMM, FLT_MAX, FLT_MAX); CheckOperandType(capabilities, OperandType::TENSOR_BOOL8, FLT_MAX, FLT_MAX); - CheckOperandType(capabilities, OperandType::TENSOR_QUANT8_SYMM_PER_CHANNEL, FLT_MAX, FLT_MAX); CheckOperandType(capabilities, OperandType::OEM, FLT_MAX, FLT_MAX); CheckOperandType(capabilities, OperandType::TENSOR_OEM_BYTE, FLT_MAX, FLT_MAX); @@ -107,6 +111,10 @@ BOOST_AUTO_TEST_CASE(PerformanceCapabilitiesWithRuntime) __system_property_set("Armnn.operandTypeTensorInt32Performance.powerUsage", "3.3f"); __system_property_set("Armnn.operandTypeInt32Performance.execTime", "3.4f"); __system_property_set("Armnn.operandTypeInt32Performance.powerUsage", "3.5f"); + __system_property_set("Armnn.operandTypeTensorQuant8SymmPerformance.execTime", "2.8f"); + __system_property_set("Armnn.operandTypeTensorQuant8SymmPerformance.powerUsage", "2.9f"); + __system_property_set("Armnn.operandTypeTensorQuant8SymmPerChannelPerformance.execTime", "2.8f"); + __system_property_set("Armnn.operandTypeTensorQuant8SymmPerChannelPerformance.powerUsage", "2.9f"); armnn::IRuntime::CreationOptions options; armnn::IRuntimePtr runtime(armnn::IRuntime::Create(options)); @@ -131,14 +139,14 @@ BOOST_AUTO_TEST_CASE(PerformanceCapabilitiesUndefined) CheckOperandType(capabilities, OperandType::TENSOR_QUANT16_SYMM, defaultValue, defaultValue); CheckOperandType(capabilities, OperandType::TENSOR_INT32, defaultValue, defaultValue); CheckOperandType(capabilities, OperandType::INT32, defaultValue, defaultValue); + CheckOperandType(capabilities, OperandType::TENSOR_QUANT8_SYMM_PER_CHANNEL, defaultValue, defaultValue); + CheckOperandType(capabilities, OperandType::TENSOR_QUANT8_SYMM, defaultValue, defaultValue); // Unsupported operands take FLT_MAX value CheckOperandType(capabilities, OperandType::UINT32, FLT_MAX, FLT_MAX); CheckOperandType(capabilities, OperandType::BOOL, FLT_MAX, FLT_MAX); - CheckOperandType(capabilities, OperandType::TENSOR_QUANT8_SYMM, FLT_MAX, FLT_MAX); CheckOperandType(capabilities, OperandType::TENSOR_QUANT16_ASYMM, FLT_MAX, FLT_MAX); CheckOperandType(capabilities, OperandType::TENSOR_BOOL8, FLT_MAX, FLT_MAX); - CheckOperandType(capabilities, OperandType::TENSOR_QUANT8_SYMM_PER_CHANNEL, FLT_MAX, FLT_MAX); CheckOperandType(capabilities, OperandType::OEM, FLT_MAX, FLT_MAX); CheckOperandType(capabilities, OperandType::TENSOR_OEM_BYTE, FLT_MAX, FLT_MAX); -- cgit v1.2.1