From 8d74365587695ebf8c751c6ebf99880d6428c654 Mon Sep 17 00:00:00 2001 From: Andrii Pavliuk Date: Wed, 5 Jul 2023 16:36:12 +0300 Subject: [PATCH] [NVIDIA] Set proper math type for convloution --- .../convolution_components/convolution_cudnn_components.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/modules/nvidia_plugin/src/ops/convolution_components/convolution_cudnn_components.cpp b/modules/nvidia_plugin/src/ops/convolution_components/convolution_cudnn_components.cpp index 164054121..8030c7827 100644 --- a/modules/nvidia_plugin/src/ops/convolution_components/convolution_cudnn_components.cpp +++ b/modules/nvidia_plugin/src/ops/convolution_components/convolution_cudnn_components.cpp @@ -74,7 +74,7 @@ CUDA::DnnConvolutionDescriptor ConvolutionParamsCuDnn::MakeConvolutionDescriptor // Enable computations on Tensor Core hardware which requires at least Volta GPU // (compute capability 7.0). - const cudnnMathType_t math_type = CUDNN_TENSOR_OP_MATH_ALLOW_CONVERSION; + const cudnnMathType_t math_type = CUDNN_TENSOR_OP_MATH; throwIfError(::cudnnSetConvolutionMathType(conv_desc.get(), math_type)); throwIfError(::cudnnSetConvolutionGroupCount(conv_desc.get(), groups_)); @@ -96,6 +96,7 @@ ConvolutionDescriptorsCuDnn::ConvolutionDescriptorsCuDnn(const CreationContext& } else { GetAlgo(dnnHandle); } + throwIfError(::cudnnSetConvolutionMathType(conv_.get(), algo_perf_.mathType)); } void ConvolutionDescriptorsCuDnn::BenchmarkOptimalAlgo(const CUDA::DnnHandle& dnnHandle, @@ -305,7 +306,7 @@ CUDA::DnnConvolutionDescriptor ConvolutionBackpropDataParamsCuDnn::MakeConvoluti // Enable computations on Tensor Core hardware which requires at least Volta GPU // (compute capability 7.0). - const cudnnMathType_t math_type = CUDNN_TENSOR_OP_MATH_ALLOW_CONVERSION; + const cudnnMathType_t math_type = CUDNN_TENSOR_OP_MATH; throwIfError(::cudnnSetConvolutionMathType(conv_desc.get(), math_type)); throwIfError(::cudnnSetConvolutionGroupCount(conv_desc.get(), groups_)); @@ -327,6 +328,7 @@ ConvolutionBackpropDataDescriptorCuDnn::ConvolutionBackpropDataDescriptorCuDnn( } else { GetAlgo(dnnHandle); } + throwIfError(::cudnnSetConvolutionMathType(conv_.get(), algo_perf_.mathType)); } void ConvolutionBackpropDataDescriptorCuDnn::BenchmarkOptimalAlgo(const CUDA::DnnHandle& dnnHandle) {