Commit 8306d049 authored by Sergey Shalnov's avatar Sergey Shalnov Committed by Robert Kimball

IntelGPU backend: Implemented some clDNN controls (#1934)

parent b804cc90
...@@ -56,6 +56,7 @@ ...@@ -56,6 +56,7 @@
#include "ngraph/runtime/intelgpu/intelgpu_tensor_view.hpp" #include "ngraph/runtime/intelgpu/intelgpu_tensor_view.hpp"
#include "ngraph/runtime/intelgpu/visualize_tree.hpp" #include "ngraph/runtime/intelgpu/visualize_tree.hpp"
#include "ngraph/file_util.hpp"
#include "ngraph/function.hpp" #include "ngraph/function.hpp"
#include "ngraph/node.hpp" #include "ngraph/node.hpp"
#include "ngraph/op/argmax.hpp" #include "ngraph/op/argmax.hpp"
...@@ -329,12 +330,25 @@ runtime::intelgpu::IntelGPUBackend::IntelGPUBackend() ...@@ -329,12 +330,25 @@ runtime::intelgpu::IntelGPUBackend::IntelGPUBackend()
m_disable_backend_optimizations = true; m_disable_backend_optimizations = true;
} }
// Disables clDNN (cldnn::network) level optimizations
if (getenv("NGRAPH_INTELGPU_CLDNN_DISABLE_OPTIMIZATIONS") != nullptr)
{
m_cldnn_graph_optimize = false;
}
// Dumps the input Function into Graphviz format // Dumps the input Function into Graphviz format
if (getenv("NGRAPH_INTELGPU_DUMP_FUNCTION") != nullptr) if (getenv("NGRAPH_INTELGPU_DUMP_FUNCTION") != nullptr)
{ {
m_dump_graph_enable = true; m_dump_graph_enable = true;
} }
// Dumps the clDNN internal logs into directory
if (getenv("NGRAPH_INTELGPU_CLDNN_DUMP") != nullptr)
{
file_util::make_directory(m_cldnn_dump_dir);
m_cldnn_dump_enable = true;
}
cldnn::engine_configuration cldnn_configuration(profiling); cldnn::engine_configuration cldnn_configuration(profiling);
ocl_engine = make_shared<cldnn::engine>(cldnn_configuration); ocl_engine = make_shared<cldnn::engine>(cldnn_configuration);
} }
...@@ -1501,7 +1515,14 @@ bool runtime::intelgpu::IntelGPUBackend::compile(shared_ptr<Function> func) ...@@ -1501,7 +1515,14 @@ bool runtime::intelgpu::IntelGPUBackend::compile(shared_ptr<Function> func)
} }
} }
cldnn::build_options network_build_options(cldnn::build_option::optimize_data(true)); cldnn::build_options network_build_options;
network_build_options.set_option(cldnn::build_option::optimize_data(m_cldnn_graph_optimize));
if (m_cldnn_dump_enable)
{
network_build_options.set_option(cldnn::build_option::graph_dumps_dir(m_cldnn_dump_dir));
}
instance.ocl_network = instance.ocl_network =
make_shared<cldnn::network>(*ocl_engine, topology, network_build_options); make_shared<cldnn::network>(*ocl_engine, topology, network_build_options);
......
...@@ -83,5 +83,8 @@ private: ...@@ -83,5 +83,8 @@ private:
bool m_profile_enable = false; bool m_profile_enable = false;
long m_profile_lines_limit_count = 10; long m_profile_lines_limit_count = 10;
bool m_dump_graph_enable = false; bool m_dump_graph_enable = false;
bool m_cldnn_graph_optimize = true;
bool m_cldnn_dump_enable = false;
std::string m_cldnn_dump_dir = std::string("intelgpu_codegen");
std::string delim = std::string(":"); std::string delim = std::string(":");
}; };
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment