Search code examples
functiondeprecatedcudnn

converting from deprecated cudnn functions to working ones


I need to run a repo that contains deprecated cudnn functions (cudnnGetConvolutionForwardAlgorithm',cudnnGetConvolutionBackwardFilterAlgorithm','cudnnGetConvolutionBackwardDataAlgorithm'). I am on cudnn8.0 at the moment.

I know there are working versions of these functions: cudnnGetConvolutionForwardAlgorithm_v7, cudnnGetConvolutionBackwardFilterAlgorithm_v7 etc but their parameters + return type change.

Do you have any advice on how I could convert from the deprecated version to the working version?


Solution

  • I wouldn't convert to the _v7 function, because you'll have to convert it again when support for it is removed altogether in a future version of the CUDNN library. I'd be inclined to use the cudnnFind... functions, details of which are in the cuDNN API Reference. Since they actually test the possible algorithms that will be used and tell you the fastest one, they may give your network better performance than having a heuristic (used in cudnnGet...) which will only probably give you the fastest one. There is an additional computation cost to call cudnnFind... when you create the network, but not to run it. I haven't done testing yet to see how much extra time it takes, but I can't imagine it's anything noticeable.