34 #include "tests/datasets/LargeGEMMDataset.h" 35 #include "tests/datasets/SmallGEMMDataset.h" 36 #include "tests/datasets/TinyGEMMDataset.h" 41 #include "tests/validation/fixtures/GEMMFixture.h" 42 #include "tests/validation/fixtures/GEMMInterleave4x4Fixture.h" 43 #include "tests/validation/fixtures/GEMMTranspose1xWFixture.h" 53 constexpr AbsoluteTolerance<float> tolerance_f(0.001f);
54 #ifdef __ARM_FEATURE_FP16_VECTOR_ARITHMETIC 55 RelativeTolerance<half_float::half> rel_tolerance_f16(
half(0.2));
56 const AbsoluteTolerance<float> abs_tolerance_f16(0.2f);
57 constexpr
float tolerance_num = 0.07f;
62 #ifdef __ARM_FEATURE_FP16_VECTOR_ARITHMETIC 72 template <
typename FunctionType>
73 bool validate_zero_padding(
unsigned int dim0_value,
unsigned int dim1_value)
75 const TensorShape in_shape(dim0_value, dim1_value);
86 func.configure(&in, &dst);
88 return in.info()->padding().empty();
92 bool validate_gemm_zero_padding(
const TensorShape shape0,
const TensorShape shape1)
100 NEGEMMMatrixMultiplyKernel
gemm;
101 gemm.configure(&in0, &in1, &dst, 1.0,
false);
103 return in0.info()->padding().empty() && in1.info()->padding().empty() && dst.info()->padding().empty();
113 framework::dataset::
make("
N", { 1, 23, 63, 101 }),
117 bool status = validate_zero_padding<NEGEMMTranspose1xWKernel>(n_value, k_value);
126 validate(Accessor(_target), _reference);
158 bool status = validate_zero_padding<NEGEMMInterleave4x4Kernel>(m_value, k_value);
167 validate(Accessor(_target), _reference);
193 template <
typename T>
194 using NEGEMMFixture = GEMMValidationFixture<Tensor, Accessor, NEGEMM, T>;
196 template <
typename T>
216 bool status = validate_gemm_zero_padding(shape0, shape1);
220 #ifdef __ARM_FEATURE_FP16_VECTOR_ARITHMETIC 227 validate(
Accessor(_target), _reference, rel_tolerance_f16, tolerance_num, abs_tolerance_f16);
235 validate(
Accessor(_target), _reference, rel_tolerance_f16, tolerance_num, abs_tolerance_f16);
242 framework::dataset::
make("ReshapeWeights", {
true,
false })),
259 framework::dataset::
make("ReshapeWeights", {
true,
false })),
As above but this also setups a Zero border on the input tensor of the specified bordersize.
1 channel, 1 U8 per channel
half_float::half half
16-bit floating point type
1 channel, 1 F32 per channel
ARM_COMPUTE_EXPECT(has_error==expected, framework::LogLevel::ERRORS)
1 channel, 1 U16 per channel
std::enable_if< is_container< T >::value, ContainerDataset< T > >::type make(std::string name, T &&values)
Helper function to create a ContainerDataset.
GEMMValidationFixture< Tensor, Accessor, NEGEMM, T, true > NEGEMMFixtureDisabledC
GEMMInterleave4x4ValidationFixture< Tensor, Accessor, NEGEMMInterleave4x4, uint32_t > NEGEMMInterleave4x4Fixture
template SimpleTensor< half > gemm(const SimpleTensor< half > &a, const SimpleTensor< half > &b, const SimpleTensor< half > &c, float alpha, float beta)
Copyright (c) 2017-2021 Arm Limited.
1 channel, 1 F16 per channel
DATA_TEST_CASE(Validate, framework::DatasetMode::ALL, zip(zip(zip(framework::dataset::make("InputInfo", { TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32), TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32), TensorInfo(TensorShape(32U, 13U, 2U), 1, DataType::F32), TensorInfo(TensorShape(32U, 13U, 2U), 1, DataType::QASYMM8), TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::QASYMM8), TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32), TensorInfo(TensorShape(32U, 13U, 2U), 1, DataType::QSYMM16), TensorInfo(TensorShape(32U, 13U, 2U), 1, DataType::QSYMM16), TensorInfo(TensorShape(32U, 13U, 2U), 1, DataType::QSYMM16), }), framework::dataset::make("OutputInfo",{ TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F16), TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32), TensorInfo(TensorShape(32U, 13U, 2U), 1, DataType::F32), TensorInfo(TensorShape(32U, 13U, 2U), 1, DataType::QASYMM8), TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::QASYMM8), TensorInfo(TensorShape(30U, 11U, 2U), 1, DataType::F32), TensorInfo(TensorShape(32U, 13U, 2U), 1, DataType::QSYMM16, QuantizationInfo(1.f/32768.f, 0)), TensorInfo(TensorShape(32U, 13U, 2U), 1, DataType::QSYMM16, QuantizationInfo(1.f/32768.f, 0)), TensorInfo(TensorShape(32U, 13U, 2U), 1, DataType::QSYMM16, QuantizationInfo(1.f/32768.f, 0)), })), framework::dataset::make("ActivationInfo", { ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU), ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU), ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU), ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::LU_BOUNDED_RELU), ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::TANH), ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU), ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::TANH), ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::LOGISTIC), ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::SQRT), })), framework::dataset::make("Expected", { false, true, true, true, false, false, true, true, false })), input_info, output_info, act_info, expected)
Accessor implementation for Tensor objects.
DatasetMode
Possible dataset modes.
GEMMTranspose1xWValidationFixture< Tensor, Accessor, NEGEMMTranspose1xW, uint32_t > NEGEMMTranspose1xWFixture
1 channel, 1 U32 per channel
TEST_SUITE_END() FIXTURE_DATA_TEST_CASE(RunSmall
[CLActivationLayer Test snippet]
quantized, asymmetric fixed-point 8-bit number unsigned
Neon kernel which transposes the elements of a matrix in chunks of 1xW, where W is equal to (16 / ele...
Basic implementation of the tensor interface.
TEST_SUITE(U8_to_S8) FIXTURE_DATA_TEST_CASE(RunSmall
validate(CLAccessor(output_state), expected_output)
FIXTURE_DATA_TEST_CASE(RunSmall, CLAbsLayerFixture< half >, framework::DatasetMode::PRECOMMIT, combine(datasets::SmallShapes(), framework::dataset::make("DataType", DataType::F16)))
zip(zip(framework::dataset::make("Weights", { TensorInfo(TensorShape(32U, 13U, 2U, 2U), 1, DataType::F32), TensorInfo(TensorShape(32U, 13U, 2U, 2U), 1, DataType::F32), TensorInfo(TensorShape(32U, 13U, 2U, 1U), 1, DataType::F32), }), framework::dataset::make("MVBGInfo",{ TensorInfo(TensorShape(2U), 1, DataType::F32), TensorInfo(TensorShape(2U), 1, DataType::F16), TensorInfo(TensorShape(5U), 1, DataType::F32), })), framework::dataset::make("Expected", { true, false, false}))
DataType
Available data types.
combine(datasets::SmallShapes(), framework::dataset::make("DataType", DataType::F32)))