From ca62c6f53eb7244e6fed9f7e932608aa2496d9eb Mon Sep 17 00:00:00 2001 From: Manuel Bottini Date: Tue, 23 Mar 2021 11:50:34 +0000 Subject: Mixed data-layout testing on high priority operators Change data layouts after the configure in validation tests for: - Scale - Pooling - FullyConnected - DepthwiseConvolution - DirectConvolution - FFTConvolution - WinogradConvolution - GEMMConvolution (Indirect GEMM included) Extending fixtures Fixes for new mixed data layout tests Resolves: COMPMID-4162 Change-Id: I2f2eb2075f7e24ab3872249d88cadb57b82c5dde Signed-off-by: Manuel Bottini Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/5326 Comments-Addressed: Arm Jenkins Tested-by: Arm Jenkins Reviewed-by: Georgios Pinitas --- tests/validation/NEON/FullyConnectedLayer.cpp | 55 +++++++++++++++++++++++---- 1 file changed, 48 insertions(+), 7 deletions(-) (limited to 'tests/validation/NEON/FullyConnectedLayer.cpp') diff --git a/tests/validation/NEON/FullyConnectedLayer.cpp b/tests/validation/NEON/FullyConnectedLayer.cpp index d8c2203802..4bb48bf42c 100644 --- a/tests/validation/NEON/FullyConnectedLayer.cpp +++ b/tests/validation/NEON/FullyConnectedLayer.cpp @@ -143,6 +143,8 @@ DATA_TEST_CASE(Validate, framework::DatasetMode::ALL, zip(zip(zip(zip(zip(zip( template using NEFullyConnectedLayerFixture = FullyConnectedLayerValidationFixture; +template +using NEFullyConnectedLayerMixedDataLayoutFixture = FullyConnectedLayerValidationFixture; TEST_SUITE(Float) #ifdef __ARM_FEATURE_FP16_VECTOR_ARITHMETIC @@ -183,6 +185,18 @@ FIXTURE_DATA_TEST_CASE(RunSmall, NEFullyConnectedLayerFixture, framework: // Validate output validate(Accessor(_target), _reference, rel_tolerance_f32, 0, abs_tolerance_f32); } +FIXTURE_DATA_TEST_CASE(RunMixedDataLayout, NEFullyConnectedLayerMixedDataLayoutFixture, framework::DatasetMode::PRECOMMIT, combine(combine(combine(combine(combine(combine( + framework::dataset::make("Input", TensorShape(9U, 5U, 7U)), + framework::dataset::make("Weights", TensorShape(315U, 271U))), + framework::dataset::make("Biases", TensorShape(271U))), + framework::dataset::make("Output", TensorShape(271U))), + FullyConnectedParameters), + framework::dataset::make("DataType", DataType::F32)), + framework::dataset::make("ActivationInfo", ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU)))) +{ + // Validate output + validate(Accessor(_target), _reference, rel_tolerance_f32, 0, abs_tolerance_f32); +} FIXTURE_DATA_TEST_CASE(RunWithActivation, NEFullyConnectedLayerFixture, framework::DatasetMode::PRECOMMIT, combine(combine( combine(datasets::FullyConnectedLayerWithActivationDataset(), FullyConnectedParameters), @@ -204,6 +218,8 @@ TEST_SUITE_END() template using NEFullyConnectedLayerQuantizedFixture = FullyConnectedLayerValidationQuantizedFixture; +template +using NEFullyConnectedLayerQuantizedMixedDataLayoutFixture = FullyConnectedLayerValidationQuantizedFixture; TEST_SUITE(Quantized) TEST_SUITE(QASYMM8) @@ -217,7 +233,20 @@ FIXTURE_DATA_TEST_CASE(RunSmall, NEFullyConnectedLayerQuantizedFixture, // Validate output validate(Accessor(_target), _reference, tolerance_qasymm8); } - +FIXTURE_DATA_TEST_CASE(RunMixedDataLayout, NEFullyConnectedLayerQuantizedMixedDataLayoutFixture, framework::DatasetMode::PRECOMMIT, + combine(combine(combine(combine(combine(combine(combine( + framework::dataset::make("Input", TensorShape(9U, 5U, 7U)), + framework::dataset::make("Weights", TensorShape(315U, 271U))), + framework::dataset::make("Biases", TensorShape(271U))), + framework::dataset::make("Output", TensorShape(271U))), + FullyConnectedParameters), + framework::dataset::make("DataType", DataType::QASYMM8)), + QuantizationData), + framework::dataset::make("ActivationInfo", ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU)))) +{ + // Validate output + validate(Accessor(_target), _reference, tolerance_qasymm8); +} FIXTURE_DATA_TEST_CASE(RunWithActivation, NEFullyConnectedLayerQuantizedFixture, framework::DatasetMode::PRECOMMIT, combine(combine(combine( combine(datasets::FullyConnectedLayerWithActivationDataset(), FullyConnectedParameters), @@ -251,7 +280,20 @@ FIXTURE_DATA_TEST_CASE(RunSmall, NEFullyConnectedLayerQuantizedFixture, // Validate output validate(Accessor(_target), _reference, tolerance_qasymm8_signed); } - +FIXTURE_DATA_TEST_CASE(RunMixedDataLayout, NEFullyConnectedLayerQuantizedMixedDataLayoutFixture, framework::DatasetMode::PRECOMMIT, + combine(combine(combine(combine(combine(combine(combine( + framework::dataset::make("Input", TensorShape(9U, 5U, 7U)), + framework::dataset::make("Weights", TensorShape(315U, 271U))), + framework::dataset::make("Biases", TensorShape(271U))), + framework::dataset::make("Output", TensorShape(271U))), + FullyConnectedParameters), + framework::dataset::make("DataType", DataType::QASYMM8_SIGNED)), + QuantizationData), + framework::dataset::make("ActivationInfo", ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU)))) +{ + // Validate output + validate(Accessor(_target), _reference, tolerance_qasymm8); +} FIXTURE_DATA_TEST_CASE(RunWithActivation, NEFullyConnectedLayerQuantizedFixture, framework::DatasetMode::PRECOMMIT, combine(combine(combine( combine(datasets::FullyConnectedLayerWithActivationDataset(), FullyConnectedParameters), @@ -262,11 +304,10 @@ FIXTURE_DATA_TEST_CASE(RunWithActivation, NEFullyConnectedLayerQuantizedFixture< // Validate output validate(Accessor(_target), _reference, tolerance_qasymm8_signed); } -TEST_SUITE_END() -TEST_SUITE_END() - -TEST_SUITE_END() -TEST_SUITE_END() +TEST_SUITE_END() // QASYMM8_SIGNED +TEST_SUITE_END() // Quantized +TEST_SUITE_END() // FullyConnectedLayer +TEST_SUITE_END() // NEON } // namespace validation } // namespace test } // namespace arm_compute -- cgit v1.2.1