Auto batch fix default val +test (#10169)

* default config value for the AUTO_BATCH_TIMEOUT

* test for default config value for the AUTO_BATCH_TIMEOUT

* default val for timeout var
This commit is contained in:
Maxim Shevtsov 2022-02-08 10:14:15 +03:00 committed by GitHub
parent 0a316216f3
commit 863c74471f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 17 additions and 4 deletions

View File

@ -308,8 +308,8 @@ AutoBatchExecutableNetwork::AutoBatchExecutableNetwork(
// WA for gcc 4.8 ( fails compilation with member init-list)
_device = networkDevice;
auto time_out = config.find(CONFIG_KEY(AUTO_BATCH_TIMEOUT));
if (time_out != config.end())
_timeOut = ParseTimeoutValue(time_out->second.as<std::string>());
IE_ASSERT(time_out != config.end());
_timeOut = ParseTimeoutValue(time_out->second.as<std::string>());
}
AutoBatchExecutableNetwork::~AutoBatchExecutableNetwork() {
@ -639,6 +639,7 @@ IE_DEFINE_PLUGIN_CREATE_FUNCTION(AutoBatchInferencePlugin, version)
AutoBatchInferencePlugin::AutoBatchInferencePlugin() {
_pluginName = "BATCH";
_config[CONFIG_KEY(AUTO_BATCH_TIMEOUT)] = "1000"; // default value, in ms
}
InferenceEngine::Parameter AutoBatchInferencePlugin::GetMetric(

View File

@ -80,7 +80,7 @@ protected:
std::unordered_map<std::string, InferenceEngine::Parameter> _config;
bool _needPerfCounters = false;
std::atomic_size_t _numRequestsCreated = {0};
std::atomic_int _timeOut = {1000}; // in ms
std::atomic_int _timeOut = {0}; // in ms
};
class AutoBatchInferRequest : public InferenceEngine::IInferRequestInternal {

View File

@ -1,13 +1,16 @@
// Copyright (C) 2018-2022 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
//
#include <auto_batching/auto_batching_tests.hpp>
#include "auto_batching/auto_batching_tests.hpp"
#include "behavior/plugin/configuration_tests.hpp"
const std::vector<size_t> num_streams{ 2 };
const std::vector<bool> get_vs_set{ true, false };
const std::vector<size_t> num_requests{ 1, 8, 16, 64 };
const std::vector<size_t> num_batch{ 1, 8, 32, 256 };
using namespace AutoBatchingTests;
using namespace BehaviorTestsDefinitions;
namespace AutoBatchingTests {
@ -28,4 +31,13 @@ INSTANTIATE_TEST_SUITE_P(smoke_AutoBatching_GPU, AutoBatching_Test_DetectionOutp
::testing::ValuesIn(num_requests),
::testing::ValuesIn(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);
} // namespace AutoBatchingTests