From cacf54020d8a40df5d66a5877d24a4c37379f664 Mon Sep 17 00:00:00 2001 From: Ilya Churaev Date: Mon, 12 Jun 2023 22:54:23 +0400 Subject: [PATCH] Removed legacy methods SetBatch and SetBlob (#17984) * Removed legacy methods SetBatch and SetBlob * Fixed GPU plugin build * Remove DYN_BATCH_LIMIT from tests * Revert some changes in GPU plugin --- samples/cpp/hello_query_device/README.md | 2 - samples/python/hello_query_device/README.md | 2 - ...nfer_async_request_thread_safe_default.hpp | 12 -- .../interface/ie_iinfer_request_internal.hpp | 18 -- .../include/ie/cpp/ie_infer_request.hpp | 20 --- .../include/ie/ie_iinfer_request.hpp | 27 --- src/inference/include/ie/ie_plugin_config.hpp | 24 --- .../src/cpp/ie_infer_async_request_base.hpp | 8 - src/inference/src/cpp/ie_infer_request.cpp | 8 - .../interface/ie_iinfer_request_internal.cpp | 18 +- src/inference/src/dev/converter_utils.cpp | 10 -- .../functional/async_infer_request_test.cpp | 14 -- src/plugins/auto/src/infer_request.cpp | 9 - src/plugins/auto/src/infer_request.hpp | 7 - src/plugins/hetero/infer_request.cpp | 8 - src/plugins/hetero/infer_request.hpp | 4 - src/plugins/intel_cpu/src/config.cpp | 27 --- src/plugins/intel_cpu/src/config.h | 2 - src/plugins/intel_cpu/src/exec_network.cpp | 54 ------ src/plugins/intel_cpu/src/exec_network.h | 2 - src/plugins/intel_cpu/src/graph.cpp | 8 - src/plugins/intel_cpu/src/graph.h | 15 -- src/plugins/intel_cpu/src/infer_request.cpp | 31 +--- src/plugins/intel_cpu/src/infer_request.h | 1 - src/plugins/intel_cpu/src/plugin.cpp | 18 -- .../behavior/infer_request/config.cpp | 7 +- .../behavior/infer_request/dynamic_batch.cpp | 39 ----- .../behavior/plugin/configuration_tests.cpp | 5 - .../single_layer_tests/reshape.cpp | 14 -- .../intel_gpu/plugin/infer_request_legacy.hpp | 3 +- .../intel_gpu/runtime/internal_properties.hpp | 1 - .../intel_gpu/src/plugin/compiled_model.cpp | 1 - .../intel_gpu/src/plugin/infer_request.cpp | 2 +- .../src/plugin/legacy_api_helper.cpp | 1 - src/plugins/intel_gpu/src/plugin/program.cpp | 19 +-- .../src/runtime/execution_config.cpp | 1 - .../behavior/infer_request/dynamic_batch.cpp | 41 ----- .../single_layer_tests/reshape.cpp | 15 -- .../behavior/plugin/configuration_tests.cpp | 3 - .../behavior/infer_request/dynamic_batch.hpp | 44 ----- .../include/behavior/plugin/preprocessing.hpp | 5 - .../behavior/infer_request/dynamic_batch.cpp | 156 ------------------ .../src/base/layer_test_utils.cpp | 5 - .../src/subgraph/perm_conv_perm_concat.cpp | 5 - ...shape_permute_conv_permute_reshape_act.cpp | 5 - .../mock_iinfer_request_internal.hpp | 2 - .../mocks/mock_iinfer_request.hpp | 3 - 47 files changed, 18 insertions(+), 708 deletions(-) delete mode 100644 src/plugins/intel_cpu/tests/functional/shared_tests_instances/behavior/infer_request/dynamic_batch.cpp delete mode 100644 src/plugins/intel_gpu/tests/functional/shared_tests_instances/behavior/infer_request/dynamic_batch.cpp delete mode 100644 src/tests/functional/plugin/shared/include/behavior/infer_request/dynamic_batch.hpp delete mode 100644 src/tests/functional/plugin/shared/src/behavior/infer_request/dynamic_batch.cpp diff --git a/samples/cpp/hello_query_device/README.md b/samples/cpp/hello_query_device/README.md index b6ce6fa099bbcf..fee753ac1e4ded 100644 --- a/samples/cpp/hello_query_device/README.md +++ b/samples/cpp/hello_query_device/README.md @@ -67,8 +67,6 @@ The application prints all available devices with their supported metrics and de [ INFO ] CPU_THREADS_NUM : 0 [ INFO ] CPU_THROUGHPUT_STREAMS : 1 [ INFO ] DUMP_EXEC_GRAPH_AS_DOT : "" - [ INFO ] DYN_BATCH_ENABLED : NO - [ INFO ] DYN_BATCH_LIMIT : 0 [ INFO ] ENFORCE_BF16 : NO [ INFO ] EXCLUSIVE_ASYNC_REQUESTS : NO [ INFO ] PERFORMANCE_HINT : "" diff --git a/samples/python/hello_query_device/README.md b/samples/python/hello_query_device/README.md index b907774359ee8e..3ad65fd8af0495 100644 --- a/samples/python/hello_query_device/README.md +++ b/samples/python/hello_query_device/README.md @@ -62,8 +62,6 @@ For example: [ INFO ] CPU_THREADS_NUM: 0 [ INFO ] CPU_THROUGHPUT_STREAMS: 1 [ INFO ] DUMP_EXEC_GRAPH_AS_DOT: - [ INFO ] DYN_BATCH_ENABLED: NO - [ INFO ] DYN_BATCH_LIMIT: 0 [ INFO ] ENFORCE_BF16: NO [ INFO ] EXCLUSIVE_ASYNC_REQUESTS: NO [ INFO ] PERFORMANCE_HINT: diff --git a/src/inference/dev_api/cpp_interfaces/impl/ie_infer_async_request_thread_safe_default.hpp b/src/inference/dev_api/cpp_interfaces/impl/ie_infer_async_request_thread_safe_default.hpp index e73b57004f2c4a..abeb6b799022ba 100644 --- a/src/inference/dev_api/cpp_interfaces/impl/ie_infer_async_request_thread_safe_default.hpp +++ b/src/inference/dev_api/cpp_interfaces/impl/ie_infer_async_request_thread_safe_default.hpp @@ -240,11 +240,6 @@ class INFERENCE_ENGINE_1_0_DEPRECATED AsyncInferRequestThreadSafeDefault : publi _syncRequest->SetBlob(name, data); } - void SetBlob(const std::string& name, const Blob::Ptr& data, const PreProcessInfo& info) override { - CheckState(); - _syncRequest->SetBlob(name, data, info); - } - void SetBlobs(const std::string& name, const std::vector& blobs) override { CheckState(); _syncRequest->SetBlobs(name, blobs); @@ -264,13 +259,6 @@ class INFERENCE_ENGINE_1_0_DEPRECATED AsyncInferRequestThreadSafeDefault : publi return _syncRequest->GetPreProcess(name); } - OPENVINO_SUPPRESS_DEPRECATED_START - void SetBatch(int batch) override { - CheckState(); - _syncRequest->SetBatch(batch); - }; - OPENVINO_SUPPRESS_DEPRECATED_END - void SetCallback(Callback callback) override { CheckState(); _callback = std::move(callback); diff --git a/src/inference/dev_api/cpp_interfaces/interface/ie_iinfer_request_internal.hpp b/src/inference/dev_api/cpp_interfaces/interface/ie_iinfer_request_internal.hpp index be3d58a621ec62..0bd5402c6d185e 100644 --- a/src/inference/dev_api/cpp_interfaces/interface/ie_iinfer_request_internal.hpp +++ b/src/inference/dev_api/cpp_interfaces/interface/ie_iinfer_request_internal.hpp @@ -131,15 +131,6 @@ class INFERENCE_ENGINE_1_0_DEPRECATED INFERENCE_ENGINE_API_CLASS(IInferRequestIn */ virtual BatchedBlob::Ptr GetBlobs(const std::string& name); - /** - * @brief Sets pre-process for input data - * @param name Name of input blob. - * @param data - a reference to input or output blob. The type of Blob must correspond to the network input - * precision and size. - * @param info Preprocess info for blob. - */ - virtual void SetBlob(const std::string& name, const Blob::Ptr& data, const PreProcessInfo& info); - /** * @brief Gets pre-process for input data * @param name Name of input blob. @@ -147,14 +138,6 @@ class INFERENCE_ENGINE_1_0_DEPRECATED INFERENCE_ENGINE_API_CLASS(IInferRequestIn */ virtual const PreProcessInfo& GetPreProcess(const std::string& name) const; - /** - * @brief Sets new batch size when dynamic batching is enabled in executable network that created this request. - * @deprecated - * @param batch - new batch size to be used by all the following inference calls for this request. - */ - INFERENCE_ENGINE_DEPRECATED("This method is deprecated and will be removed in 2023.1 release") - virtual void SetBatch(int batch); - /** * @brief Queries memory states. * @return Returns memory states @@ -347,7 +330,6 @@ class INFERENCE_ENGINE_1_0_DEPRECATED INFERENCE_ENGINE_API_CLASS(IInferRequestIn std::vector> _results; //!< A vector of function outputs std::map _preProcData; //!< A map of pre-process data per input std::map _batched_inputs; //!< A map of user passed blobs for network inputs - int m_curBatch = -1; //!< Current batch value used in dynamic batching /** * @brief A shared pointer to IInferRequestInternal diff --git a/src/inference/include/ie/cpp/ie_infer_request.hpp b/src/inference/include/ie/cpp/ie_infer_request.hpp index a3de9ea2fa5e20..b42a35779abccb 100644 --- a/src/inference/include/ie/cpp/ie_infer_request.hpp +++ b/src/inference/include/ie/cpp/ie_infer_request.hpp @@ -118,17 +118,6 @@ class INFERENCE_ENGINE_1_0_DEPRECATED INFERENCE_ENGINE_API_CLASS(InferRequest) { */ Blob::Ptr GetBlob(const std::string& name); - /** - * @deprecated This method will be removed in 2023.1 release - * @brief Sets blob with a pre-process information - * @note Returns an error in case if data blob is output - * @param name Name of input blob. - * @param data A reference to input. The type of Blob must correspond to the network input precision and size. - * @param info Preprocess info for blob. - */ - INFERENCE_ENGINE_DEPRECATED("This method is deprecated and will be removed in 2023.1 release") - void SetBlob(const std::string& name, const Blob::Ptr& data, const PreProcessInfo& info); - /** * @brief Gets pre-process for input data * @param name Name of input blob. @@ -175,15 +164,6 @@ class INFERENCE_ENGINE_1_0_DEPRECATED INFERENCE_ENGINE_API_CLASS(InferRequest) { */ void SetOutput(const BlobMap& results); - /** - * @brief Sets new batch size when dynamic batching is enabled in executable network that created this request. - * @deprecated - * - * @param batch new batch size to be used by all the following inference calls for this request. - */ - INFERENCE_ENGINE_DEPRECATED("This method is deprecated and will be removed in 2023.1 release") - void SetBatch(const int batch); - /** * @brief Start inference of specified input(s) in asynchronous mode * diff --git a/src/inference/include/ie/ie_iinfer_request.hpp b/src/inference/include/ie/ie_iinfer_request.hpp index 7d5a33b4513ebe..896d33aaed12ce 100644 --- a/src/inference/include/ie/ie_iinfer_request.hpp +++ b/src/inference/include/ie/ie_iinfer_request.hpp @@ -85,21 +85,6 @@ class INFERENCE_ENGINE_1_0_DEPRECATED IInferRequest : public std::enable_shared_ */ virtual StatusCode GetBlob(const char* name, Blob::Ptr& data, ResponseDesc* resp) noexcept = 0; - /** - * @deprecated This method will be removed in 2023.1 release - * @brief Sets pre-process for input data - * @param name Name of input blob. - * @param data Reference to input or output blob. The type of Blob must match the network input precision and size. - * @param info Preprocess info for blob. - * @param resp Optional: pointer to an already allocated object to contain information in case of failure - * @return Status code of the operation: OK (0) for success - */ - INFERENCE_ENGINE_DEPRECATED("This method is deprecated and will be removed in 2023.1 release") - virtual StatusCode SetBlob(const char* name, - const Blob::Ptr& data, - const PreProcessInfo& info, - ResponseDesc* resp) noexcept = 0; - /** * @brief Gets pre-process for input data * @param name Name of input blob. @@ -200,18 +185,6 @@ class INFERENCE_ENGINE_1_0_DEPRECATED IInferRequest : public std::enable_shared_ */ virtual StatusCode SetUserData(void* data, ResponseDesc* resp) noexcept = 0; - /** - * @brief Sets new batch size when dynamic batching is enabled in executable network that created this request. - * - * @deprecated - * @param batch_size new batch size to be used by all the following inference calls for this request. - * @param resp Optional: a pointer to an already allocated object to contain extra information of a failure (if - * occurred) - * @return Enumeration of the resulted action: InferenceEngine::OK (0) for success - */ - INFERENCE_ENGINE_DEPRECATED("This method is deprecated and will be removed in 2023.1 release") - virtual InferenceEngine::StatusCode SetBatch(int batch_size, ResponseDesc* resp) noexcept = 0; - protected: virtual ~IInferRequest() = default; }; diff --git a/src/inference/include/ie/ie_plugin_config.hpp b/src/inference/include/ie/ie_plugin_config.hpp index ec513f2d5eedb3..78f42935f0beb5 100644 --- a/src/inference/include/ie/ie_plugin_config.hpp +++ b/src/inference/include/ie/ie_plugin_config.hpp @@ -405,30 +405,6 @@ DECLARE_CONFIG_VALUE(CPU_THROUGHPUT_AUTO); INFERENCE_ENGINE_1_0_DEPRECATED DECLARE_CONFIG_KEY(PERF_COUNT); -/** - * @brief The key defines dynamic limit of batch processing. - * @deprecated - * - * Specified value is applied to all following Infer() calls. Inference Engine processes - * min(batch_limit, original_batch_size) first pictures from input blob. For example, if input - * blob has sizes 32x3x224x224 after applying plugin.SetConfig({KEY_DYN_BATCH_LIMIT, 10}) - * Inference Engine primitives processes only beginner subblobs with size 10x3x224x224. - * This value can be changed before any Infer() call to specify a new batch limit. - * - * The paired parameter value should be convertible to integer number. Acceptable values: - * -1 - Do not limit batch processing - * >0 - Direct value of limit. Batch size to process is min(new batch_limit, original_batch) - */ -INFERENCE_ENGINE_DEPRECATED("This config is deprecated and will be removed in 2023.1 release") -DECLARE_CONFIG_KEY(DYN_BATCH_LIMIT); - -/** - * @brief The key checks whether dynamic batch is enabled. - * @deprecated - */ -INFERENCE_ENGINE_DEPRECATED("This config is deprecated and will be removed in 2023.1 release") -DECLARE_CONFIG_KEY(DYN_BATCH_ENABLED); - /** * @brief This key directs the plugin to load a configuration file. * diff --git a/src/inference/src/cpp/ie_infer_async_request_base.hpp b/src/inference/src/cpp/ie_infer_async_request_base.hpp index 5454a0d73a5bfc..679aa892b3efa2 100644 --- a/src/inference/src/cpp/ie_infer_async_request_base.hpp +++ b/src/inference/src/cpp/ie_infer_async_request_base.hpp @@ -134,10 +134,6 @@ class InferRequestBase : public IInferRequest { TO_STATUS(_impl->SetBlob(name, data)); } - StatusCode SetBlob(const char* name, const Blob::Ptr& data, const PreProcessInfo& info, ResponseDesc* resp) noexcept override { - TO_STATUS(_impl->SetBlob(name, data, info)); - } - StatusCode GetBlob(const char* name, Blob::Ptr& data, ResponseDesc* resp) noexcept override { TO_STATUS(data = _impl->GetBlob(name)); } @@ -181,10 +177,6 @@ class InferRequestBase : public IInferRequest { StatusCode SetUserData(void* data, ResponseDesc* resp) noexcept override { TO_STATUS(_impl->SetUserData(data)); } - - StatusCode SetBatch(int batch_size, ResponseDesc* resp) noexcept override { - TO_STATUS(_impl->SetBatch(batch_size)); - } }; IE_SUPPRESS_DEPRECATED_END diff --git a/src/inference/src/cpp/ie_infer_request.cpp b/src/inference/src/cpp/ie_infer_request.cpp index 8e833197396652..374273b8d743d5 100644 --- a/src/inference/src/cpp/ie_infer_request.cpp +++ b/src/inference/src/cpp/ie_infer_request.cpp @@ -58,10 +58,6 @@ Blob::Ptr InferRequest::GetBlob(const std::string& name) { return blobPtr; } -void InferRequest::SetBlob(const std::string& name, const Blob::Ptr& data, const PreProcessInfo& info) { - INFER_REQ_CALL_STATEMENT(_impl->SetBlob(name, data, info);) -} - const PreProcessInfo& InferRequest::GetPreProcess(const std::string& name) const { INFER_REQ_CALL_STATEMENT(return _impl->GetPreProcess(name);) } @@ -86,10 +82,6 @@ void InferRequest::SetOutput(const BlobMap& results) { INFER_REQ_CALL_STATEMENT(for (auto&& result : results) { _impl->SetBlob(result.first, result.second); }) } -void InferRequest::SetBatch(const int batch) { - INFER_REQ_CALL_STATEMENT(_impl->SetBatch(batch);) -} - void InferRequest::StartAsync() { INFER_REQ_CALL_STATEMENT(_impl->StartAsync();) } diff --git a/src/inference/src/cpp_interfaces/interface/ie_iinfer_request_internal.cpp b/src/inference/src/cpp_interfaces/interface/ie_iinfer_request_internal.cpp index 6d7f461f0edbf6..61694962a331fd 100644 --- a/src/inference/src/cpp_interfaces/interface/ie_iinfer_request_internal.cpp +++ b/src/inference/src/cpp_interfaces/interface/ie_iinfer_request_internal.cpp @@ -407,18 +407,6 @@ BatchedBlob::Ptr IInferRequestInternal::GetBlobs(const std::string& name) { return nullptr; } -void IInferRequestInternal::SetBlob(const std::string& name, const Blob::Ptr& data, const PreProcessInfo& info) { - InputInfo::Ptr foundInput; - DataPtr foundOutput; - if (findInputAndOutputBlobByName(name, foundInput, foundOutput)) { - foundInput->getPreProcess() = copyPreProcess(info); - } else { - IE_THROW() << "Pre-process can't be set to output blob"; - } - - SetBlob(name, data); -} - const PreProcessInfo& IInferRequestInternal::GetPreProcess(const std::string& name) const { InputInfo::Ptr foundInput; DataPtr foundOutput; @@ -429,10 +417,6 @@ const PreProcessInfo& IInferRequestInternal::GetPreProcess(const std::string& na } } -void IInferRequestInternal::SetBatch(int batch) { - IE_THROW(NotImplemented); -} - std::vector> IInferRequestInternal::QueryState() { IE_THROW(NotImplemented); } @@ -460,7 +444,7 @@ void IInferRequestInternal::execDataPreprocessing(InferenceEngine::BlobMap& prep // using preconfigured resize algorithm. auto it = _preProcData.find(input.first); if (it != _preProcData.end()) { - it->second->execute(input.second, _networkInputs[input.first]->getPreProcess(), serial, m_curBatch); + it->second->execute(input.second, _networkInputs[input.first]->getPreProcess(), serial, -1); } } } diff --git a/src/inference/src/dev/converter_utils.cpp b/src/inference/src/dev/converter_utils.cpp index 455afd08c43c08..522d9abf2e85da 100644 --- a/src/inference/src/dev/converter_utils.cpp +++ b/src/inference/src/dev/converter_utils.cpp @@ -541,20 +541,10 @@ class IInferRequestInternalWrapper : public InferenceEngine::IInferRequestIntern return std::make_shared(blobs); } - void SetBlob(const std::string& name, - const InferenceEngine::Blob::Ptr& data, - const InferenceEngine::PreProcessInfo& info) override { - OPENVINO_NOT_IMPLEMENTED; - } - const InferenceEngine::PreProcessInfo& GetPreProcess(const std::string& name) const override { OPENVINO_NOT_IMPLEMENTED; } - void SetBatch(int batch) override { - OPENVINO_NOT_IMPLEMENTED; - } - std::vector> QueryState() override { auto res = m_request->query_state(); std::vector> ret; diff --git a/src/inference/tests/functional/async_infer_request_test.cpp b/src/inference/tests/functional/async_infer_request_test.cpp index b51ec2b4095012..b6f4f4143766da 100644 --- a/src/inference/tests/functional/async_infer_request_test.cpp +++ b/src/inference/tests/functional/async_infer_request_test.cpp @@ -23,13 +23,6 @@ TEST(InferRequestCPPTests, throwsOnUninitializedGetBlob) { ASSERT_THROW(req.GetBlob({}), InferenceEngine::NotAllocated); } -TEST(InferRequestCPPTests, throwsOnUninitializedSetBlobPreproc) { - InferRequest req; - IE_SUPPRESS_DEPRECATED_START - ASSERT_THROW(req.SetBlob({}, {}, {}), InferenceEngine::NotAllocated); - IE_SUPPRESS_DEPRECATED_END -} - TEST(InferRequestCPPTests, throwsOnUninitializedGetPreProcess) { InferRequest req; ASSERT_THROW(req.GetPreProcess({}), InferenceEngine::NotAllocated); @@ -55,13 +48,6 @@ TEST(InferRequestCPPTests, throwsOnUninitializedSetOutput) { ASSERT_THROW(req.SetOutput({{}}), InferenceEngine::NotAllocated); } -TEST(InferRequestCPPTests, throwsOnUninitializedSetBatch) { - InferRequest req; - IE_SUPPRESS_DEPRECATED_START - ASSERT_THROW(req.SetBatch({}), InferenceEngine::NotAllocated); - IE_SUPPRESS_DEPRECATED_END -} - TEST(InferRequestCPPTests, throwsOnUninitializedStartAsync) { InferRequest req; ASSERT_THROW(req.StartAsync(), InferenceEngine::NotAllocated); diff --git a/src/plugins/auto/src/infer_request.cpp b/src/plugins/auto/src/infer_request.cpp index be047f02ba190f..523566c7188ca3 100644 --- a/src/plugins/auto/src/infer_request.cpp +++ b/src/plugins/auto/src/infer_request.cpp @@ -110,15 +110,6 @@ void MultiDeviceInferRequest::SetBlob(const std::string& name, const InferenceEn IInferRequestInternal::SetBlob(name, blob); } -IE_SUPPRESS_DEPRECATED_START -void MultiDeviceInferRequest::SetBlob(const std::string& name, const Blob::Ptr& blob, const PreProcessInfo& info) { - if (_sharedRequest) - _sharedRequest->SetBlob(name, blob, info); - else - IInferRequestInternal::SetBlob(name, blob, info); -} -IE_SUPPRESS_DEPRECATED_END - InferenceEngine::Blob::Ptr MultiDeviceInferRequest::GetBlob(const std::string& name) { if (_sharedRequest) return _sharedRequest->GetBlob(name); diff --git a/src/plugins/auto/src/infer_request.hpp b/src/plugins/auto/src/infer_request.hpp index 181aedcc97a0a4..0d8746100b8568 100644 --- a/src/plugins/auto/src/infer_request.hpp +++ b/src/plugins/auto/src/infer_request.hpp @@ -39,13 +39,6 @@ class MultiDeviceInferRequest : public InferenceEngine::IInferRequestInternal { InferenceEngine::RemoteContext::Ptr ctx = nullptr); std::map GetPerformanceCounts() const override; void SetBlob(const std::string& name, const InferenceEngine::Blob::Ptr& blob) override; - /** - * @deprecated This method will be removed in 2024.1 release - * @brief Sets blob with a pre-process information - */ - void SetBlob(const std::string& name, - const InferenceEngine::Blob::Ptr& blob, - const InferenceEngine::PreProcessInfo& info) override; InferenceEngine::Blob::Ptr GetBlob(const std::string& name) override; std::vector> QueryState() override; // Multi-Device impl specific: sets the data (blobs from the device-less requests to the specific device request) diff --git a/src/plugins/hetero/infer_request.cpp b/src/plugins/hetero/infer_request.cpp index 466dd7b4c98483..fa2a6f4c83e295 100644 --- a/src/plugins/hetero/infer_request.cpp +++ b/src/plugins/hetero/infer_request.cpp @@ -102,14 +102,6 @@ InferenceEngine::Blob::Ptr HeteroInferRequest::GetBlob(const std::string& name) return itRequest->second->GetBlob(name); } -void HeteroInferRequest::SetBlob(const std::string& name, const Blob::Ptr& blob, const PreProcessInfo& info) { - auto itRequest = _subRequestFromBlobName.find(name); - if (itRequest == _subRequestFromBlobName.end()) { - IE_THROW() << "There is no infer requests binded to blob with name: " << name; - } - itRequest->second->SetBlob(name, blob, info); -} - const InferenceEngine::PreProcessInfo& HeteroInferRequest::GetPreProcess(const std::string& name) const { auto itRequest = _subRequestFromBlobName.find(name); if (itRequest == _subRequestFromBlobName.end()) { diff --git a/src/plugins/hetero/infer_request.hpp b/src/plugins/hetero/infer_request.hpp index 51c068d93a2c20..0f2242ee8eec1b 100644 --- a/src/plugins/hetero/infer_request.hpp +++ b/src/plugins/hetero/infer_request.hpp @@ -44,10 +44,6 @@ class HeteroInferRequest : public InferenceEngine::IInferRequestInternal { InferenceEngine::Blob::Ptr GetBlob(const std::string& name) override; - void SetBlob(const std::string& name, - const InferenceEngine::Blob::Ptr& blob, - const InferenceEngine::PreProcessInfo& info) override; - const InferenceEngine::PreProcessInfo& GetPreProcess(const std::string& name) const override; std::vector> QueryState() override; diff --git a/src/plugins/intel_cpu/src/config.cpp b/src/plugins/intel_cpu/src/config.cpp index fdf24c9460dbdd..43e6550f57847f 100644 --- a/src/plugins/intel_cpu/src/config.cpp +++ b/src/plugins/intel_cpu/src/config.cpp @@ -118,17 +118,6 @@ void Config::readProperties(const std::map &prop) { IE_THROW() << "Wrong value " << val << "for property key " << ov::hint::enable_hyper_threading.name() << ". Expected only true/false." << std::endl; } - } else if (key == PluginConfigParams::KEY_DYN_BATCH_LIMIT) { - int val_i = -1; - try { - val_i = std::stoi(val); - } catch (const std::exception&) { - IE_THROW() << "Wrong value for property key " << PluginConfigParams::KEY_DYN_BATCH_LIMIT - << ". Expected only integer numbers"; - } - // zero and any negative value will be treated - // as default batch size - batchLimit = std::max(val_i, 0); } else if (key == CPUConfigParams::KEY_CPU_SPARSE_WEIGHTS_DECOMPRESSION_RATE) { float val_f = 0.0f; try { @@ -155,14 +144,6 @@ void Config::readProperties(const std::map &prop) { else IE_THROW() << "Wrong value for property key " << PluginConfigParams::KEY_EXCLUSIVE_ASYNC_REQUESTS << ". Expected only YES/NO"; - } else if (key.compare(PluginConfigParams::KEY_DYN_BATCH_ENABLED) == 0) { - if (val.compare(PluginConfigParams::YES) == 0) - enableDynamicBatch = true; - else if (val.compare(PluginConfigParams::NO) == 0) - enableDynamicBatch = false; - else - IE_THROW() << "Wrong value for property key " << PluginConfigParams::KEY_DYN_BATCH_ENABLED - << ". Expected only YES/NO"; IE_SUPPRESS_DEPRECATED_START } else if (key.compare(PluginConfigParams::KEY_DUMP_EXEC_GRAPH_AS_DOT) == 0) { IE_SUPPRESS_DEPRECATED_END @@ -307,14 +288,6 @@ void Config::updateProperties() { _config.insert({ PluginConfigParams::KEY_EXCLUSIVE_ASYNC_REQUESTS, PluginConfigParams::YES }); else _config.insert({ PluginConfigParams::KEY_EXCLUSIVE_ASYNC_REQUESTS, PluginConfigParams::NO }); - IE_SUPPRESS_DEPRECATED_START - if (enableDynamicBatch == true) - _config.insert({ PluginConfigParams::KEY_DYN_BATCH_ENABLED, PluginConfigParams::YES }); - else - _config.insert({ PluginConfigParams::KEY_DYN_BATCH_ENABLED, PluginConfigParams::NO }); - - _config.insert({ PluginConfigParams::KEY_DYN_BATCH_LIMIT, std::to_string(batchLimit) }); - IE_SUPPRESS_DEPRECATED_END _config.insert({ PluginConfigParams::KEY_CPU_THROUGHPUT_STREAMS, std::to_string(streamExecutorConfig._streams) }); diff --git a/src/plugins/intel_cpu/src/config.h b/src/plugins/intel_cpu/src/config.h index 09141d369594c4..26c882adf4d059 100644 --- a/src/plugins/intel_cpu/src/config.h +++ b/src/plugins/intel_cpu/src/config.h @@ -42,11 +42,9 @@ struct Config { bool collectPerfCounters = false; bool exclusiveAsyncRequests = false; - bool enableDynamicBatch = false; SnippetsMode snippetsMode = SnippetsMode::Enable; std::string dumpToDot = {}; std::string device_id = {}; - int batchLimit = 0; float fcSparseWeiDecompressionRate = 1.0f; #if defined(OPENVINO_ARCH_X86_64) size_t rtCacheCapacity = 5000ul; diff --git a/src/plugins/intel_cpu/src/exec_network.cpp b/src/plugins/intel_cpu/src/exec_network.cpp index 46e41162a9521d..c17a16c5bce91c 100644 --- a/src/plugins/intel_cpu/src/exec_network.cpp +++ b/src/plugins/intel_cpu/src/exec_network.cpp @@ -82,13 +82,6 @@ ExecNetwork::ExecNetwork(const InferenceEngine::CNNNetwork &network, _cfg.isNewApi = !isLegacyAPI(); _mutex = std::make_shared(); - if (_cfg.batchLimit > 1) { - // check topology for applicability - if (!CanProcessDynBatch(_network)) { - IE_THROW() << "Graph::CreateGraph: such topology cannot be compiled for dynamic batch!"; - } - } - if (cfg.exclusiveAsyncRequests) { // special case when all InferRequests are muxed into a single queue _taskExecutor = _plugin->executorManager()->getExecutor("CPU"); @@ -378,53 +371,6 @@ InferenceEngine::Parameter ExecNetwork::GetMetric(const std::string &name) const return GetMetricLegacy(name, graph); } -bool ExecNetwork::CanProcessDynBatch(const InferenceEngine::CNNNetwork &network) const { - InputsDataMap inputs = network.getInputsInfo(); - - if (inputs.empty()) - return false; - - auto function = network.getFunction(); - if (function == nullptr) { - IE_THROW() << "CPU plug-in doesn't support not ngraph-based model!"; - } - - auto ops = function->get_ordered_ops(); - for (const auto& op : ops) { - auto type = TypeFromName(op->get_type_name()); - if (type == Type::Tile) { - const auto repeatsNode = std::dynamic_pointer_cast(op->get_input_node_shared_ptr(1)); - if (!repeatsNode) - return false; - const auto tile = std::dynamic_pointer_cast(op); - if (tile && repeatsNode->cast_vector()[0] == 1) - continue; - } - - if (type == Type::Reshape) { - if (op->get_input_shape(0)[0] == op->get_output_shape(0)[0]) - continue; - } - - if (type != Type::Input && - type != Type::Output && - type != Type::Convolution && - type != Type::Deconvolution && - type != Type::Lrn && - type != Type::Pooling && - type != Type::FullyConnected && - type != Type::MatMul && - type != Type::Softmax && - type != Type::Split && - type != Type::Concatenation && - type != Type::Eltwise) { - return false; - } - } - - return true; -} - void ExecNetwork::Export(std::ostream& modelStream) { CNNNetworkSerializer serializer(modelStream, extensionManager); serializer <<_network; diff --git a/src/plugins/intel_cpu/src/exec_network.h b/src/plugins/intel_cpu/src/exec_network.h index 42328772b6727c..757cec5f22e016 100644 --- a/src/plugins/intel_cpu/src/exec_network.h +++ b/src/plugins/intel_cpu/src/exec_network.h @@ -76,8 +76,6 @@ class ExecNetwork: public InferenceEngine::ExecutableNetworkThreadSafeDefault { */ GraphGuard::Lock GetGraph() const; - bool CanProcessDynBatch(const InferenceEngine::CNNNetwork &network) const; - bool isLegacyAPI() const; InferenceEngine::Parameter GetConfigLegacy(const std::string &name) const; diff --git a/src/plugins/intel_cpu/src/graph.cpp b/src/plugins/intel_cpu/src/graph.cpp index 81ee36ae945ac1..69ccef79861c95 100644 --- a/src/plugins/intel_cpu/src/graph.cpp +++ b/src/plugins/intel_cpu/src/graph.cpp @@ -983,14 +983,6 @@ void Graph::PullOutputData(BlobMap &out) { outBloMem.SetData(intr_blob, false); } else { size_t size_to_copy = intr_blob.GetDescWithType()->getPaddedElementsCount(); - // used only for backward compatibility with the legacy API - if (getConfig().batchLimit && dynBatch > 0) { - if (node->isDynamicNode() && !getConfig().isNewApi) { - IE_THROW(NotImplemented) << "[DS] not implemented dynamic batch for node with dynamic shape"; - } - - size_to_copy = std::accumulate(outDims.begin() + 1, outDims.end(), (size_t)1, std::multiplies()) * static_cast(dynBatch); - } cpu_convert(intr_blob_ptr, ext_blob_ptr, srcPrec, dstPrec, size_to_copy); } diff --git a/src/plugins/intel_cpu/src/graph.h b/src/plugins/intel_cpu/src/graph.h index 1d0129785b811b..4705e169ebbca7 100644 --- a/src/plugins/intel_cpu/src/graph.h +++ b/src/plugins/intel_cpu/src/graph.h @@ -190,17 +190,6 @@ class Graph { return graphHasDynamicInput; } - /** - * @brief This call updates the dynamic batch value - * - * @note It is used for backward compatibility with legacy API only. - * @param newDynBatch - * new dynamic batch value - */ - void setDynBatch(int newDynBatch) { - dynBatch = newDynBatch; - } - protected: void VisitNode(NodePtr node, std::vector& sortedNodes); @@ -266,10 +255,6 @@ class Graph { GraphContext::CPtr context; - // this field stores the dynamic batch value to provide backward compatibility - // with the legacy API dyn batch behaviour - int dynBatch = -1; - void EnforceBF16(); }; diff --git a/src/plugins/intel_cpu/src/infer_request.cpp b/src/plugins/intel_cpu/src/infer_request.cpp index 82a7ad8b16c5a5..b16b2a232349b4 100644 --- a/src/plugins/intel_cpu/src/infer_request.cpp +++ b/src/plugins/intel_cpu/src/infer_request.cpp @@ -354,19 +354,6 @@ void LegacyInferRequest::initBlobs() { } } -void LegacyInferRequest::SetBatch(int new_batch) { - if (!graph->getConfig().enableDynamicBatch) - IE_THROW() << "Dynamic batch is not enabled."; - - if (new_batch < 1 || new_batch > graph->getConfig().batchLimit) { - IE_THROW() << "Invalid dynamic batch size " << new_batch << - " for this request."; - } - - m_curBatch = new_batch; - graph->setDynBatch(m_curBatch); -} - void LegacyInferRequest::changeDefaultPtr() { // renew external pointers before infer const auto &inMap = graph->inputNodesMap; @@ -448,7 +435,7 @@ void LegacyInferRequest::SetBlob(const std::string& name, const InferenceEngine: auto pBlobDesc = MemoryDescUtils::interpretAsBlobDesc(graph->getInputNodeByName(name)->getChildEdgesAtPort(0)[0]->getMemory()); if (data->getTensorDesc() == pBlobDesc && - graph->_normalizePreprocMap.find(name) == graph->_normalizePreprocMap.end() && !graph->getConfig().batchLimit) { + graph->_normalizePreprocMap.find(name) == graph->_normalizePreprocMap.end()) { externalPtr[name] = data->buffer(); } else if (externalPtr.find(name) != externalPtr.end()) { externalPtr.erase(name); @@ -481,8 +468,7 @@ void LegacyInferRequest::SetBlob(const std::string& name, const InferenceEngine: } auto pBlobDesc = MemoryDescUtils::interpretAsBlobDesc(graph->getOutputNodeByName(name)->getParentEdgesAtPort(0)[0]->getMemory()); - if (data->getTensorDesc() == pBlobDesc && - !graph->getConfig().batchLimit) { + if (data->getTensorDesc() == pBlobDesc) { externalPtr[name] = data->buffer(); } else if (externalPtr.find(name) != externalPtr.end()) { externalPtr.erase(name); @@ -527,7 +513,7 @@ InferenceEngine::Blob::Ptr LegacyInferRequest::GetBlob(const std::string& name) _inputs[name] = make_blob_with_precision(desc); _inputs[name]->allocate(); if (pBlob->getTensorDesc() == desc && - graph->_normalizePreprocMap.find(name) == graph->_normalizePreprocMap.end() && !graph->getConfig().batchLimit) { + graph->_normalizePreprocMap.find(name) == graph->_normalizePreprocMap.end()) { externalPtr[name] = _inputs[name]->buffer(); } } @@ -589,7 +575,7 @@ InferenceEngine::Blob::Ptr LegacyInferRequest::GetBlob(const std::string& name) } _outputs[name] = data; - if (!externalPtr.count(name) && data->getTensorDesc() == pBlobDesc && !graph->getConfig().batchLimit) { + if (!externalPtr.count(name) && data->getTensorDesc() == pBlobDesc) { externalPtr[name] = data->buffer(); } } @@ -706,7 +692,7 @@ void InferRequest::SetBlob(const std::string& name, const InferenceEngine::Blob: blobDesc.getDims()); } if (actualDesc->isCompatible(MemoryDescUtils::convertToCpuBlockedMemoryDesc(blobDesc)) && - graph->_normalizePreprocMap.find(name) == graph->_normalizePreprocMap.end() && !graph->getConfig().batchLimit) { + graph->_normalizePreprocMap.find(name) == graph->_normalizePreprocMap.end()) { externalPtr[name] = data->buffer(); } else if (externalPtr.find(name) != externalPtr.end()) { externalPtr.erase(name); @@ -738,7 +724,7 @@ void InferRequest::SetBlob(const std::string& name, const InferenceEngine::Blob: } const auto &desc = graph->getOutputNodeByName(name)->getParentEdgesAtPort(0)[0]->getMemory().getDesc(); - if (!isDynamic && blobDesc == MemoryDescUtils::convertToTensorDesc(desc) && !graph->getConfig().batchLimit) { + if (!isDynamic && blobDesc == MemoryDescUtils::convertToTensorDesc(desc)) { externalPtr[name] = data->buffer(); } else if (externalPtr.find(name) != externalPtr.end()) { externalPtr.erase(name); @@ -786,7 +772,7 @@ InferenceEngine::Blob::Ptr InferRequest::GetBlob(const std::string& name) { if (!isDynamic && desc == MemoryDescUtils::convertToTensorDesc(graph->getInputNodeByName(name)->getChildEdgesAtPort(0)[0]->getMemory().getDesc()) && - graph->_normalizePreprocMap.find(name) == graph->_normalizePreprocMap.end() && !graph->getConfig().batchLimit) { + graph->_normalizePreprocMap.find(name) == graph->_normalizePreprocMap.end()) { externalPtr[name] = _inputs[name]->buffer(); } } else { @@ -845,8 +831,7 @@ InferenceEngine::Blob::Ptr InferRequest::GetBlob(const std::string& name) { _outputs[name] = data; if (!isDynamic && !externalPtr.count(name) && - data->getTensorDesc() == MemoryDescUtils::convertToTensorDesc(output->second->getParentEdgesAtPort(0)[0]->getMemory().getDesc()) && - !graph->getConfig().batchLimit) { + data->getTensorDesc() == MemoryDescUtils::convertToTensorDesc(output->second->getParentEdgesAtPort(0)[0]->getMemory().getDesc())) { externalPtr[name] = data->buffer(); } } else { diff --git a/src/plugins/intel_cpu/src/infer_request.h b/src/plugins/intel_cpu/src/infer_request.h index 06fb4a2b805eaf..e7abea883803c7 100644 --- a/src/plugins/intel_cpu/src/infer_request.h +++ b/src/plugins/intel_cpu/src/infer_request.h @@ -84,7 +84,6 @@ class LegacyInferRequest : public InferRequestBase { private: void PushInputData() override; void initBlobs() override; - void SetBatch(int batch = -1) override; void changeDefaultPtr() override; }; diff --git a/src/plugins/intel_cpu/src/plugin.cpp b/src/plugins/intel_cpu/src/plugin.cpp index b6dc33f753b067..80ad23345ba5d2 100644 --- a/src/plugins/intel_cpu/src/plugin.cpp +++ b/src/plugins/intel_cpu/src/plugin.cpp @@ -418,13 +418,6 @@ static bool shouldEnforceBF16(const std::map& modelCon } static Config::SnippetsMode getSnippetsMode(const std::map& modelConfig, const Config& engineConfig) { - const auto& dynamicBatchProp = modelConfig.find(InferenceEngine::PluginConfigParams::KEY_DYN_BATCH_ENABLED); - const bool enableDynamicBatch = (dynamicBatchProp != modelConfig.end() && dynamicBatchProp->second == PluginConfigParams::YES) - || engineConfig.enableDynamicBatch; - - if (enableDynamicBatch) // dynamic batch is not supported - return Config::SnippetsMode::Disable; - const auto& snippetsMode = modelConfig.find(InferenceEngine::PluginConfigInternalParams::KEY_SNIPPETS_MODE); if (snippetsMode == modelConfig.end()) // not set explicitly return Config::SnippetsMode::Enable; // enable by default @@ -501,10 +494,6 @@ Engine::LoadExeNetworkImpl(const InferenceEngine::CNNNetwork &network, const std Config conf = engConfig; conf.readProperties(config); - if (conf.enableDynamicBatch) { - conf.batchLimit = static_cast(network.getBatchSize()); - } - if (is_cpu_map_available()) { GetPerformanceStreams(conf, nGraphFunc); } @@ -744,10 +733,6 @@ QueryNetworkResult Engine::QueryNetwork(const CNNNetwork& network, const std::ma Config conf = engConfig; conf.readProperties(config); - if (conf.enableDynamicBatch) { - conf.batchLimit = static_cast(network.getBatchSize()); - } - const auto& lptProp = config.find(InferenceEngine::PluginConfigInternalParams::KEY_LP_TRANSFORMS_MODE); const bool enableLPT = (lptProp != config.end() && lptProp->second == PluginConfigParams::YES) /* enabled in the orig_config*/ || Config::LPTransformsMode::On == engConfig.lpTransformsMode /* or already enabled */; @@ -816,9 +801,6 @@ InferenceEngine::IExecutableNetworkInternal::Ptr Engine::ImportNetwork(std::istr } } - if (conf.enableDynamicBatch) { - conf.batchLimit = static_cast(cnnnetwork.getBatchSize()); - } if (is_cpu_map_available()) { get_num_streams(conf.streamExecutorConfig._streams, function, conf); } diff --git a/src/plugins/intel_cpu/tests/functional/shared_tests_instances/behavior/infer_request/config.cpp b/src/plugins/intel_cpu/tests/functional/shared_tests_instances/behavior/infer_request/config.cpp index d70506eacb1032..a16ed33bbdf625 100644 --- a/src/plugins/intel_cpu/tests/functional/shared_tests_instances/behavior/infer_request/config.cpp +++ b/src/plugins/intel_cpu/tests/functional/shared_tests_instances/behavior/infer_request/config.cpp @@ -20,8 +20,7 @@ namespace { {{InferenceEngine::PluginConfigParams::KEY_CPU_THROUGHPUT_STREAMS, InferenceEngine::PluginConfigParams::CPU_THROUGHPUT_NUMA}}, {{InferenceEngine::PluginConfigParams::KEY_CPU_THROUGHPUT_STREAMS, "8"}}, {{InferenceEngine::PluginConfigParams::KEY_CPU_BIND_THREAD, InferenceEngine::PluginConfigParams::NO}}, - {{InferenceEngine::PluginConfigParams::KEY_CPU_BIND_THREAD, InferenceEngine::PluginConfigParams::YES}}, - {{InferenceEngine::PluginConfigParams::KEY_DYN_BATCH_LIMIT, "10"}}, + {{InferenceEngine::PluginConfigParams::KEY_CPU_BIND_THREAD, InferenceEngine::PluginConfigParams::YES}} }; const std::vector> MultiInConfigs = { @@ -36,9 +35,7 @@ namespace { {{InferenceEngine::MultiDeviceConfigParams::KEY_MULTI_DEVICE_PRIORITIES , CommonTestUtils::DEVICE_CPU}, {InferenceEngine::PluginConfigParams::KEY_CPU_BIND_THREAD, InferenceEngine::PluginConfigParams::NO}}, {{InferenceEngine::MultiDeviceConfigParams::KEY_MULTI_DEVICE_PRIORITIES , CommonTestUtils::DEVICE_CPU}, - {InferenceEngine::PluginConfigParams::KEY_CPU_BIND_THREAD, InferenceEngine::PluginConfigParams::YES}}, - {{InferenceEngine::MultiDeviceConfigParams::KEY_MULTI_DEVICE_PRIORITIES , CommonTestUtils::DEVICE_CPU}, - {InferenceEngine::PluginConfigParams::KEY_DYN_BATCH_LIMIT, "10"}} + {InferenceEngine::PluginConfigParams::KEY_CPU_BIND_THREAD, InferenceEngine::PluginConfigParams::YES}} }; INSTANTIATE_TEST_SUITE_P(smoke_BehaviorTests, InferRequestConfigTest, diff --git a/src/plugins/intel_cpu/tests/functional/shared_tests_instances/behavior/infer_request/dynamic_batch.cpp b/src/plugins/intel_cpu/tests/functional/shared_tests_instances/behavior/infer_request/dynamic_batch.cpp deleted file mode 100644 index 446e6c31463d08..00000000000000 --- a/src/plugins/intel_cpu/tests/functional/shared_tests_instances/behavior/infer_request/dynamic_batch.cpp +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (C) 2018-2023 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#include -#include "common_test_utils/test_constants.hpp" - -namespace ConfigurationTestsDefinitions { -namespace { -std::vector batch_sizes = { - 1, - 5, - 9, - 16 -}; - -std::map additional_config = { -}; -} // namespace - - -INSTANTIATE_TEST_SUITE_P(smoke_DynamicBatchTest_async, DynamicBatchTest, - ::testing::Combine( - ::testing::Values(CommonTestUtils::DEVICE_CPU), - ::testing::Values(InferenceEngine::Precision::FP32), - ::testing::Values(batch_sizes), - ::testing::Values(true), - ::testing::Values(additional_config)), - DynamicBatchTest::getTestCaseName); - -INSTANTIATE_TEST_SUITE_P(smoke_DynamicBatchTest_sync, DynamicBatchTest, - ::testing::Combine( - ::testing::Values(CommonTestUtils::DEVICE_CPU), - ::testing::Values(InferenceEngine::Precision::FP32), - ::testing::Values(batch_sizes), - ::testing::Values(false), - ::testing::Values(additional_config)), - DynamicBatchTest::getTestCaseName); -} // namespace ConfigurationTestsDefinitions diff --git a/src/plugins/intel_cpu/tests/functional/shared_tests_instances/behavior/plugin/configuration_tests.cpp b/src/plugins/intel_cpu/tests/functional/shared_tests_instances/behavior/plugin/configuration_tests.cpp index a96618130fb733..6cadd3b9f2db2d 100644 --- a/src/plugins/intel_cpu/tests/functional/shared_tests_instances/behavior/plugin/configuration_tests.cpp +++ b/src/plugins/intel_cpu/tests/functional/shared_tests_instances/behavior/plugin/configuration_tests.cpp @@ -60,7 +60,6 @@ namespace { {{InferenceEngine::PluginConfigParams::KEY_CPU_THROUGHPUT_STREAMS, "8"}}, {{InferenceEngine::PluginConfigParams::KEY_CPU_BIND_THREAD, InferenceEngine::PluginConfigParams::NO}}, {{InferenceEngine::PluginConfigParams::KEY_CPU_BIND_THREAD, InferenceEngine::PluginConfigParams::YES}}, - {{InferenceEngine::PluginConfigParams::KEY_DYN_BATCH_LIMIT, "10"}}, // check that hints doesn't override customer value (now for streams and later for other config opts) {{InferenceEngine::PluginConfigParams::KEY_PERFORMANCE_HINT, InferenceEngine::PluginConfigParams::THROUGHPUT}, {InferenceEngine::PluginConfigParams::KEY_CPU_THROUGHPUT_STREAMS, "3"}}, @@ -137,7 +136,6 @@ namespace { {InferenceEngine::PluginConfigParams::KEY_PERFORMANCE_HINT_NUM_REQUESTS, "should be int"}}, {{InferenceEngine::PluginConfigParams::KEY_CPU_THROUGHPUT_STREAMS, "OFF"}}, {{InferenceEngine::PluginConfigParams::KEY_CPU_BIND_THREAD, "OFF"}}, - {{InferenceEngine::PluginConfigParams::KEY_DYN_BATCH_LIMIT, "NAN"}} }; const std::vector> multiinconfigs = { @@ -168,8 +166,6 @@ namespace { {InferenceEngine::PluginConfigParams::KEY_CPU_THROUGHPUT_STREAMS, "OFF"}}, {{InferenceEngine::MultiDeviceConfigParams::KEY_MULTI_DEVICE_PRIORITIES , CommonTestUtils::DEVICE_CPU}, {InferenceEngine::PluginConfigParams::KEY_CPU_BIND_THREAD, "OFF"}}, - {{InferenceEngine::MultiDeviceConfigParams::KEY_MULTI_DEVICE_PRIORITIES , CommonTestUtils::DEVICE_CPU}, - {InferenceEngine::PluginConfigParams::KEY_DYN_BATCH_LIMIT, "NAN"}}, {{InferenceEngine::MultiDeviceConfigParams::KEY_MULTI_DEVICE_PRIORITIES , CommonTestUtils::DEVICE_CPU}, {InferenceEngine::PluginConfigParams::KEY_MODEL_PRIORITY, "-1"}}, {{InferenceEngine::MultiDeviceConfigParams::KEY_MULTI_DEVICE_PRIORITIES , CommonTestUtils::DEVICE_CPU}, @@ -238,7 +234,6 @@ namespace { {{InferenceEngine::PluginConfigParams::KEY_PERF_COUNT, InferenceEngine::PluginConfigParams::YES}}, {{InferenceEngine::PluginConfigParams::KEY_EXCLUSIVE_ASYNC_REQUESTS, InferenceEngine::PluginConfigParams::NO}}, {{InferenceEngine::PluginConfigParams::KEY_EXCLUSIVE_ASYNC_REQUESTS, InferenceEngine::PluginConfigParams::YES}}, - {{InferenceEngine::PluginConfigParams::KEY_DYN_BATCH_LIMIT, "10"}} }; INSTANTIATE_TEST_SUITE_P(smoke_BehaviorTests, CorrectConfigCheck, diff --git a/src/plugins/intel_cpu/tests/functional/shared_tests_instances/single_layer_tests/reshape.cpp b/src/plugins/intel_cpu/tests/functional/shared_tests_instances/single_layer_tests/reshape.cpp index ef60adf8c29c56..7d3923f8be55dc 100644 --- a/src/plugins/intel_cpu/tests/functional/shared_tests_instances/single_layer_tests/reshape.cpp +++ b/src/plugins/intel_cpu/tests/functional/shared_tests_instances/single_layer_tests/reshape.cpp @@ -15,20 +15,6 @@ const std::vector netPrecisions = { InferenceEngine::Precision::FP16 }; -INSTANTIATE_TEST_SUITE_P(smoke_ReshapeCheckDynBatch, ReshapeLayerTest, - ::testing::Combine( - ::testing::Values(true), - ::testing::ValuesIn(netPrecisions), - ::testing::Values(InferenceEngine::Precision::UNSPECIFIED), - ::testing::Values(InferenceEngine::Precision::UNSPECIFIED), - ::testing::Values(InferenceEngine::Layout::ANY), - ::testing::Values(InferenceEngine::Layout::ANY), - ::testing::Values(std::vector({30, 30, 30, 30})), - ::testing::Values(std::vector({30, 30, 30, 30})), - ::testing::Values(CommonTestUtils::DEVICE_CPU), - ::testing::Values(std::map({{CONFIG_KEY(DYN_BATCH_ENABLED), CONFIG_VALUE(YES)}}))), - ReshapeLayerTest::getTestCaseName); - INSTANTIATE_TEST_SUITE_P(smoke_ReshapeCheck, ReshapeLayerTest, ::testing::Combine( ::testing::Values(true), diff --git a/src/plugins/intel_gpu/include/intel_gpu/plugin/infer_request_legacy.hpp b/src/plugins/intel_gpu/include/intel_gpu/plugin/infer_request_legacy.hpp index 93d30fed7509c3..8be7708db94b0b 100644 --- a/src/plugins/intel_gpu/include/intel_gpu/plugin/infer_request_legacy.hpp +++ b/src/plugins/intel_gpu/include/intel_gpu/plugin/infer_request_legacy.hpp @@ -46,7 +46,7 @@ class InferRequestLegacy : public InferenceEngine::IInferRequestInternal { void SetBlob(const std::string& name, const InferenceEngine::Blob::Ptr &data) override; void SetBlobs(const std::string& name, const std::vector &data) override; - void SetBatch(int batch = -1) override; + void SetBatch(int batch = -1); std::vector> QueryState() override; void SetGraph(std::shared_ptr graph); void EnableProfiling() { m_useProfiling = true; } @@ -108,6 +108,7 @@ class InferRequestLegacy : public InferenceEngine::IInferRequestInternal { std::map internal_outputs; std::vector> internal_outputs_dynamic; Graph::variable_states_map variables_states_; + int m_curBatch = -1; }; } // namespace intel_gpu diff --git a/src/plugins/intel_gpu/include/intel_gpu/runtime/internal_properties.hpp b/src/plugins/intel_gpu/include/intel_gpu/runtime/internal_properties.hpp index 9d07f0da81ae98..86b56f2d9488dd 100644 --- a/src/plugins/intel_gpu/include/intel_gpu/runtime/internal_properties.hpp +++ b/src/plugins/intel_gpu/include/intel_gpu/runtime/internal_properties.hpp @@ -52,7 +52,6 @@ static constexpr Property, PropertyMutability::RW> cust static constexpr Property force_implementations{"GPU_FORCE_IMPLEMENTATIONS"}; static constexpr Property config_file{"CONFIG_FILE"}; static constexpr Property enable_lp_transformations{"LP_TRANSFORMS_MODE"}; -static constexpr Property enable_dynamic_batch{"DYN_BATCH_ENABLED"}; static constexpr Property max_dynamic_batch{"DYN_BATCH_LIMIT"}; static constexpr Property exclusive_async_requests{"EXCLUSIVE_ASYNC_REQUESTS"}; static constexpr Property nv12_two_inputs{"GPU_NV12_TWO_INPUTS"}; diff --git a/src/plugins/intel_gpu/src/plugin/compiled_model.cpp b/src/plugins/intel_gpu/src/plugin/compiled_model.cpp index 05e494d77ccf21..fe09e450df9e8f 100644 --- a/src/plugins/intel_gpu/src/plugin/compiled_model.cpp +++ b/src/plugins/intel_gpu/src/plugin/compiled_model.cpp @@ -346,7 +346,6 @@ InferenceEngine::Parameter CompiledModel::GetMetric(const std::string &name) con CONFIG_KEY(PERFORMANCE_HINT), CONFIG_KEY(PERFORMANCE_HINT_NUM_REQUESTS), CONFIG_KEY(PERF_COUNT), - CONFIG_KEY(DYN_BATCH_ENABLED), CONFIG_KEY(CONFIG_FILE), CONFIG_KEY(DEVICE_ID), CONFIG_KEY(EXCLUSIVE_ASYNC_REQUESTS), diff --git a/src/plugins/intel_gpu/src/plugin/infer_request.cpp b/src/plugins/intel_gpu/src/plugin/infer_request.cpp index 71fabd2c7bcbb0..a93eeecafbbae6 100644 --- a/src/plugins/intel_gpu/src/plugin/infer_request.cpp +++ b/src/plugins/intel_gpu/src/plugin/infer_request.cpp @@ -1053,7 +1053,7 @@ std::vector> InferReque std::vector> ret{}; ret.reserve(variables_states_.size()); for (const auto& pair : variables_states_) - ret.push_back(std::make_shared(pair.first, pair.second, m_graph->get_engine(), m_curBatch)); + ret.push_back(std::make_shared(pair.first, pair.second, m_graph->get_engine(), -1)); return ret; } diff --git a/src/plugins/intel_gpu/src/plugin/legacy_api_helper.cpp b/src/plugins/intel_gpu/src/plugin/legacy_api_helper.cpp index 8425e71cba95c7..eac1dda8f3a49e 100644 --- a/src/plugins/intel_gpu/src/plugin/legacy_api_helper.cpp +++ b/src/plugins/intel_gpu/src/plugin/legacy_api_helper.cpp @@ -229,7 +229,6 @@ std::vector LegacyAPIHelper::get_supported_configs() { CONFIG_KEY(PERFORMANCE_HINT), CONFIG_KEY(PERFORMANCE_HINT_NUM_REQUESTS), CONFIG_KEY(PERF_COUNT), - CONFIG_KEY(DYN_BATCH_ENABLED), CONFIG_KEY(CONFIG_FILE), CONFIG_KEY(DEVICE_ID), CONFIG_KEY(EXCLUSIVE_ASYNC_REQUESTS), diff --git a/src/plugins/intel_gpu/src/plugin/program.cpp b/src/plugins/intel_gpu/src/plugin/program.cpp index 0988117acac3a1..22d9181adecb49 100644 --- a/src/plugins/intel_gpu/src/plugin/program.cpp +++ b/src/plugins/intel_gpu/src/plugin/program.cpp @@ -170,21 +170,10 @@ Program::Program(InferenceEngine::CNNNetwork& network, cldnn::engine& engine, co bool dyn_shape_batch_found = false; std::map shapes; std::map> batch_dim; - auto enable_dynamic_batch = m_config.get_property(ov::intel_gpu::enable_dynamic_batch); - if (enable_dynamic_batch) { - m_config.set_property(ov::intel_gpu::max_dynamic_batch(network.getBatchSize())); - // in case of legacy dynamic batch, - // we assume 4D input with 0 batch dim - auto param = func->get_parameters().front(); - auto pname = getParamName(param); - shapes[pname] = param->get_output_partial_shape(0); - batch_dim[pname].first = 0; - batch_dim[pname].second = m_config.get_property(ov::intel_gpu::max_dynamic_batch); - } else { - dyn_shape_batch_found = IsDynBatchModel(func, shapes, batch_dim); - if (dyn_shape_batch_found) { - m_config.set_property(ov::intel_gpu::max_dynamic_batch(batch_dim.begin()->second.second)); - } + + dyn_shape_batch_found = IsDynBatchModel(func, shapes, batch_dim); + if (dyn_shape_batch_found) { + m_config.set_property(ov::intel_gpu::max_dynamic_batch(batch_dim.begin()->second.second)); } int m_bv_sz = GetMaxBatchSizeForSingleProgram(); diff --git a/src/plugins/intel_gpu/src/runtime/execution_config.cpp b/src/plugins/intel_gpu/src/runtime/execution_config.cpp index 0e7bc8a9958ec1..21052757b9066d 100644 --- a/src/plugins/intel_gpu/src/runtime/execution_config.cpp +++ b/src/plugins/intel_gpu/src/runtime/execution_config.cpp @@ -54,7 +54,6 @@ void ExecutionConfig::set_default() { std::make_tuple(ov::intel_gpu::enable_loop_unrolling, true), // Legacy API properties - std::make_tuple(ov::intel_gpu::enable_dynamic_batch, false), std::make_tuple(ov::intel_gpu::exclusive_async_requests, false), std::make_tuple(ov::intel_gpu::nv12_two_inputs, false), std::make_tuple(ov::intel_gpu::config_file, ""), diff --git a/src/plugins/intel_gpu/tests/functional/shared_tests_instances/behavior/infer_request/dynamic_batch.cpp b/src/plugins/intel_gpu/tests/functional/shared_tests_instances/behavior/infer_request/dynamic_batch.cpp deleted file mode 100644 index 17a75d740f0fe0..00000000000000 --- a/src/plugins/intel_gpu/tests/functional/shared_tests_instances/behavior/infer_request/dynamic_batch.cpp +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (C) 2018-2023 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#include -#include "common_test_utils/test_constants.hpp" - -namespace ConfigurationTestsDefinitions { -namespace { -std::vector batch_sizes = { - 16, - 1, - 5, - 9, - 16 -}; - -auto additional_config = []() { - return std::map{}; -}; -} // namespace - - -INSTANTIATE_TEST_SUITE_P(smoke_DynamicBatchTest_async, DynamicBatchTest, - ::testing::Combine( - ::testing::Values(CommonTestUtils::DEVICE_GPU), - ::testing::Values(InferenceEngine::Precision::FP32), - ::testing::Values(batch_sizes), - ::testing::Values(true), - ::testing::Values(additional_config())), - DynamicBatchTest::getTestCaseName); - -INSTANTIATE_TEST_SUITE_P(smoke_DynamicBatchTest_sync, DynamicBatchTest, - ::testing::Combine( - ::testing::Values(CommonTestUtils::DEVICE_GPU), - ::testing::Values(InferenceEngine::Precision::FP32), - ::testing::Values(batch_sizes), - ::testing::Values(false), - ::testing::Values(additional_config())), - DynamicBatchTest::getTestCaseName); -} // namespace ConfigurationTestsDefinitions diff --git a/src/plugins/intel_gpu/tests/functional/shared_tests_instances/single_layer_tests/reshape.cpp b/src/plugins/intel_gpu/tests/functional/shared_tests_instances/single_layer_tests/reshape.cpp index 00a8d3ee4d74dd..77f8915048b4b7 100644 --- a/src/plugins/intel_gpu/tests/functional/shared_tests_instances/single_layer_tests/reshape.cpp +++ b/src/plugins/intel_gpu/tests/functional/shared_tests_instances/single_layer_tests/reshape.cpp @@ -15,21 +15,6 @@ const std::vector netPrecisions = { InferenceEngine::Precision::I64 }; -//TODO: Issue : - 28981 -INSTANTIATE_TEST_SUITE_P(DISABLE_smoke_ReshapeCheckDynBatch, ReshapeLayerTest, - ::testing::Combine( - ::testing::Values(true), - ::testing::ValuesIn(netPrecisions), - ::testing::Values(InferenceEngine::Precision::UNSPECIFIED), - ::testing::Values(InferenceEngine::Precision::UNSPECIFIED), - ::testing::Values(InferenceEngine::Layout::ANY), - ::testing::Values(InferenceEngine::Layout::ANY), - ::testing::Values(std::vector({1, 16, 16, 16})), - ::testing::Values(std::vector({1, 0, 256})), - ::testing::Values(CommonTestUtils::DEVICE_GPU), - ::testing::Values(std::map({{CONFIG_KEY(DYN_BATCH_ENABLED), CONFIG_VALUE(YES)}}))), - ReshapeLayerTest::getTestCaseName); - INSTANTIATE_TEST_SUITE_P(smoke_ReshapeCheck, ReshapeLayerTest, ::testing::Combine( ::testing::Values(true), diff --git a/src/tests/functional/plugin/conformance/test_runner/api_conformance_runner/src/behavior/plugin/configuration_tests.cpp b/src/tests/functional/plugin/conformance/test_runner/api_conformance_runner/src/behavior/plugin/configuration_tests.cpp index 7df4f55a73c4cf..0e5257c61584b2 100644 --- a/src/tests/functional/plugin/conformance/test_runner/api_conformance_runner/src/behavior/plugin/configuration_tests.cpp +++ b/src/tests/functional/plugin/conformance/test_runner/api_conformance_runner/src/behavior/plugin/configuration_tests.cpp @@ -38,7 +38,6 @@ namespace { {{InferenceEngine::PluginConfigParams::KEY_PERFORMANCE_HINT, InferenceEngine::PluginConfigParams::LATENCY}}, {{InferenceEngine::PluginConfigParams::KEY_PERFORMANCE_HINT, InferenceEngine::PluginConfigParams::LATENCY}, {InferenceEngine::PluginConfigParams::KEY_PERFORMANCE_HINT_NUM_REQUESTS, "1"}}, - {{InferenceEngine::PluginConfigParams::KEY_DYN_BATCH_LIMIT, "10"}}, // check that hints doesn't override customer value (now for streams and later for other config opts) }; @@ -88,7 +87,6 @@ INSTANTIATE_TEST_SUITE_P(ie_plugin_Hetero, CorrectConfigTests, {InferenceEngine::PluginConfigParams::KEY_PERFORMANCE_HINT_NUM_REQUESTS, "-1"}}, {{InferenceEngine::PluginConfigParams::KEY_PERFORMANCE_HINT, InferenceEngine::PluginConfigParams::THROUGHPUT}, {InferenceEngine::PluginConfigParams::KEY_PERFORMANCE_HINT_NUM_REQUESTS, "should be int"}}, - {{InferenceEngine::PluginConfigParams::KEY_DYN_BATCH_LIMIT, "NAN"}} }; const std::vector> pluginMultiInConfigs = { @@ -165,7 +163,6 @@ INSTANTIATE_TEST_SUITE_P(ie_plugin_Hetero, CorrectConfigTests, {{InferenceEngine::PluginConfigParams::KEY_PERFORMANCE_HINT, InferenceEngine::PluginConfigParams::LATENCY}}, {{InferenceEngine::PluginConfigParams::KEY_PERFORMANCE_HINT, InferenceEngine::PluginConfigParams::LATENCY}, {InferenceEngine::PluginConfigParams::KEY_PERFORMANCE_HINT_NUM_REQUESTS, "1"}}, - {{InferenceEngine::PluginConfigParams::KEY_DYN_BATCH_LIMIT, "10"}} }; INSTANTIATE_TEST_SUITE_P(ie_plugin, CorrectConfigCheck, diff --git a/src/tests/functional/plugin/shared/include/behavior/infer_request/dynamic_batch.hpp b/src/tests/functional/plugin/shared/include/behavior/infer_request/dynamic_batch.hpp deleted file mode 100644 index a63dd3dc1853be..00000000000000 --- a/src/tests/functional/plugin/shared/include/behavior/infer_request/dynamic_batch.hpp +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (C) 2018-2023 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#pragma once - -#include -#include -#include -#include - -#include "shared_test_classes/base/layer_test_utils.hpp" - -namespace ConfigurationTestsDefinitions { -typedef std::tuple< - std::string, // Device - InferenceEngine::Precision, // Network precision - std::vector, // Batch sizes - bool, // Asynchronous execution - std::map // Additional configuration -> dynamicBatchTestParams; - -class DynamicBatchTest : virtual public LayerTestsUtils::LayerTestsCommon, - public testing::WithParamInterface { -private: - bool run_async = false; - size_t max_batch_size = 0; - std::vector batch_sizes; - std::vector> reference_inputs; - std::vector> scaled_inputs; - std::vector>>> reference_outputs; - std::vector> actual_outputs; - std::vector infer_requests; -protected: - void SetUp() override; - void Run() override; - - void LoadNetwork() override; - void Infer() override; - void Validate() override; -public: - static std::string getTestCaseName(const testing::TestParamInfo &obj); -}; -} // namespace ConfigurationTestsDefinitions diff --git a/src/tests/functional/plugin/shared/include/behavior/plugin/preprocessing.hpp b/src/tests/functional/plugin/shared/include/behavior/plugin/preprocessing.hpp index 57cade509d9a61..affa682949df0b 100644 --- a/src/tests/functional/plugin/shared/include/behavior/plugin/preprocessing.hpp +++ b/src/tests/functional/plugin/shared/include/behavior/plugin/preprocessing.hpp @@ -65,11 +65,6 @@ struct PreprocessingPrecisionConvertTest : inputs.push_back(blob); } - if (configuration.count(InferenceEngine::PluginConfigParams::KEY_DYN_BATCH_ENABLED) && - configuration.count(InferenceEngine::PluginConfigParams::YES)) { - auto batchSize = executableNetwork.GetInputsInfo().begin()->second->getTensorDesc().getDims()[0] / 2; - inferRequest.SetBatch(static_cast(batchSize)); - } inferRequest.Infer(); } diff --git a/src/tests/functional/plugin/shared/src/behavior/infer_request/dynamic_batch.cpp b/src/tests/functional/plugin/shared/src/behavior/infer_request/dynamic_batch.cpp deleted file mode 100644 index 7347c627af886d..00000000000000 --- a/src/tests/functional/plugin/shared/src/behavior/infer_request/dynamic_batch.cpp +++ /dev/null @@ -1,156 +0,0 @@ -// Copyright (C) 2018-2023 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#include -#include -#include -#include - -#include "ie_core.hpp" - -#include "ie_transformations.hpp" -#include "common_test_utils/common_utils.hpp" -#include "functional_test_utils/skip_tests_config.hpp" -#include "behavior/infer_request/dynamic_batch.hpp" - -#include "ngraph_functions/subgraph_builders.hpp" - -namespace ConfigurationTestsDefinitions { - - std::string DynamicBatchTest::getTestCaseName(const testing::TestParamInfo &obj) { - std::string targetDevice; - InferenceEngine::Precision netPrecision; - std::vector batchSizes; - bool runAsync; - std::map config; - std::tie(targetDevice, netPrecision, batchSizes, runAsync, config) = obj.param; - std::ostringstream result; - - result << "netPrecision=" << netPrecision.name() << "_"; - result << "BS=" << CommonTestUtils::vec2str(batchSizes) << "_"; - result << std::string(runAsync ? "Async" : "Sync") << "_"; - result << "targetDevice=" << targetDevice; - return result.str(); - } - - size_t hiddenSize; - - - void DynamicBatchTest::SetUp() { - InferenceEngine::Precision netPrecision; - std::map config; - std::tie(targetDevice, netPrecision, batch_sizes, run_async, config) = this->GetParam(); - configuration.insert(config.begin(), config.end()); - configuration[InferenceEngine::PluginConfigParams::KEY_DYN_BATCH_ENABLED] = InferenceEngine::PluginConfigParams::YES; - - max_batch_size = *std::max_element(batch_sizes.begin(), batch_sizes.end()); - - function = ngraph::builder::subgraph::makeSingleConv(); - } - - void DynamicBatchTest::LoadNetwork() { - cnnNetwork = InferenceEngine::CNNNetwork{function}; - ConfigureNetwork(); - cnnNetwork.setBatchSize(max_batch_size); - executableNetwork = core->LoadNetwork(cnnNetwork, targetDevice, configuration); - } - - void DynamicBatchTest::Infer() { - inferRequest = executableNetwork.CreateInferRequest(); - inputs.clear(); - - for (int i = 0; i < batch_sizes.size(); i++) { - auto batch_size = batch_sizes[i]; - - cnnNetwork.setBatchSize(batch_size); - inputs.clear(); - for (const auto &input : cnnNetwork.getInputsInfo()) { - const auto &info = input.second; - auto blob = GenerateInput(*info); - inputs.push_back(blob); - } - reference_inputs.push_back(inputs); - functionRefs = ngraph::clone_function(*function); - reference_outputs.push_back(CalculateRefs()); - } - - for (int i = 0; i < batch_sizes.size(); i++) { - infer_requests.push_back(executableNetwork.CreateInferRequest()); - auto batch_size = batch_sizes[i]; - - auto& infer_request = infer_requests[i]; - infer_request.SetBatch(batch_size); - - inputs.clear(); - for (const auto &input : executableNetwork.GetInputsInfo()) { - const auto &info = input.second; - auto blob = GenerateInput(*info); - infer_request.SetBlob(info->name(), blob); - inputs.push_back(blob); - } - - scaled_inputs.push_back(inputs); - - for (int j = 0; j < reference_inputs[i].size(); j++) { - auto& ref = reference_inputs[i][j]; - auto& actual = scaled_inputs[i][j]; - - auto byte_num = ref->byteSize(); - auto ref_ptr = ref->buffer().as(); - auto actual_ptr = actual->buffer().as(); - - for (int k = 0; k < byte_num; k++) { - actual_ptr[k] = ref_ptr[k]; - } - } - } - - for (auto& infer_request : infer_requests) { - if (run_async) { - infer_request.StartAsync(); - } else { - infer_request.Infer(); - } - } - - if (run_async) { - for (auto& infer_request : infer_requests) { - auto status = infer_request.Wait(10000); - if (status != InferenceEngine::StatusCode::OK) { - GTEST_FAIL() << "Inference request status after wait is not OK"; - } - } - } - } - - void DynamicBatchTest::Validate() { - for (int i = 0; i < infer_requests.size(); i++) { - auto outputs = std::vector{}; - for (const auto &output : executableNetwork.GetOutputsInfo()) { - const auto &name = output.first; - outputs.push_back(infer_requests[i].GetBlob(name)); - } - for (int j = 0; j < reference_outputs[i].size(); j++) { - if (reference_outputs[i][j].second.size() < outputs[j]->byteSize()) { - auto actual_ptr = outputs[j]->buffer().as(); - for (int k = reference_outputs[i][j].second.size(); k < outputs[j]->byteSize(); k++) actual_ptr[k] = 0; - reference_outputs[i][j].second.resize(outputs[j]->byteSize()); - } - } - Compare(reference_outputs[i], outputs); - } - } - - void DynamicBatchTest::Run() { - SKIP_IF_CURRENT_TEST_IS_DISABLED(); - LoadNetwork(); - GenerateInputs(); - Infer(); - Validate(); - } - - TEST_P(DynamicBatchTest, CompareWithRefs) { - Run(); - }; -} // namespace ConfigurationTestsDefinitions diff --git a/src/tests/functional/shared_test_classes/src/base/layer_test_utils.cpp b/src/tests/functional/shared_test_classes/src/base/layer_test_utils.cpp index 5a3cf59f5ff4c9..e978b45cf8b529 100644 --- a/src/tests/functional/shared_test_classes/src/base/layer_test_utils.cpp +++ b/src/tests/functional/shared_test_classes/src/base/layer_test_utils.cpp @@ -406,11 +406,6 @@ void LayerTestsCommon::ConfigureInferRequest() { auto blob = inputs[i]; inferRequest.SetBlob(info->name(), blob); } - if (configuration.count(InferenceEngine::PluginConfigParams::KEY_DYN_BATCH_ENABLED) && - configuration.count(InferenceEngine::PluginConfigParams::YES)) { - auto batchSize = executableNetwork.GetInputsInfo().begin()->second->getTensorDesc().getDims()[0] / 2; - inferRequest.SetBatch(batchSize); - } } void LayerTestsCommon::Infer() { diff --git a/src/tests/functional/shared_test_classes/src/subgraph/perm_conv_perm_concat.cpp b/src/tests/functional/shared_test_classes/src/subgraph/perm_conv_perm_concat.cpp index 5240ed1d6eedf9..8749e0a51e574b 100644 --- a/src/tests/functional/shared_test_classes/src/subgraph/perm_conv_perm_concat.cpp +++ b/src/tests/functional/shared_test_classes/src/subgraph/perm_conv_perm_concat.cpp @@ -101,11 +101,6 @@ void PermConvPermConcat::Run() { inferRequest.SetBlob(info->name(), blob); inputs.push_back(blob); } - if (configuration.count(InferenceEngine::PluginConfigParams::KEY_DYN_BATCH_ENABLED) && - configuration.count(InferenceEngine::PluginConfigParams::YES)) { - auto batchSize = cnnNetwork.getInputsInfo().begin()->second->getTensorDesc().getDims()[0] / 2; - inferRequest.SetBatch(batchSize); - } inferRequest.Infer(); Validate(); diff --git a/src/tests/functional/shared_test_classes/src/subgraph/reshape_permute_conv_permute_reshape_act.cpp b/src/tests/functional/shared_test_classes/src/subgraph/reshape_permute_conv_permute_reshape_act.cpp index cbf4a695d6a284..75773892f1b7bd 100644 --- a/src/tests/functional/shared_test_classes/src/subgraph/reshape_permute_conv_permute_reshape_act.cpp +++ b/src/tests/functional/shared_test_classes/src/subgraph/reshape_permute_conv_permute_reshape_act.cpp @@ -97,11 +97,6 @@ namespace SubgraphTestsDefinitions { inferRequest.SetBlob(info->name(), blob); inputs.push_back(blob); } - if (configuration.count(InferenceEngine::PluginConfigParams::KEY_DYN_BATCH_ENABLED) && - configuration.count(InferenceEngine::PluginConfigParams::YES)) { - auto batchSize = cnnNetwork.getInputsInfo().begin()->second->getTensorDesc().getDims()[0] / 2; - inferRequest.SetBatch(batchSize); - } inferRequest.Infer(); threshold = 0.1; diff --git a/src/tests/ie_test_utils/unit_test_utils/mocks/cpp_interfaces/interface/mock_iinfer_request_internal.hpp b/src/tests/ie_test_utils/unit_test_utils/mocks/cpp_interfaces/interface/mock_iinfer_request_internal.hpp index 265f3be14a497a..85347e2a5c68b6 100644 --- a/src/tests/ie_test_utils/unit_test_utils/mocks/cpp_interfaces/interface/mock_iinfer_request_internal.hpp +++ b/src/tests/ie_test_utils/unit_test_utils/mocks/cpp_interfaces/interface/mock_iinfer_request_internal.hpp @@ -22,10 +22,8 @@ class MockIInferRequestInternal : public InferenceEngine::IInferRequestInternal MOCK_CONST_METHOD0(GetPerformanceCounts, std::map()); MOCK_METHOD2(SetBlob, void(const std::string&, const InferenceEngine::Blob::Ptr &)); MOCK_METHOD1(GetBlob, InferenceEngine::Blob::Ptr(const std::string&)); - MOCK_METHOD3(SetBlob, void(const std::string&, const InferenceEngine::Blob::Ptr &, const InferenceEngine::PreProcessInfo&)); MOCK_CONST_METHOD1(GetPreProcess, const InferenceEngine::PreProcessInfo&(const std::string&)); MOCK_METHOD1(SetCallback, void(std::function)); - MOCK_METHOD1(SetBatch, void(int)); MOCK_METHOD0(QueryState, std::vector()); MOCK_METHOD0(Cancel, void()); MOCK_METHOD0(StartAsyncImpl, void()); diff --git a/src/tests/ie_test_utils/unit_test_utils/mocks/mock_iinfer_request.hpp b/src/tests/ie_test_utils/unit_test_utils/mocks/mock_iinfer_request.hpp index 4a0df6584e2a5a..e616f5460b6d52 100644 --- a/src/tests/ie_test_utils/unit_test_utils/mocks/mock_iinfer_request.hpp +++ b/src/tests/ie_test_utils/unit_test_utils/mocks/mock_iinfer_request.hpp @@ -34,9 +34,6 @@ class MockIInferRequest : public IInferRequest { MOCK_METHOD(StatusCode, GetPreProcess, (const char*, const PreProcessInfo**, ResponseDesc*), (const, noexcept)); MOCK_METHOD(StatusCode, SetBlob, (const char*, const Blob::Ptr&, ResponseDesc*), (noexcept)); - MOCK_METHOD(StatusCode, SetBlob, - (const char*, const Blob::Ptr&, const PreProcessInfo&, ResponseDesc*), (noexcept)); - MOCK_METHOD(StatusCode, SetBatch, (int batch, ResponseDesc*), (noexcept)); MOCK_METHOD(StatusCode, Cancel, (ResponseDesc*), (noexcept)); };