Skip to content

Commit

Permalink
Add new debug config disable_memory_reuse
Browse files Browse the repository at this point in the history
  • Loading branch information
yeonbok committed Jul 26, 2023
1 parent 97b4b13 commit 324af67
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ class debug_configuration {
int disable_async_compilation; // Disable async compilation
int disable_dynamic_impl; // Disable dynamic implementation
int disable_runtime_buffer_fusing; // Disable runtime buffer fusing
int disable_memory_reuse; // Disable memmory reuse among layers
std::set<int64_t> dump_iteration; // Dump n-th execution of network.
static const debug_configuration *get_instance();
bool is_dumped_layer(const std::string& layerName, bool is_output = false) const;
Expand Down
4 changes: 4 additions & 0 deletions src/plugins/intel_gpu/src/graph/primitive_inst.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1180,6 +1180,10 @@ memory::ptr primitive_inst::allocate_output(engine& _engine, memory_pool& pool,
if (_node.is_in_shape_of_subgraph())
reusable_across_network = false;

GPU_DEBUG_GET_INSTANCE(debug_config);
GPU_DEBUG_IF(debug_config->disable_memory_reuse) {
reusable_across_network = false;
}
// For outputs, cpu prim we want to have lockable alloc type
// Also if the successor of a node is an cpu, then memory needs to be lockable.
bool is_cpu = _node.get_selected_impl() ? _node.get_selected_impl()->is_cpu() : false;
Expand Down
5 changes: 4 additions & 1 deletion src/plugins/intel_gpu/src/runtime/debug_configuration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ static void print_help_messages() {
"the following order: number of iterations for pre-allocation(int), max size of single iteration in bytes(int), "
"max per-dim allowed diff(int), unconditional buffers preallocation ratio(float). For example for disabling memory"
"preallocation at all, you can use OV_GPU_MemPreallocationOptions='0 0 0 1.0'");
message_list.emplace_back("OV_GPU_DisableMemoryReuse", "Disable memory reuse");

auto max_name_length_item = std::max_element(message_list.begin(), message_list.end(),
[](std::pair<std::string, std::string>& a, std::pair<std::string, std::string>& b){
Expand Down Expand Up @@ -177,7 +178,8 @@ debug_configuration::debug_configuration()
, max_kernels_per_batch(0)
, disable_async_compilation(0)
, disable_dynamic_impl(0)
, disable_runtime_buffer_fusing(0) {
, disable_runtime_buffer_fusing(0)
, disable_memory_reuse(0) {
#ifdef GPU_DEBUG_CONFIG
get_gpu_debug_env_var("Help", help);
get_common_debug_env_var("Verbose", verbose);
Expand Down Expand Up @@ -208,6 +210,7 @@ debug_configuration::debug_configuration()
get_gpu_debug_env_var("DisableAsyncCompilation", disable_async_compilation);
get_gpu_debug_env_var("DisableDynamicImpl", disable_dynamic_impl);
get_gpu_debug_env_var("DisableRuntimeBufferFusing", disable_runtime_buffer_fusing);
get_gpu_debug_env_var("DisableMemoryReuse", disable_memory_reuse);
std::string dump_iteration_str;
get_gpu_debug_env_var("DumpIteration", dump_iteration_str);
std::string mem_preallocation_params_str;
Expand Down

0 comments on commit 324af67

Please sign in to comment.