diff --git a/onnxruntime/core/providers/cuda/cuda_execution_provider_info.h b/onnxruntime/core/providers/cuda/cuda_execution_provider_info.h index cd4d27f78f..534d3354ec 100644 --- a/onnxruntime/core/providers/cuda/cuda_execution_provider_info.h +++ b/onnxruntime/core/providers/cuda/cuda_execution_provider_info.h @@ -56,9 +56,10 @@ struct CUDAExecutionProviderInfo { // arena config. OrtArenaCfg* default_memory_arena_cfg{nullptr}; CUDAExecutionProviderExternalAllocatorInfo external_allocator_info{}; - // By default use fix workspace size (32M) for Conv algo search, the final algo might not be the best. - // If set to true, try to use as much as possible memory for algo search. - bool cudnn_conv_use_max_workspace{false}; + + // By default, try to use as much as possible memory for algo search. + // If set to false, use fix workspace size (32M) for Conv algo search, the final algo might not be the best. + bool cudnn_conv_use_max_workspace{true}; bool enable_cuda_graph{false}; diff --git a/onnxruntime/core/session/provider_bridge_ort.cc b/onnxruntime/core/session/provider_bridge_ort.cc index 1198a7a3ef..319cb5f7b6 100644 --- a/onnxruntime/core/session/provider_bridge_ort.cc +++ b/onnxruntime/core/session/provider_bridge_ort.cc @@ -1182,7 +1182,7 @@ OrtCUDAProviderOptionsV2 OrtCUDAProviderOptionsToOrtCUDAProviderOptionsV2(const cuda_options_converted.user_compute_stream = legacy_cuda_options->user_compute_stream; cuda_options_converted.default_memory_arena_cfg = legacy_cuda_options->default_memory_arena_cfg; // Use default value as this field is not available in OrtCUDAProviderOptions - cuda_options_converted.cudnn_conv_use_max_workspace = 0; + cuda_options_converted.cudnn_conv_use_max_workspace = 1; cuda_options_converted.enable_cuda_graph = 0; cuda_options_converted.cudnn_conv1d_pad_to_nc1d = 0; @@ -1668,7 +1668,7 @@ ORT_API_STATUS_IMPL(OrtApis::CreateCUDAProviderOptions, _Outptr_ OrtCUDAProvider (*out)->has_user_compute_stream = 0; (*out)->user_compute_stream = nullptr; (*out)->default_memory_arena_cfg = nullptr; - (*out)->cudnn_conv_use_max_workspace = 0; + (*out)->cudnn_conv_use_max_workspace = 1; (*out)->enable_cuda_graph = 0; (*out)->cudnn_conv1d_pad_to_nc1d = 0; return nullptr;