Problem of fusing Convolution and BatchNorm

Cuda ENV:

  • cudnn version:8005
  • cudaGetDeviceProperties::major:7
  • cudaGetDeviceProperties::minor:5


I try to fuse Convolution and BN by CUDNN_FUSED_SCALE_BIAS_ACTIVATION_CONV_BNSTATS.The following API are mainly used:

  • cudnnCreateFusedOpsPlan()
  • cudnnCreateFusedOpsConstParamPack()
  • cudnnSetFusedOpsConstParamPackAttribute()
  • cudnnMakeFusedOpsPlan()
  • cudnnCreateFusedOpsVariantParamPack()
  • cudnnFusedOpsExecute()

When I use cudnnSetFusedOpsConstParamPackAttribute to set the parameters according to [Conditions for Fully Fused Fast Path (Forward)], the code can run.
I saw the API document says: “As of cuDNN 7.6.0, if the conditions in Table 26 are met, then the fully fused fast path will be triggered. Otherwise, a slower partially fused path will be triggered.”
However, if the type of input data is CUDNN_DATA_FLOAT instead of CUDNN_DATA_HALF, the code will raise a CUDNN_STATUS_BAD_PARAM error.

How to choose arguments when the conditions in [Conditions for Fully Fused Fast Path (Forward)] are not met.How do I set cudnnTensorFormat_t , etc. to make cudnn support Conv-BN fusion when cudnnDataType_t==CUDNN_DATA_FLOAT .