Commit 1827cf83 authored by Sergey Shalnov's avatar Sergey Shalnov Committed by Robert Kimball

IntelGPU backend: Function no cache usage control (#1959)

parent 516fbe13
......@@ -349,6 +349,15 @@ runtime::intelgpu::IntelGPUBackend::IntelGPUBackend()
m_cldnn_dump_enable = true;
}
// Delete compiled Function from the cache after execution.
// It helps in cases where a lot of small functions used
// in case of memory consumption. It slow overall execution
// because Function compilation required every time
if (getenv("NGRAPH_INTELGPU_FUNCTION_CACHE_DISABLE") != nullptr)
{
m_function_cache_disabled = true;
}
cldnn::engine_configuration cldnn_configuration(profiling);
ocl_engine = make_shared<cldnn::engine>(cldnn_configuration);
}
......@@ -1614,6 +1623,11 @@ bool runtime::intelgpu::IntelGPUBackend::call(shared_ptr<Function> func,
mem_after_call);
}
if (m_function_cache_disabled)
{
remove_compiled_function(func);
}
return true;
}
......
......@@ -85,6 +85,7 @@ private:
bool m_dump_graph_enable = false;
bool m_cldnn_graph_optimize = true;
bool m_cldnn_dump_enable = false;
bool m_function_cache_disabled = false;
std::string m_cldnn_dump_dir = std::string("intelgpu_codegen");
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