CUDNN the filter format of convolution

Hi everyone, I have found something confusing me.

The type of “format” argument for cudnnSetFilter4dDescriptor is cudnnTensorFormat_t, which with three options: CUDNN_TENSOR_NCHW, CUDNN_TENSOR_NHWC, CUDNN_TENSOR_NCHW_VECT_C.

But filters have two channels, one for input and another for output. I can’t tell which one is N , which one is C, or both of them is C then which one should go first ? I suggest that the answer to this question shall be in the official document.

Other questions:

With tensor core on Turing, which format is best for filters ?

My model is trained with Keras, I assume that I shall use CUDNN_CROSS_CORRELATION when cudnnSetConvolution2dDescriptor, am I right?


For filter N is actually K, C is still C, H is R and W is S, so NCHW -> KCRS, and NHWC -> KRSC, where K is filter output channels, C is convolution input channels.

For convolution related ops, preferred filter format in Turing is NHWC.