Fix CI build issues
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
// Copyright (C) 2018-2022 Intel Corporation
|
||||
// Copyright (C) 2018-2023 Intel Corporation
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
//
|
||||
#include "auto_batching_tests.hpp"
|
||||
@@ -14,73 +14,70 @@ const std::vector<bool> get_vs_set{true, false};
|
||||
const std::vector<size_t> num_streams{1, 2};
|
||||
const std::vector<size_t> num_requests{1, 3, 8, 9, 16, 64};
|
||||
const std::vector<size_t> num_batch{1, 4, 8, 16, 32, 64, 128, 256};
|
||||
INSTANTIATE_TEST_SUITE_P(smoke_AutoBatching_CPU, AutoBatching_Test,
|
||||
::testing::Combine(
|
||||
::testing::Values(CommonTestUtils::DEVICE_CPU),
|
||||
::testing::ValuesIn(get_vs_set),
|
||||
::testing::ValuesIn(num_streams),
|
||||
::testing::ValuesIn(num_requests),
|
||||
::testing::ValuesIn(num_batch)),
|
||||
INSTANTIATE_TEST_SUITE_P(smoke_AutoBatching_CPU,
|
||||
AutoBatching_Test,
|
||||
::testing::Combine(::testing::Values(CommonTestUtils::DEVICE_CPU),
|
||||
::testing::ValuesIn(get_vs_set),
|
||||
::testing::ValuesIn(num_streams),
|
||||
::testing::ValuesIn(num_requests),
|
||||
::testing::ValuesIn(num_batch)),
|
||||
AutoBatching_Test::getTestCaseName);
|
||||
|
||||
INSTANTIATE_TEST_SUITE_P(smoke_AutoBatching_CPU, AutoBatching_Test_DetectionOutput,
|
||||
::testing::Combine(
|
||||
::testing::Values(CommonTestUtils::DEVICE_CPU),
|
||||
::testing::ValuesIn(get_vs_set),
|
||||
::testing::ValuesIn(num_streams),
|
||||
::testing::ValuesIn(num_requests),
|
||||
::testing::ValuesIn(num_batch)),
|
||||
INSTANTIATE_TEST_SUITE_P(smoke_AutoBatching_CPU,
|
||||
AutoBatching_Test_DetectionOutput,
|
||||
::testing::Combine(::testing::Values(CommonTestUtils::DEVICE_CPU),
|
||||
::testing::ValuesIn(get_vs_set),
|
||||
::testing::ValuesIn(num_streams),
|
||||
::testing::ValuesIn(num_requests),
|
||||
::testing::ValuesIn(num_batch)),
|
||||
AutoBatching_Test_DetectionOutput::getTestCaseName);
|
||||
|
||||
#ifdef HAVE_GPU_PLUGIN
|
||||
const std::vector<size_t> gpu_num_streams{ 2 };
|
||||
const std::vector<bool> gpu_get_vs_set{ true, false };
|
||||
const std::vector<size_t> gpu_num_requests{ 1, 8, 16, 64 };
|
||||
const std::vector<size_t> gpu_num_batch{ 1, 8, 32, 256 };
|
||||
const std::vector<size_t> gpu_num_streams{2};
|
||||
const std::vector<bool> gpu_get_vs_set{true, false};
|
||||
const std::vector<size_t> gpu_num_requests{1, 8, 16, 64};
|
||||
const std::vector<size_t> gpu_num_batch{1, 8, 32, 256};
|
||||
|
||||
INSTANTIATE_TEST_SUITE_P(smoke_AutoBatching_GPU, AutoBatching_Test,
|
||||
::testing::Combine(
|
||||
::testing::Values(CommonTestUtils::DEVICE_GPU),
|
||||
::testing::ValuesIn(gpu_get_vs_set),
|
||||
::testing::ValuesIn(gpu_num_streams),
|
||||
::testing::ValuesIn(gpu_num_requests),
|
||||
::testing::ValuesIn(gpu_num_batch)),
|
||||
INSTANTIATE_TEST_SUITE_P(smoke_AutoBatching_GPU,
|
||||
AutoBatching_Test,
|
||||
::testing::Combine(::testing::Values(CommonTestUtils::DEVICE_GPU),
|
||||
::testing::ValuesIn(gpu_get_vs_set),
|
||||
::testing::ValuesIn(gpu_num_streams),
|
||||
::testing::ValuesIn(gpu_num_requests),
|
||||
::testing::ValuesIn(gpu_num_batch)),
|
||||
AutoBatching_Test::getTestCaseName);
|
||||
|
||||
INSTANTIATE_TEST_SUITE_P(smoke_AutoBatching_GPU, AutoBatching_Test_DetectionOutput,
|
||||
::testing::Combine(
|
||||
::testing::Values(CommonTestUtils::DEVICE_GPU),
|
||||
::testing::ValuesIn(gpu_get_vs_set),
|
||||
::testing::ValuesIn(gpu_num_streams),
|
||||
::testing::ValuesIn(gpu_num_requests),
|
||||
::testing::ValuesIn(gpu_num_batch)),
|
||||
INSTANTIATE_TEST_SUITE_P(smoke_AutoBatching_GPU,
|
||||
AutoBatching_Test_DetectionOutput,
|
||||
::testing::Combine(::testing::Values(CommonTestUtils::DEVICE_GPU),
|
||||
::testing::ValuesIn(gpu_get_vs_set),
|
||||
::testing::ValuesIn(gpu_num_streams),
|
||||
::testing::ValuesIn(gpu_num_requests),
|
||||
::testing::ValuesIn(gpu_num_batch)),
|
||||
AutoBatching_Test_DetectionOutput::getTestCaseName);
|
||||
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
smoke_AutoBatching_GPU,
|
||||
DefaultConfigurationTest,
|
||||
::testing::Combine(
|
||||
::testing::Values(std::string(CommonTestUtils::DEVICE_BATCH) + ":" + CommonTestUtils::DEVICE_GPU),
|
||||
::testing::Values(DefaultParameter{CONFIG_KEY(AUTO_BATCH_TIMEOUT),
|
||||
InferenceEngine::Parameter{"1000"}})),
|
||||
DefaultConfigurationTest::getTestCaseName);
|
||||
INSTANTIATE_TEST_SUITE_P(smoke_AutoBatching_GPU,
|
||||
DefaultConfigurationTest,
|
||||
::testing::Combine(::testing::Values(std::string(CommonTestUtils::DEVICE_BATCH) + ":" +
|
||||
CommonTestUtils::DEVICE_GPU),
|
||||
::testing::Values(DefaultParameter{CONFIG_KEY(AUTO_BATCH_TIMEOUT),
|
||||
InferenceEngine::Parameter{"1000"}})),
|
||||
DefaultConfigurationTest::getTestCaseName);
|
||||
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
smoke_AutoBatching_GPU_2_0_string,
|
||||
DefaultConfigurationTest,
|
||||
::testing::Combine(
|
||||
::testing::Values(std::string(CommonTestUtils::DEVICE_BATCH) + ":" + CommonTestUtils::DEVICE_GPU),
|
||||
::testing::Values(DefaultParameter{ov::auto_batch_timeout.name(),
|
||||
InferenceEngine::Parameter{"1000"}})),
|
||||
DefaultConfigurationTest::getTestCaseName);
|
||||
INSTANTIATE_TEST_SUITE_P(smoke_AutoBatching_GPU_2_0_string,
|
||||
DefaultConfigurationTest,
|
||||
::testing::Combine(::testing::Values(std::string(CommonTestUtils::DEVICE_BATCH) + ":" +
|
||||
CommonTestUtils::DEVICE_GPU),
|
||||
::testing::Values(DefaultParameter{ov::auto_batch_timeout.name(),
|
||||
InferenceEngine::Parameter{"1000"}})),
|
||||
DefaultConfigurationTest::getTestCaseName);
|
||||
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
smoke_AutoBatching_GPU_2_0_uint,
|
||||
DefaultConfigurationTest,
|
||||
::testing::Combine(
|
||||
::testing::Values(std::string(CommonTestUtils::DEVICE_BATCH) + ":" + CommonTestUtils::DEVICE_GPU),
|
||||
::testing::Values(DefaultParameter{ov::auto_batch_timeout.name(),
|
||||
InferenceEngine::Parameter{1000}})),
|
||||
DefaultConfigurationTest::getTestCaseName);
|
||||
INSTANTIATE_TEST_SUITE_P(smoke_AutoBatching_GPU_2_0_uint,
|
||||
DefaultConfigurationTest,
|
||||
::testing::Combine(::testing::Values(std::string(CommonTestUtils::DEVICE_BATCH) + ":" +
|
||||
CommonTestUtils::DEVICE_GPU),
|
||||
::testing::Values(DefaultParameter{ov::auto_batch_timeout.name(),
|
||||
InferenceEngine::Parameter{1000}})),
|
||||
DefaultConfigurationTest::getTestCaseName);
|
||||
#endif
|
||||
} // namespace
|
||||
|
||||
@@ -1,31 +1,26 @@
|
||||
// Copyright (C) 2018-2022 Intel Corporation
|
||||
// Copyright (C) 2018-2023 Intel Corporation
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
//
|
||||
|
||||
#pragma once
|
||||
#include <gpu/gpu_config.hpp>
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
#include <memory>
|
||||
|
||||
#include <gpu/gpu_config.hpp>
|
||||
#include <common_test_utils/test_common.hpp>
|
||||
#include <functional_test_utils/plugin_cache.hpp>
|
||||
|
||||
#include "ngraph_functions/subgraph_builders.hpp"
|
||||
#include "functional_test_utils/blob_utils.hpp"
|
||||
#include "base/behavior_test_utils.hpp"
|
||||
#include "common_test_utils/test_common.hpp"
|
||||
#include "functional_test_utils/blob_utils.hpp"
|
||||
#include "ngraph_functions/subgraph_builders.hpp"
|
||||
|
||||
using namespace ::testing;
|
||||
using namespace InferenceEngine;
|
||||
|
||||
namespace AutoBatchingTests {
|
||||
using AutoBatchTwoNetsParams = std::tuple<
|
||||
std::string, // device name
|
||||
bool, // get or set blob
|
||||
size_t, // number of streams
|
||||
size_t, // number of requests
|
||||
size_t>; // batch size>
|
||||
using AutoBatchTwoNetsParams = std::tuple<std::string, // device name
|
||||
bool, // get or set blob
|
||||
size_t, // number of streams
|
||||
size_t, // number of requests
|
||||
size_t>; // batch size>
|
||||
|
||||
class AutoBatching_Test : public BehaviorTestsUtils::IEPluginTestBase,
|
||||
public testing::WithParamInterface<AutoBatchTwoNetsParams> {
|
||||
@@ -33,18 +28,18 @@ class AutoBatching_Test : public BehaviorTestsUtils::IEPluginTestBase,
|
||||
std::tie(target_device, use_get_blob, num_streams, num_requests, num_batch) = this->GetParam();
|
||||
// Skip test according to plugin specific disabledTestPatterns() (if any)
|
||||
SKIP_IF_CURRENT_TEST_IS_DISABLED()
|
||||
fn_ptrs = {ngraph::builder::subgraph::makeSingleConv(),
|
||||
ngraph::builder::subgraph::makeMultiSingleConv()};
|
||||
fn_ptrs = {ngraph::builder::subgraph::makeSingleConv(), ngraph::builder::subgraph::makeMultiSingleConv()};
|
||||
};
|
||||
|
||||
public:
|
||||
static std::string getTestCaseName(const testing::TestParamInfo<AutoBatchTwoNetsParams> &obj) {
|
||||
static std::string getTestCaseName(const testing::TestParamInfo<AutoBatchTwoNetsParams>& obj) {
|
||||
size_t streams, requests, batch;
|
||||
bool use_get_blob;
|
||||
std::string target_device;
|
||||
std::tie(target_device, use_get_blob, streams, requests, batch) = obj.param;
|
||||
return target_device + std::string(use_get_blob ? "_get_blob" : "_set_blob") + "_batch_size_" +
|
||||
std::to_string(batch) +
|
||||
"_num_streams_" + std::to_string(streams) + "_num_req_" + std::to_string(requests);
|
||||
std::to_string(batch) + "_num_streams_" + std::to_string(streams) + "_num_req_" +
|
||||
std::to_string(requests);
|
||||
}
|
||||
|
||||
protected:
|
||||
@@ -56,7 +51,7 @@ protected:
|
||||
|
||||
void TestAutoBatch() {
|
||||
std::vector<InferenceEngine::CNNNetwork> nets;
|
||||
for (auto &fn_ptr : fn_ptrs) {
|
||||
for (auto& fn_ptr : fn_ptrs) {
|
||||
nets.push_back(CNNNetwork(fn_ptr));
|
||||
}
|
||||
|
||||
@@ -64,7 +59,7 @@ protected:
|
||||
std::vector<std::string> outputs;
|
||||
std::vector<InferRequest> irs;
|
||||
std::vector<std::vector<uint8_t>> ref;
|
||||
std::vector<int> outElementsCount;
|
||||
std::vector<size_t> outElementsCount;
|
||||
|
||||
for (size_t i = 0; i < nets.size(); ++i) {
|
||||
auto net = nets[i];
|
||||
@@ -84,18 +79,20 @@ protected:
|
||||
}
|
||||
// minimize timeout to reduce test time
|
||||
config[CONFIG_KEY(AUTO_BATCH_TIMEOUT)] = std::to_string(1);
|
||||
auto exec_net_ref = ie.LoadNetwork(net, std::string(CommonTestUtils::DEVICE_BATCH) + ":" +
|
||||
target_device + "(" + std::to_string(num_batch) + ")",
|
||||
auto exec_net_ref = ie.LoadNetwork(net,
|
||||
std::string(CommonTestUtils::DEVICE_BATCH) + ":" + target_device + "(" +
|
||||
std::to_string(num_batch) + ")",
|
||||
config);
|
||||
|
||||
auto network_outputs = net.getOutputsInfo();
|
||||
ASSERT_EQ(network_outputs.size(), 1) << " Auto-Batching tests use networks with single output";
|
||||
auto output = network_outputs.begin(); //single output
|
||||
auto output = network_outputs.begin(); // single output
|
||||
for (size_t j = 0; j < num_requests; j++) {
|
||||
outputs.push_back(output->first);
|
||||
outElementsCount.push_back(
|
||||
std::accumulate(begin(fn_ptrs[i]->get_output_shape(0)), end(fn_ptrs[i]->get_output_shape(0)), 1,
|
||||
std::multiplies<size_t>()));
|
||||
outElementsCount.push_back(std::accumulate(begin(fn_ptrs[i]->get_output_shape(0)),
|
||||
end(fn_ptrs[i]->get_output_shape(0)),
|
||||
1,
|
||||
std::multiplies<size_t>()));
|
||||
|
||||
auto inf_req = exec_net_ref.CreateInferRequest();
|
||||
irs.push_back(inf_req);
|
||||
@@ -104,14 +101,15 @@ protected:
|
||||
for (auto n : inputs) {
|
||||
auto blob = FuncTestUtils::createAndFillBlob(n.second->getTensorDesc());
|
||||
if (use_get_blob)
|
||||
memcpy(reinterpret_cast<void *>(inf_req.GetBlob(n.first)->buffer().as<uint8_t*>()),
|
||||
reinterpret_cast<const void *>(blob->cbuffer().as<uint8_t*>()), blob->byteSize());
|
||||
memcpy(reinterpret_cast<void*>(inf_req.GetBlob(n.first)->buffer().as<uint8_t*>()),
|
||||
reinterpret_cast<const void*>(blob->cbuffer().as<uint8_t*>()),
|
||||
blob->byteSize());
|
||||
else
|
||||
inf_req.SetBlob(n.first, blob);
|
||||
|
||||
const auto inBlob = inf_req.GetBlob(n.first);
|
||||
const auto blobSize = inBlob->byteSize();
|
||||
const auto inBlobBuf = inBlob->cbuffer().as<uint8_t *>();
|
||||
const auto inBlobBuf = inBlob->cbuffer().as<uint8_t*>();
|
||||
inData.push_back(std::vector<uint8_t>(inBlobBuf, inBlobBuf + blobSize));
|
||||
}
|
||||
if (!use_get_blob) {
|
||||
@@ -137,10 +135,11 @@ protected:
|
||||
|
||||
auto thr = FuncTestUtils::GetComparisonThreshold(InferenceEngine::Precision::FP32);
|
||||
for (size_t i = 0; i < irs.size(); ++i) {
|
||||
const auto &refBuffer = ref[i].data();
|
||||
const auto& refBuffer = ref[i].data();
|
||||
ASSERT_EQ(outElementsCount[i], irs[i].GetBlob(outputs[i])->size());
|
||||
FuncTestUtils::compareRawBuffers(irs[i].GetBlob(outputs[i])->buffer().as<float *>(),
|
||||
reinterpret_cast<const float *>(refBuffer), outElementsCount[i],
|
||||
FuncTestUtils::compareRawBuffers(irs[i].GetBlob(outputs[i])->buffer().as<float*>(),
|
||||
reinterpret_cast<const float*>(refBuffer),
|
||||
outElementsCount[i],
|
||||
outElementsCount[i],
|
||||
thr);
|
||||
}
|
||||
@@ -153,18 +152,17 @@ public:
|
||||
std::tie(target_device, use_get_blob, num_streams, num_requests, num_batch) = this->GetParam();
|
||||
// Skip test according to plugin specific disabledTestPatterns() (if any)
|
||||
SKIP_IF_CURRENT_TEST_IS_DISABLED()
|
||||
fn_ptrs = {ngraph::builder::subgraph::makeDetectionOutput(),
|
||||
ngraph::builder::subgraph::makeDetectionOutput()};
|
||||
fn_ptrs = {ngraph::builder::subgraph::makeDetectionOutput(), ngraph::builder::subgraph::makeDetectionOutput()};
|
||||
};
|
||||
|
||||
static std::string getTestCaseName(const testing::TestParamInfo<AutoBatchTwoNetsParams> &obj) {
|
||||
static std::string getTestCaseName(const testing::TestParamInfo<AutoBatchTwoNetsParams>& obj) {
|
||||
size_t streams, requests, batch;
|
||||
bool use_get_blob;
|
||||
std::string target_device;
|
||||
std::tie(target_device, use_get_blob, streams, requests, batch) = obj.param;
|
||||
return "DetectionOutput_HETERO_" + target_device + std::string(use_get_blob ? "_get_blob" : "_set_blob") +
|
||||
"_batch_size_" + std::to_string(batch) +
|
||||
"_num_streams_" + std::to_string(streams) + "_num_req_" + std::to_string(requests);
|
||||
"_batch_size_" + std::to_string(batch) + "_num_streams_" + std::to_string(streams) + "_num_req_" +
|
||||
std::to_string(requests);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
// Copyright (C) 2018-2022 Intel Corporation
|
||||
// Copyright (C) 2018-2023 Intel Corporation
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
//
|
||||
#include <string>
|
||||
#include <stdexcept>
|
||||
|
||||
#include "set_device_name.hpp"
|
||||
|
||||
#include <stdexcept>
|
||||
#include <string>
|
||||
|
||||
namespace ov {
|
||||
namespace test {
|
||||
void set_device_suffix(const std::string& suffix) {
|
||||
@@ -13,5 +13,5 @@ void set_device_suffix(const std::string& suffix) {
|
||||
throw std::runtime_error("The suffix can't be used for auto_batch device!");
|
||||
}
|
||||
}
|
||||
} // namespace test
|
||||
} // namespace ov
|
||||
} // namespace test
|
||||
} // namespace ov
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright (C) 2018-2022 Intel Corporation
|
||||
// Copyright (C) 2018-2023 Intel Corporation
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
//
|
||||
|
||||
|
||||
Reference in New Issue
Block a user