SeqDataDesc and MultiHeadAttn Parameters


I started to use cudnn and I didn’t have too much trouble to understand how to use different functions like Convolution or Pooling, however regarding RNN or MultiHeadAttention I have a lot of trouble to understand how to fill the different parameters (attndesc, seqdatadesc, forwparam).

Would there be any simple code examples explained?

I tried to use the code from this post “MultiHeadAttnBackwardData Wrong Result with postDropout enabled” for inspiration.
however by using its parameters I get the error 3 “CUDNN_STATUS_BAD_PARAM” when calling “cudnnSetSeqDataDescriptor”.

Param for queries SeqDataDesc :
dataType = 0 (CUDNN_DATA_FLOAT)
nb_Dims = 4
dimA = [1024,32,1,32]
seqLengthArraySize = 32
seqLengthArray = [1024, 1024, 1024, … 1024] (32 elements of 1024)
paddingFill = 0


Which version of the cuDNN are you using?
Could you please try the following and share with us a minimal issue repro script and complete output logs for better debugging.

Also hope the following doc will help you.

Thank you.


Thanks for your answer, I’m using the CuDNN 8.4.1. Finally my mistake was silly, I was using an array of u16 for the axis parameter, hence the parameter problem when the function wanted to browse the array it was probably between two values and therefore it returned an error.
Thanks also for the additional displays via “CUDNN_LOGINFO_DBG”, “CUDNN_LOGWARN_DBG”, “CUDNN_LOGERR_DBG”; it was very useful for debugging.
However, concerning the additional error logs I didn’t get any on the MultiHeadAttn layer, I only managed to get some on a Convolution function.
I know that on the documentation it is written “[…] (currently only cuDNN version 8 graph APIs and legacy convolution APIs are using this error reporting feature)”, the MultiHead functions are not part of the version 8 graph APIs, or else I don’t understand well what is CuDNN version 8 graph APIs.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.