Add new debug config disable_memory_reuse (#18792)

This commit is contained in:
Taylor Yeonbok Lee 2023-07-27 14:45:34 -07:00 committed by GitHub
parent ab8b46165b
commit acb7e870ce
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 1 deletions

View File

@ -122,6 +122,7 @@ public:
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();

View File

@ -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;

View File

@ -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), "
@ -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);
@ -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;