From f2c022e54ae65467cca4bc698b5b94e5b3c62c47 Mon Sep 17 00:00:00 2001 From: cfRod Date: Fri, 5 Nov 2021 11:29:53 +0000 Subject: Enable fast_math in CpuFullyConnected ONCPUML-529 * Add support for passing fast_math for fullyconnected layers via fc_info. * Add support for passing fast_math to run ACL benchmark graphs. * Add validation test and accuracy tests (updated fixtures). Note: abs and rel. tolerance for fast math mode are set based on experimental data. Signed-off-by: cfRod change-Id: Ib107d6264d3ae5e36555334f39a13e678f8618df Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/6521 Reviewed-by: SiCong Li Reviewed-by: Gian Marco Iodice Tested-by: Arm Jenkins Comments-Addressed: Arm Jenkins --- arm_compute/graph/backends/FunctionHelpers.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'arm_compute/graph/backends/FunctionHelpers.h') diff --git a/arm_compute/graph/backends/FunctionHelpers.h b/arm_compute/graph/backends/FunctionHelpers.h index 6aec3f6590..55af056a43 100644 --- a/arm_compute/graph/backends/FunctionHelpers.h +++ b/arm_compute/graph/backends/FunctionHelpers.h @@ -1096,7 +1096,8 @@ std::unique_ptr create_fully_connected_layer(FullyConnectedLayerNode typename TargetInfo::TensorType *weights = get_backing_tensor(node.input(1)); typename TargetInfo::TensorType *biases = get_backing_tensor(node.input(2)); typename TargetInfo::TensorType *output = get_backing_tensor(node.output(0)); - const FullyConnectedLayerInfo fc_info = node.info(); + FullyConnectedLayerInfo fc_info = node.info(); + fc_info.enable_fast_math = (node.fast_math_hint() == FastMathHint::Enabled); ARM_COMPUTE_ERROR_ON(input == nullptr); ARM_COMPUTE_ERROR_ON(weights == nullptr); -- cgit v1.2.1