Skip to content

Commit

Permalink
Add new debug config disable_memory_reuse (#18792)
Browse files Browse the repository at this point in the history
  • Loading branch information
yeonbok authored Jul 27, 2023
1 parent ab8b461 commit acb7e87
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 @@ -122,6 +122,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.
std::vector<std::string> load_layers_raw_dump; // List of layers to load dumped raw binary and filenames
static const debug_configuration *get_instance();
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 @@ -136,6 +136,7 @@ static void print_help_messages() {
message_list.emplace_back("OV_GPU_DisableAsyncCompilation", "Disable async compilation");
message_list.emplace_back("OV_GPU_DisableDynamicImpl", "Disable dynamic implementation");
message_list.emplace_back("OV_GPU_DisableRuntimeBufferFusing", "Disable runtime buffer fusing");
message_list.emplace_back("OV_GPU_DisableMemoryReuse", "Disable memory reuse");
message_list.emplace_back("OV_GPU_DumpIteration", "Dump n-th execution of network, separated by space.");
message_list.emplace_back("OV_GPU_MemPreallocationOptions", "Controls buffer pre-allocation feature. Expects 4 values separated by space in"
"the following order: number of iterations for pre-allocation(int), max size of single iteration in bytes(int), "
Expand Down Expand Up @@ -186,7 +187,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 @@ -219,6 +221,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 acb7e87

Please sign in to comment.