How to get (print) convolution_algorithm chosen by CUDNN autotune?

How to get the convolution algorithm chosen by CUDNN autotune in pytorch and how to manually define it later?

  1. Is it possible to interact with CUDNN API from inside Pytorch. Following CUDNN function returns the type of algorithm to be used defined by CUDNN_CONVOLUTION_FWD_PREFER_FASTEST:
cudnnGetConvolutionForwardAlgorithm(cudnn,
                                        input_descriptor,
                                        kernel_descriptor,
                                        convolution_descriptor,
                                        output_descriptor,
                                        CUDNN_CONVOLUTION_FWD_PREFER_FASTEST,
                                        /*memoryLimitInBytes=*/0,
                                        &convolution_algorithm)
  1. Is it possible to use CUDNN logs somehow?
  2. Is it possible to do it via pytroch C++ API?

@ptrblck Could you help with this?