Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[NVIDIA] Set proper math type for convolution #702

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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_));

Expand All @@ -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,
Expand Down Expand Up @@ -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_));

Expand All @@ -327,6 +328,7 @@ ConvolutionBackpropDataDescriptorCuDnn::ConvolutionBackpropDataDescriptorCuDnn(
} else {
GetAlgo(dnnHandle);
}
throwIfError(::cudnnSetConvolutionMathType(conv_.get(), algo_perf_.mathType));
}

void ConvolutionBackpropDataDescriptorCuDnn::BenchmarkOptimalAlgo(const CUDA::DnnHandle& dnnHandle) {
Expand Down
Loading