CUDNN filter data organization

Hi all,

I’m exploring the new CUDNN toolkit, and everything looks pretty straight forward. I had a question about how to organize the data for filters in doing forward convolutions. The documentation states for cudnnSetFilterDescriptor that you can specify the number of input features, number of output features, width, and height. Furthermore, it states that “Filters layout must
be contiguous in memory”. What does the ordering of the filter data need to be to fit a filter descriptor?

Many thanks.


The filter data must be in K,C,H,W order.
K = number of output color planes
C = number of input color planes
H = filter height
W = filter width


Hi Larry,

When using this filter in combination with a tensor in a forward convolution, does the order of the filter still persist even when the data format of the input/output tensors is CUDNN_TENSOR_NHWC (order: Image, Height, Width, Color planes)?



Filter and Tensor data orders are independent (so the Tensor data format specifier does not apply to filter).
Filters must always be packed in the order shown above.