blob: 5eb33658ff15cb3ef7fc1a2b8c72158b9b2c9b20 [file] [log] [blame]
Moritz Pflanzeree493ae2017-07-05 10:52:21 +01001/*
Georgios Pinitas51a67302018-01-17 12:55:26 +00002 * Copyright (c) 2017-2018 ARM Limited.
Moritz Pflanzeree493ae2017-07-05 10:52:21 +01003 *
4 * SPDX-License-Identifier: MIT
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a copy
7 * of this software and associated documentation files (the "Software"), to
8 * deal in the Software without restriction, including without limitation the
9 * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
10 * sell copies of the Software, and to permit persons to whom the Software is
11 * furnished to do so, subject to the following conditions:
12 *
13 * The above copyright notice and this permission notice shall be included in all
14 * copies or substantial portions of the Software.
15 *
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 * SOFTWARE.
23 */
24#include "arm_compute/core/TensorShape.h"
25#include "arm_compute/core/Types.h"
26#include "arm_compute/runtime/CL/CLTensor.h"
27#include "arm_compute/runtime/CL/CLTensorAllocator.h"
Gian Marco Iodice2bc74412018-03-01 16:32:10 +000028#include "arm_compute/runtime/CL/functions/CLGEMMConvolutionLayer.h"
Vidhya Sudhan Loganathanb34690b2018-04-19 14:22:16 +010029#include "arm_compute/runtime/CL/functions/CLWinogradConvolutionLayer.h"
Moritz Pflanzeree493ae2017-07-05 10:52:21 +010030#include "tests/CL/CLAccessor.h"
Moritz Pflanzera09de0c2017-09-01 20:41:12 +010031#include "tests/benchmark/fixtures/ConvolutionLayerFixture.h"
Georgios Pinitas9fb11592018-04-26 20:34:58 +010032#include "tests/benchmark/fixtures/WinogradConvolutionLayerFixture.h"
Moritz Pflanzera09de0c2017-09-01 20:41:12 +010033#include "tests/datasets/system_tests/alexnet/AlexNetConvolutionLayerDataset.h"
34#include "tests/datasets/system_tests/googlenet/inceptionv1/GoogLeNetInceptionV1ConvolutionLayerDataset.h"
35#include "tests/datasets/system_tests/googlenet/inceptionv4/GoogLeNetInceptionV4ConvolutionLayerDataset.h"
36#include "tests/datasets/system_tests/lenet5/LeNet5ConvolutionLayerDataset.h"
Gian Marco Iodice2bc74412018-03-01 16:32:10 +000037#include "tests/datasets/system_tests/mobilenet/MobileNetConvolutionLayerDataset.h"
Moritz Pflanzera09de0c2017-09-01 20:41:12 +010038#include "tests/datasets/system_tests/squeezenet/SqueezeNetConvolutionLayerDataset.h"
39#include "tests/datasets/system_tests/vgg/vgg16/VGG16ConvolutionLayerDataset.h"
40#include "tests/datasets/system_tests/yolo/v2/YOLOV2ConvolutionLayerDataset.h"
41#include "tests/framework/Macros.h"
42#include "tests/framework/datasets/Datasets.h"
Anthony Barbier2a07e182017-08-04 18:20:27 +010043#include "utils/TypePrinter.h"
Moritz Pflanzeree493ae2017-07-05 10:52:21 +010044
45namespace arm_compute
46{
47namespace test
48{
Michalis Spyrou724079d2017-12-15 11:37:37 +000049namespace benchmark
50{
SiCong Li1e5c1572017-07-27 17:58:52 +010051namespace
52{
Gian Marco Iodice1d2f2672018-07-10 13:15:34 +010053const auto data_types = framework::dataset::make("DataType", { DataType::F16, DataType::F32, DataType::QASYMM8 });
SiCong Li1e5c1572017-07-27 17:58:52 +010054} // namespace
55
Gian Marco Iodice2bc74412018-03-01 16:32:10 +000056using CLGEMMConvolutionLayerFixture = ConvolutionLayerFixture<CLTensor, CLGEMMConvolutionLayer, CLAccessor>;
Moritz Pflanzeree493ae2017-07-05 10:52:21 +010057
58TEST_SUITE(CL)
59
Georgios Pinitas9fb11592018-04-26 20:34:58 +010060using CLWinogradLayerFixture = WinogradConvolutionLayerFixture<CLTensor, CLWinogradConvolutionLayer, CLAccessor>;
Vidhya Sudhan Loganathanb34690b2018-04-19 14:22:16 +010061
62REGISTER_FIXTURE_DATA_TEST_CASE(AlexNetWinogradLayer, CLWinogradLayerFixture, framework::DatasetMode::ALL,
63 framework::dataset::combine(framework::dataset::combine(framework::dataset::combine(datasets::AlexNetWinogradLayerDataset(),
64 framework::dataset::make("ActivationInfo", ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU))),
Vidhya Sudhan Loganathan71ecf392018-08-31 16:10:16 +010065 framework::dataset::make("DataType", { DataType::F16, DataType::F32 })),
Vidhya Sudhan Loganathanb34690b2018-04-19 14:22:16 +010066 framework::dataset::make("Batches", 1)));
67
68REGISTER_FIXTURE_DATA_TEST_CASE(GoogLeNetInceptionV1WinogradLayer, CLWinogradLayerFixture, framework::DatasetMode::ALL,
69 framework::dataset::combine(framework::dataset::combine(framework::dataset::combine(datasets::GoogLeNetInceptionV1WinogradLayerDataset(),
70 framework::dataset::make("ActivationInfo", ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU))),
Vidhya Sudhan Loganathan71ecf392018-08-31 16:10:16 +010071 framework::dataset::make("DataType", { DataType::F16, DataType::F32 })),
Vidhya Sudhan Loganathanb34690b2018-04-19 14:22:16 +010072 framework::dataset::make("Batches", 1)));
73
74REGISTER_FIXTURE_DATA_TEST_CASE(GoogLeNetInceptionV4WinogradLayer, CLWinogradLayerFixture, framework::DatasetMode::ALL,
75 framework::dataset::combine(framework::dataset::combine(framework::dataset::combine(datasets::GoogLeNetInceptionV4WinogradLayerDataset(),
76 framework::dataset::make("ActivationInfo", ActivationLayerInfo())),
Vidhya Sudhan Loganathan71ecf392018-08-31 16:10:16 +010077 framework::dataset::make("DataType", { DataType::F16, DataType::F32 })),
Vidhya Sudhan Loganathanb34690b2018-04-19 14:22:16 +010078 framework::dataset::make("Batches", 1)));
79
80REGISTER_FIXTURE_DATA_TEST_CASE(SqueezeNetWinogradLayer, CLWinogradLayerFixture, framework::DatasetMode::ALL,
81 framework::dataset::combine(framework::dataset::combine(framework::dataset::combine(datasets::SqueezeNetWinogradLayerDataset(),
82 framework::dataset::make("ActivationInfo", ActivationLayerInfo())),
Vidhya Sudhan Loganathan71ecf392018-08-31 16:10:16 +010083 framework::dataset::make("DataType", { DataType::F16, DataType::F32 })),
Vidhya Sudhan Loganathanb34690b2018-04-19 14:22:16 +010084 framework::dataset::make("Batches", 1)));
85
Gian Marco Iodice2bc74412018-03-01 16:32:10 +000086REGISTER_FIXTURE_DATA_TEST_CASE(AlexNetConvolutionLayer, CLGEMMConvolutionLayerFixture, framework::DatasetMode::ALL,
Isabella Gottardi3f217ec2018-02-12 14:59:19 +000087 framework::dataset::combine(framework::dataset::combine(framework::dataset::combine(datasets::AlexNetConvolutionLayerDataset(), framework::dataset::make("ActivationInfo",
88 ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU))),
SiCong Li1e5c1572017-07-27 17:58:52 +010089 data_types),
SiCong Licc65bbe2017-08-18 11:58:21 +010090 framework::dataset::make("Batches", 1)));
Moritz Pflanzeree493ae2017-07-05 10:52:21 +010091
Gian Marco Iodice2bc74412018-03-01 16:32:10 +000092REGISTER_FIXTURE_DATA_TEST_CASE(LeNet5ConvolutionLayer, CLGEMMConvolutionLayerFixture, framework::DatasetMode::ALL,
Isabella Gottardi3f217ec2018-02-12 14:59:19 +000093 framework::dataset::combine(framework::dataset::combine(framework::dataset::combine(datasets::LeNet5ConvolutionLayerDataset(), framework::dataset::make("ActivationInfo", ActivationLayerInfo())),
SiCong Li1e5c1572017-07-27 17:58:52 +010094 data_types),
SiCong Licc65bbe2017-08-18 11:58:21 +010095 framework::dataset::make("Batches", 1)));
Moritz Pflanzeree493ae2017-07-05 10:52:21 +010096
Gian Marco Iodice2bc74412018-03-01 16:32:10 +000097REGISTER_FIXTURE_DATA_TEST_CASE(GoogLeNetInceptionV1ConvolutionLayer, CLGEMMConvolutionLayerFixture, framework::DatasetMode::ALL,
Isabella Gottardi3f217ec2018-02-12 14:59:19 +000098 framework::dataset::combine(framework::dataset::combine(framework::dataset::combine(datasets::GoogLeNetInceptionV1ConvolutionLayerDataset(), framework::dataset::make("ActivationInfo",
99 ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU))),
SiCong Li1e5c1572017-07-27 17:58:52 +0100100 data_types),
SiCong Licc65bbe2017-08-18 11:58:21 +0100101 framework::dataset::make("Batches", 1)));
Moritz Pflanzeree493ae2017-07-05 10:52:21 +0100102
Gian Marco Iodice2bc74412018-03-01 16:32:10 +0000103REGISTER_FIXTURE_DATA_TEST_CASE(GoogLeNetInceptionV4ConvolutionLayer, CLGEMMConvolutionLayerFixture, framework::DatasetMode::ALL,
Isabella Gottardi3f217ec2018-02-12 14:59:19 +0000104 framework::dataset::combine(framework::dataset::combine(framework::dataset::combine(datasets::GoogLeNetInceptionV4ConvolutionLayerDataset(), framework::dataset::make("ActivationInfo",
105 ActivationLayerInfo())),
SiCong Lif583fb72017-08-15 15:09:18 +0100106 data_types),
SiCong Licc65bbe2017-08-18 11:58:21 +0100107 framework::dataset::make("Batches", 1)));
SiCong Lif583fb72017-08-15 15:09:18 +0100108
Gian Marco Iodice2bc74412018-03-01 16:32:10 +0000109REGISTER_FIXTURE_DATA_TEST_CASE(SqueezeNetConvolutionLayer, CLGEMMConvolutionLayerFixture, framework::DatasetMode::ALL,
Isabella Gottardi3f217ec2018-02-12 14:59:19 +0000110 framework::dataset::combine(framework::dataset::combine(framework::dataset::combine(datasets::SqueezeNetConvolutionLayerDataset(), framework::dataset::make("ActivationInfo",
111 ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU))),
SiCong Li1e5c1572017-07-27 17:58:52 +0100112 data_types),
SiCong Licc65bbe2017-08-18 11:58:21 +0100113 framework::dataset::make("Batches", 1)));
SiCong Li0aea8902017-07-21 18:24:36 +0100114
Gian Marco Iodice2bc74412018-03-01 16:32:10 +0000115REGISTER_FIXTURE_DATA_TEST_CASE(MobileNetConvolutionLayer, CLGEMMConvolutionLayerFixture, framework::DatasetMode::ALL,
Isabella Gottardi3f217ec2018-02-12 14:59:19 +0000116 framework::dataset::combine(framework::dataset::combine(framework::dataset::combine(datasets::MobileNetConvolutionLayerDataset(), framework::dataset::make("ActivationInfo",
117 ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU))),
Gian Marco Iodice2bc74412018-03-01 16:32:10 +0000118 data_types),
119 framework::dataset::make("Batches", 1)));
120
SiCong Li1e5c1572017-07-27 17:58:52 +0100121TEST_SUITE(NIGHTLY)
Gian Marco Iodice2bc74412018-03-01 16:32:10 +0000122REGISTER_FIXTURE_DATA_TEST_CASE(AlexNetConvolutionLayer, CLGEMMConvolutionLayerFixture, framework::DatasetMode::NIGHTLY,
Isabella Gottardi3f217ec2018-02-12 14:59:19 +0000123 framework::dataset::combine(framework::dataset::combine(framework::dataset::combine(datasets::AlexNetConvolutionLayerDataset(), framework::dataset::make("ActivationInfo",
124 ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU))),
SiCong Li1e5c1572017-07-27 17:58:52 +0100125 data_types),
SiCong Licc65bbe2017-08-18 11:58:21 +0100126 framework::dataset::make("Batches", { 4, 8 })));
SiCong Li1e5c1572017-07-27 17:58:52 +0100127
Gian Marco Iodice2bc74412018-03-01 16:32:10 +0000128REGISTER_FIXTURE_DATA_TEST_CASE(LeNet5ConvolutionLayer, CLGEMMConvolutionLayerFixture, framework::DatasetMode::NIGHTLY,
Isabella Gottardi3f217ec2018-02-12 14:59:19 +0000129 framework::dataset::combine(framework::dataset::combine(framework::dataset::combine(datasets::LeNet5ConvolutionLayerDataset(), framework::dataset::make("ActivationInfo", ActivationLayerInfo())),
SiCong Li1e5c1572017-07-27 17:58:52 +0100130 data_types),
SiCong Licc65bbe2017-08-18 11:58:21 +0100131 framework::dataset::make("Batches", { 4, 8 })));
SiCong Li1e5c1572017-07-27 17:58:52 +0100132
Gian Marco Iodice2bc74412018-03-01 16:32:10 +0000133REGISTER_FIXTURE_DATA_TEST_CASE(GoogLeNetInceptionV1ConvolutionLayer, CLGEMMConvolutionLayerFixture, framework::DatasetMode::NIGHTLY,
Isabella Gottardi3f217ec2018-02-12 14:59:19 +0000134 framework::dataset::combine(framework::dataset::combine(framework::dataset::combine(datasets::GoogLeNetInceptionV1ConvolutionLayerDataset(), framework::dataset::make("ActivationInfo",
135 ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU))),
SiCong Li1e5c1572017-07-27 17:58:52 +0100136 data_types),
SiCong Licc65bbe2017-08-18 11:58:21 +0100137 framework::dataset::make("Batches", { 4, 8 })));
SiCong Li1e5c1572017-07-27 17:58:52 +0100138
Gian Marco Iodice2bc74412018-03-01 16:32:10 +0000139REGISTER_FIXTURE_DATA_TEST_CASE(GoogLeNetInceptionV4ConvolutionLayer, CLGEMMConvolutionLayerFixture, framework::DatasetMode::NIGHTLY,
Isabella Gottardi3f217ec2018-02-12 14:59:19 +0000140 framework::dataset::combine(framework::dataset::combine(framework::dataset::combine(datasets::GoogLeNetInceptionV4ConvolutionLayerDataset(), framework::dataset::make("ActivationInfo",
141 ActivationLayerInfo())),
SiCong Lif583fb72017-08-15 15:09:18 +0100142 data_types),
SiCong Licc65bbe2017-08-18 11:58:21 +0100143 framework::dataset::make("Batches", { 4, 8 })));
SiCong Lif583fb72017-08-15 15:09:18 +0100144
Gian Marco Iodice2bc74412018-03-01 16:32:10 +0000145REGISTER_FIXTURE_DATA_TEST_CASE(SqueezeNetConvolutionLayer, CLGEMMConvolutionLayerFixture, framework::DatasetMode::NIGHTLY,
Isabella Gottardi3f217ec2018-02-12 14:59:19 +0000146 framework::dataset::combine(framework::dataset::combine(framework::dataset::combine(datasets::SqueezeNetConvolutionLayerDataset(), framework::dataset::make("ActivationInfo",
147 ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU))),
SiCong Li1e5c1572017-07-27 17:58:52 +0100148 data_types),
SiCong Licc65bbe2017-08-18 11:58:21 +0100149 framework::dataset::make("Batches", { 4, 8 })));
150
Moritz Pflanzer351c20a2017-09-11 14:28:56 +0100151// 8 batches use about 1.8GB of memory which is too much for most devices!
Gian Marco Iodice2bc74412018-03-01 16:32:10 +0000152REGISTER_FIXTURE_DATA_TEST_CASE(VGG16ConvolutionLayer, CLGEMMConvolutionLayerFixture, framework::DatasetMode::NIGHTLY,
Isabella Gottardi3f217ec2018-02-12 14:59:19 +0000153 framework::dataset::combine(framework::dataset::combine(framework::dataset::combine(datasets::VGG16ConvolutionLayerDataset(), framework::dataset::make("ActivationInfo",
154 ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU))),
SiCong Licc65bbe2017-08-18 11:58:21 +0100155 data_types),
Moritz Pflanzer351c20a2017-09-11 14:28:56 +0100156 framework::dataset::make("Batches", { 1, 4 })));
SiCong Li1e5c1572017-07-27 17:58:52 +0100157
Gian Marco Iodice2bc74412018-03-01 16:32:10 +0000158REGISTER_FIXTURE_DATA_TEST_CASE(YOLOV2ConvolutionLayer, CLGEMMConvolutionLayerFixture, framework::DatasetMode::NIGHTLY,
Isabella Gottardi3f217ec2018-02-12 14:59:19 +0000159 framework::dataset::combine(framework::dataset::combine(framework::dataset::combine(datasets::YOLOV2ConvolutionLayerDataset(), framework::dataset::make("ActivationInfo", ActivationLayerInfo())),
SiCong Li1e5c1572017-07-27 17:58:52 +0100160 data_types),
161 framework::dataset::make("Batches", { 1, 4, 8 })));
Vidhya Sudhan Loganathanb34690b2018-04-19 14:22:16 +0100162
163REGISTER_FIXTURE_DATA_TEST_CASE(AlexNetWinogradLayer, CLWinogradLayerFixture, framework::DatasetMode::NIGHTLY,
164 framework::dataset::combine(framework::dataset::combine(framework::dataset::combine(datasets::AlexNetWinogradLayerDataset(),
165 framework::dataset::make("ActivationInfo", ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU))),
Vidhya Sudhan Loganathan71ecf392018-08-31 16:10:16 +0100166 framework::dataset::make("DataType", { DataType::F16, DataType::F32 })),
Vidhya Sudhan Loganathanb34690b2018-04-19 14:22:16 +0100167 framework::dataset::make("Batches", { 4, 8 })));
168
169REGISTER_FIXTURE_DATA_TEST_CASE(GoogLeNetInceptionV1WinogradLayer, CLWinogradLayerFixture, framework::DatasetMode::NIGHTLY,
170 framework::dataset::combine(framework::dataset::combine(framework::dataset::combine(datasets::GoogLeNetInceptionV1WinogradLayerDataset(),
171 framework::dataset::make("ActivationInfo", ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU))),
Vidhya Sudhan Loganathan71ecf392018-08-31 16:10:16 +0100172 framework::dataset::make("DataType", { DataType::F16, DataType::F32 })),
Vidhya Sudhan Loganathanb34690b2018-04-19 14:22:16 +0100173 framework::dataset::make("Batches", { 4, 8 })));
174
175REGISTER_FIXTURE_DATA_TEST_CASE(GoogLeNetInceptionV4WinogradLayer, CLWinogradLayerFixture, framework::DatasetMode::NIGHTLY,
176 framework::dataset::combine(framework::dataset::combine(framework::dataset::combine(datasets::GoogLeNetInceptionV4WinogradLayerDataset(),
177 framework::dataset::make("ActivationInfo", ActivationLayerInfo())),
Vidhya Sudhan Loganathan71ecf392018-08-31 16:10:16 +0100178 framework::dataset::make("DataType", { DataType::F16, DataType::F32 })),
Vidhya Sudhan Loganathanb34690b2018-04-19 14:22:16 +0100179 framework::dataset::make("Batches", { 4, 8 })));
180
181REGISTER_FIXTURE_DATA_TEST_CASE(SqueezeNetWinogradLayer, CLWinogradLayerFixture, framework::DatasetMode::NIGHTLY,
182 framework::dataset::combine(framework::dataset::combine(framework::dataset::combine(datasets::SqueezeNetWinogradLayerDataset(),
183 framework::dataset::make("ActivationInfo", ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU))),
Vidhya Sudhan Loganathan71ecf392018-08-31 16:10:16 +0100184 framework::dataset::make("DataType", { DataType::F16, DataType::F32 })),
Vidhya Sudhan Loganathanb34690b2018-04-19 14:22:16 +0100185 framework::dataset::make("Batches", { 4, 8 })));
SiCong Li1e5c1572017-07-27 17:58:52 +0100186TEST_SUITE_END()
Moritz Pflanzeree493ae2017-07-05 10:52:21 +0100187TEST_SUITE_END()
Michalis Spyrou724079d2017-12-15 11:37:37 +0000188} // namespace benchmark
Moritz Pflanzeree493ae2017-07-05 10:52:21 +0100189} // namespace test
190} // namespace arm_compute