From 8e611e3a67a496733f5c4e882e1ac07d8522384e Mon Sep 17 00:00:00 2001 From: "Zinoviev, Vladimir" Date: Mon, 28 Sep 2020 15:30:15 +0300 Subject: [PATCH 1/3] [LPT] GPU Plugin set config fix --- inference-engine/src/cldnn_engine/cldnn_engine.cpp | 12 +++++++----- inference-engine/src/cldnn_engine/cldnn_engine.h | 3 ++- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/inference-engine/src/cldnn_engine/cldnn_engine.cpp b/inference-engine/src/cldnn_engine/cldnn_engine.cpp index 4d03e06e0f3876..ca92287b45ed24 100644 --- a/inference-engine/src/cldnn_engine/cldnn_engine.cpp +++ b/inference-engine/src/cldnn_engine/cldnn_engine.cpp @@ -77,7 +77,7 @@ cldnn::device_info clDNNEngine::GetDeviceInfo(const std::map clonedNetwork = cloneNetwork(network); bool baselineIsFP16 = false; @@ -139,7 +139,6 @@ InferenceEngine::ICNNNetwork::Ptr clDNNEngine::CloneAndTransformNetwork(const In // Disable shape inference (WA for generic operations) ::ngraph::op::GenericIE::DisableReshape noReshape(nGraphFunc); - CLDNNPlugin::Config config = _impl->m_config; const bool enableInt8 = config.enableInt8 && (config.lptVersion == Config::LptVersion::nGraph); { @@ -322,7 +321,7 @@ ExecutableNetworkInternal::Ptr clDNNEngine::LoadExeNetworkImpl(const InferenceEn context = m_defaultContext; - return std::make_shared(*CloneAndTransformNetwork(network), context, conf); + return std::make_shared(*CloneAndTransformNetwork(network, conf), context, conf); } ExecutableNetworkInternal::Ptr clDNNEngine::LoadExeNetworkImpl(const InferenceEngine::ICNNNetwork &network, @@ -346,7 +345,7 @@ ExecutableNetworkInternal::Ptr clDNNEngine::LoadExeNetworkImpl(const InferenceEn conf.max_dynamic_batch = static_cast(network.getBatchSize()); } - return std::make_shared(*CloneAndTransformNetwork(network), casted, conf); + return std::make_shared(*CloneAndTransformNetwork(network, conf), casted, conf); } RemoteContext::Ptr clDNNEngine::CreateContext(const ParamMap& params) { @@ -384,13 +383,16 @@ void clDNNEngine::QueryNetwork(const ICNNNetwork& network, std::string>& config, QueryNetworkResult& res) const { GetDeviceInfo(config); // Verify device id + CLDNNPlugin::Config conf = _impl->m_config; + conf.enableInt8 = true; // device_info.supports_imad || device_info.supports_immad; + conf.UpdateFromMap(config); auto function = network.getFunction(); if (function != nullptr) { std::unordered_set originalOps; for (auto&& node : function->get_ops()) { originalOps.emplace(node->get_friendly_name()); } - auto clonedNetwork = CloneAndTransformNetwork(network); + auto clonedNetwork = CloneAndTransformNetwork(network, conf); std::unordered_set supported; std::unordered_set unsupported; diff --git a/inference-engine/src/cldnn_engine/cldnn_engine.h b/inference-engine/src/cldnn_engine/cldnn_engine.h index 398712d55d4321..ce0789cb0627b3 100644 --- a/inference-engine/src/cldnn_engine/cldnn_engine.h +++ b/inference-engine/src/cldnn_engine/cldnn_engine.h @@ -27,7 +27,8 @@ class clDNNEngine : public InferenceEngine::InferencePluginInternal, CLDNNRemoteCLContext::Ptr m_defaultContext; cldnn::device_info GetDeviceInfo(const std::map &config) const; - InferenceEngine::ICNNNetwork::Ptr CloneAndTransformNetwork(const InferenceEngine::ICNNNetwork& network) const; + InferenceEngine::ICNNNetwork::Ptr CloneAndTransformNetwork(const InferenceEngine::ICNNNetwork& network, + CLDNNPlugin::Config config) const; public: clDNNEngine(); From 8a157c5f00964bbb07de04308f02918d65e2bef7 Mon Sep 17 00:00:00 2001 From: "Zinoviev, Vladimir" Date: Mon, 28 Sep 2020 18:27:48 +0300 Subject: [PATCH 2/3] [LPT] Fix merge mistakes --- .../src/transformations/convert_precision.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/inference-engine/src/transformations/src/transformations/convert_precision.cpp b/inference-engine/src/transformations/src/transformations/convert_precision.cpp index 5feae89287eaa2..ef36b27058d86b 100644 --- a/inference-engine/src/transformations/src/transformations/convert_precision.cpp +++ b/inference-engine/src/transformations/src/transformations/convert_precision.cpp @@ -162,10 +162,11 @@ bool ngraph::pass::ConvertPrecision::run_on_function(std::shared_ptrget_ordered_ops()) { m_transformation_callback(node); - - // Recursively run for TensorIterator body function - if (auto ti = std::dynamic_pointer_cast(node)) { - convert_function_precision(ti->get_body()); + // Recursively apply transformation for sub-graph based operations + if (auto sub_graph_node = std::dynamic_pointer_cast(node)) { + if (auto sub_graph = sub_graph_node->get_function()) { + convert_function_precision(sub_graph); + } } convert_node_input_precision(node); } From f4cf3a59c1f68fe69f2590e51d97a7992b9d00df Mon Sep 17 00:00:00 2001 From: "Zinoviev, Vladimir" Date: Mon, 28 Sep 2020 19:46:31 +0300 Subject: [PATCH 3/3] [LPT] Rollback device specific INT8 --- inference-engine/src/cldnn_engine/cldnn_engine.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/inference-engine/src/cldnn_engine/cldnn_engine.cpp b/inference-engine/src/cldnn_engine/cldnn_engine.cpp index ca92287b45ed24..e2180e1a26035e 100644 --- a/inference-engine/src/cldnn_engine/cldnn_engine.cpp +++ b/inference-engine/src/cldnn_engine/cldnn_engine.cpp @@ -284,7 +284,7 @@ ExecutableNetworkInternal::Ptr clDNNEngine::LoadExeNetworkImpl(const InferenceEn CLDNNPlugin::Config conf = _impl->m_config; auto device_info = GetDeviceInfo(config); - conf.enableInt8 = true; // device_info.supports_imad || device_info.supports_immad; + conf.enableInt8 = device_info.supports_imad || device_info.supports_immad; conf.UpdateFromMap(config); if (conf.enableDynamicBatch) { @@ -338,7 +338,7 @@ ExecutableNetworkInternal::Ptr clDNNEngine::LoadExeNetworkImpl(const InferenceEn CLDNNPlugin::Config conf = getContextImpl(casted)->GetConfig(); auto device_info = GetDeviceInfo(config); - conf.enableInt8 = true; // device_info.supports_imad || device_info.supports_immad; + conf.enableInt8 = device_info.supports_imad || device_info.supports_immad; conf.UpdateFromMap(config); if (conf.enableDynamicBatch) { @@ -383,16 +383,13 @@ void clDNNEngine::QueryNetwork(const ICNNNetwork& network, std::string>& config, QueryNetworkResult& res) const { GetDeviceInfo(config); // Verify device id - CLDNNPlugin::Config conf = _impl->m_config; - conf.enableInt8 = true; // device_info.supports_imad || device_info.supports_immad; - conf.UpdateFromMap(config); auto function = network.getFunction(); if (function != nullptr) { std::unordered_set originalOps; for (auto&& node : function->get_ops()) { originalOps.emplace(node->get_friendly_name()); } - auto clonedNetwork = CloneAndTransformNetwork(network, conf); + auto clonedNetwork = CloneAndTransformNetwork(network, _impl->m_config); std::unordered_set supported; std::unordered_set unsupported;