Identifying the Conv Algo Selected by cuDNN v8 within PyTorch


I’ve been working on developing a new convolution algorithm. During my benchmarks with cuDNN in PyTorch, I encountered an issue: I’m unable to determine which convolution algorithms were selected by cuDNN.

I reviewed the Conv_v8.cpp file but couldn’t find any relevant clues. Even after extracting the logs from cuDNN, I couldn’t locate any related information within the descriptors. The conv descriptor is as below:

i! convDesc: type=cudnnConvolutionDescriptor_t:
i! mode: type=cudnnConvolutionMode_t; val=CUDNN_CROSS_CORRELATION (1);
i! dataType: type=cudnnDataType_t; val=CUDNN_DATA_FLOAT (0);
i! mathType: type=cudnnMathType_t; val=CUDNN_DEFAULT_MATH (0);
i! reorderType: type=int; val=0;
i! arrayLength: type=int; val=2;
i! padA: type=int; val=[1,1];
i! strideA: type=int; val=[1,1];
i! dilationA: type=int; val=[1,1];
i! groupCount: type=int; val=1;

Would anyone be able to assist me in determining how to identify the convolution algorithm selected by cuDNN within PyTorch?

Thank you,

cuDNN is developed and maintained by NVidia. See here for documentation:

cuDNN backend API(which was used by PyTorch) was not well documented. I also posted a ticket in cuDNN forum and they asked me to get help in PyTorch forum. Just hope someone who knows cuDNN backend API could give a hint about it.

The ExecutionPlanBuilder contains the engine config responsible for the algorithm selection.

Thank you for your response!

I discovered a relatively straightforward solution. By making modifications to Conv_v7.cpp, I can enable PyTorch to use cuDNN in the v7 manner. This approach simplifies the process of checking and controlling the convolution algorithm, especially since NVIDIA provides more comprehensive documentation for their frontend API.

Thanks again for your assistance!