34 #include "tests/datasets/ShapeDatasets.h" 39 #include "tests/validation/fixtures/GEMMFixture.h" 71 constexpr
float abs_tolerance_f16(0.01f);
156 broadcast_bias_values),
160 bool validate_configuration(
unsigned int m_value,
unsigned int n_value,
unsigned int k_value,
unsigned int b_value,
161 unsigned int m0_value,
unsigned int n0_value,
unsigned int k0_value,
unsigned int h0_value,
162 bool i_value_rhs,
bool t_value_rhs,
bool export_to_cl_image,
bool broadcast_bias,
bool input_as_3d,
unsigned int depth_output_gemm3d,
const ActivationLayerInfo &act_info,
165 const unsigned int M = m_value;
166 const unsigned int N = n_value;
167 const unsigned int K = k_value;
170 lhs_info.
m0 = m0_value;
171 lhs_info.
k0 = k0_value;
174 rhs_info.
n0 = n0_value;
175 rhs_info.
k0 = k0_value;
176 rhs_info.
h0 = h0_value;
201 broadcast_bias? 1 : b_value);
211 return bool(gemm.
validate(&lhs, &rhs_reshaped, &bias, &dst, alpha, beta, lhs_info, rhs_info, kernel_info));
236 framework::dataset::
make("batch_size", { 1, 1, 1, 1, 1, 1, 2, 1, 1, 1 }),
237 framework::dataset::make(
"M0", { 4, 9, 4, 4, 4, 4, 4, 4, 4, 4 })),
238 framework::dataset::make(
"N0", { 4, 4, 18, 4, 4, 4, 4, 8, 2, 8 })),
239 framework::dataset::make(
"K0", { 4, 4, 4, 1, 4, 4, 4, 4, 4, 4 })),
240 framework::dataset::make(
"broadcast_bias", {
false,
false,
false,
false,
false,
true,
true,
false,
false,
false })),
241 framework::dataset::make(
"input_as_3d", { 0, 0, 0, 0, 1, 0, 1, 0, 0, 0 })),
242 framework::dataset::make(
"depth_output_gemm3d", { 0, 0, 0, 0, 0, 1, 0, 0, 0, 0 })),
243 framework::dataset::make(
"export_to_cl_image", {
false,
false,
false,
false,
false,
false,
false,
true,
true,
true })),
244 framework::dataset::make(
"data_type_input0", {
DataType::F32,
DataType::F32,
DataType::F32,
DataType::F32,
DataType::F32,
DataType::F32,
DataType::F32,
DataType::F32,
DataType::F32,
DataType::F16})),
245 framework::dataset::make(
"data_type_input1", {
DataType::F32,
DataType::F32,
DataType::F32,
DataType::F32,
DataType::F32,
DataType::F32,
DataType::F32,
DataType::F32,
DataType::F32,
DataType::F16})),
246 framework::dataset::make(
"data_type_input2", {
DataType::F32,
DataType::F32,
DataType::F32,
DataType::F32,
DataType::F32,
DataType::F32,
DataType::F32,
DataType::F32,
DataType::F32,
DataType::F16})),
247 framework::dataset::make(
"data_type_output", {
DataType::F16,
DataType::F32,
DataType::F32,
DataType::F32,
DataType::F32,
DataType::F32,
DataType::F32,
DataType::F32,
DataType::F32,
DataType::F16})),
248 framework::dataset::make(
"Beta", { 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f, 0.0f , 1.0f})),
249 framework::dataset::make(
"Expected", {
false,
false,
false,
false,
false,
false,
false,
true,
false,
true })),
250 b_value, m0_value, n0_value, k0_value, broadcast_bias, input_as_3d, depth_output_gemm3d, export_to_cl_image, dt_input0, dt_intpu1, dt_input2, dt_output, beta,
expected)
257 expected_value =
false;
260 bool status = validate_configuration(37, 51, 23, b_value, m0_value, n0_value, k0_value, 1,
false,
false, export_to_cl_image, broadcast_bias, input_as_3d, depth_output_gemm3d,
ActivationLayerInfo(), dt_input0, dt_intpu1, dt_input2, dt_output, 1.0f, beta);
269 framework::dataset::
make("
M", 3),
270 framework::dataset::
make("
N", 1)),
271 boundary_handling_cases))
289 boundary_handling_cases))
307 boundary_handling_cases))
325 boundary_handling_cases))
345 m0_values_precommit),
346 n0_values_precommit),
347 k0_values_precommit),
355 broadcast_bias_values),
386 broadcast_bias_values),
408 m0_values_precommit),
409 n0_values_precommit),
410 k0_values_precommit),
473 m0_values_precommit),
474 n0_values_precommit),
475 k0_values_precommit),
479 framework::dataset::
make("export_to_cl_image_rhs", true)),
483 broadcast_bias_values),
514 broadcast_bias_values),
536 m0_values_precommit),
537 n0_values_precommit),
538 k0_values_precommit),
bool broadcast_bias
Flag used to broadcast the bias addition.
static Status validate(Args &&... args)
Validate input arguments.
bool image2d_from_buffer_supported(const cl::Device &device)
Helper function to check whether the cl_khr_image2d_from_buffer extension is supported.
Descriptor used by the GEMM kernels.
unsigned int depth_output_gemm3d
Depth of the output tensor in case is reinterpreted as 3D.
TensorShape compute_mm_shape(const ITensorInfo &input0, const ITensorInfo &input1, bool is_interleaved_transposed, const GEMMReshapeInfo &reshape_info)
Calculate the matrix multiplication output shape of two tensors.
half_float::half half
16-bit floating point type
1 channel, 1 F32 per channel
ARM_COMPUTE_EXPECT(has_error==expected, framework::LogLevel::ERRORS)
unsigned int h0
Number of horizontal blocks of size (k0xn0) stored on the same output row.
static CLKernelLibrary & get()
Access the KernelLibrary singleton.
GEMM LHS (Left Hand Side) matrix information.
std::enable_if< is_container< T >::value, ContainerDataset< T > >::type make(std::string name, T &&values)
Helper function to create a ContainerDataset.
ActivationLayerInfo activation_info
Activation function to perform after the matrix multiplication.
Activation Layer Information class.
bool transpose
True if the (k0xn0) block has to be transposed before been stored.
bool export_to_cl_image
True if the reshaped rhs has to be exported to cl_image.
#define ARM_COMPUTE_TEST_INFO(INFO)
Copyright (c) 2017-2021 Arm Limited.
1 channel, 1 F16 per channel
unsigned int k0
Number of partial accumulations performed by the matrix multiplication.
unsigned int m
Number of LHS rows.
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)
unsigned int n
Number of RHS columns.
DatasetMode
Possible dataset modes.
GEMM RHS (Right Hand Side) matrix information.
TEST_SUITE_END() FIXTURE_DATA_TEST_CASE(RunSmall
[CLActivationLayer Test snippet]
GEMMMatrixMultiplyReshapedOnlyRHS3DValidationFixture< CLTensor, CLAccessor, T, CLGEMMReshapeRHSMatrix, CLGEMMMatrixMultiplyReshapedOnlyRHS > CLGEMMMatrixMultiplyReshapedOnlyRHS3DFixture
unsigned int n0
Number of columns processed by the matrix multiplication.
Accessor implementation for CLTensor objects.
CLSynthetizeFunction< CLGEMMReshapeRHSMatrixKernel > CLGEMMReshapeRHSMatrix
TensorShape compute_rhs_reshaped_shape(const ITensorInfo &a, const GEMMRHSMatrixInfo &rhs_info)
Calculate the Right Hand Side matrix reshaped shape.
bool reinterpret_input_as_3d
Flag used to reinterpret the input as 3D.
TEST_SUITE(U8_to_S8) FIXTURE_DATA_TEST_CASE(RunSmall
validate(CLAccessor(output_state), expected_output)
void ARM_COMPUTE_PRINT_INFO()
FIXTURE_DATA_TEST_CASE(RunSmall, CLAbsLayerFixture< half >, framework::DatasetMode::PRECOMMIT, combine(datasets::SmallShapes(), framework::dataset::make("DataType", DataType::F16)))
Upper Bounded Rectifier ( )
Class reprensenting a relative tolerance value.
unsigned int k
Number of LHS columns or RHS rows.
bool interleave
True if the h0 (k0xn0) blocks have to be interleaved in the output row.
Store the tensor's metadata.
unsigned int k0
Number of partial accumulations performed by the matrix multiplication.
unsigned int m0
Number of rows processed by the matrix multiplication.
GEMMMatrixMultiplyReshapedOnlyRHSValidationFixture< CLTensor, CLAccessor, T, CLGEMMReshapeRHSMatrix, CLGEMMMatrixMultiplyReshapedOnlyRHS > CLGEMMMatrixMultiplyReshapedOnlyRHSFixture
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}))
UniqueGemmCommon< Top, Tret > gemm(const GemmArgs &args, const OutputStage &os)
DataType
Available data types.
constexpr float abs_tolerance_f32(0.0001f)
F32 Absolute tolerance value for comparing reference's output against implementation's output for flo...
combine(datasets::SmallShapes(), framework::dataset::make("DataType", DataType::F32)))
const cl::Device & get_device()
Gets the CL device for which the programs are created.