Reformat error for plugin with input format kHWC

Hello,
I have a Jetson Xavier AGX with Jetpack 4.5 with TensorRT 7.1.3.0.
I have a convolution that wants to output nhwc followed by an activation that doesn’t care about dimension layout.
I have a custom plugin for my activation with the following configurePlugin:

bool supportsFormatCombination(int32_t pos, const nvinfer1::PluginTensorDesc* inOut, int32_t nbInputs, int32_t nbOutputs) const
{
    const bool valid_dtype = (inOut[pos].type == nvinfer1::DataType::kHALF);
    const bool valid_format = (inOut[pos].format == nvinfer1::TensorFormat::kHWC8) || (inOut[pos].format == nvinfer1::TensorFormat::kLINEAR);
    return valid_dtype && valid_format;
}

I have a convolution prior to this operation that wants to use:
trt_volta_h884cudnn_128x128_ldg8_relu_exp_small_nhwc_tn_v1, if I allow kHWC8, then I get the following error during conversion:

[TensorRT] ERROR: ../rtSafe/cuda/cudaReformatRunner.cpp (251) - Assertion Error in combineDHtoH: 0 (nbSpatialDims == 3 && nbDims >= 5)

If I set my format to kLINEAR then everything works correctly, but I have a reformat operation before and after each activation. If I accept any input format, then I get the same error as above.
I have upgraded my jetpack 4.5 xavier to TensorRT 8 by extracting the debs from a Jetpack 4.6 install and apt installing them, this appears to work at first and resolves the previously mentioned error, but the model no longer gives usable output. From this post: How to create a plugin support input format::kHWC8? - #5 by pznucleus it would appear that upgrading to Tensorrt 7.2.2.3 should be sufficient, however I can’t find a build of Tensorrt 7.2.2.3 that works on Jetpack 4.5. My next attempt will be to try a Jetpack 4.6 ngc image to see if it is backwards compatible.

Hi,

Do you have a sample so we can reproduce this issue in our environment?

Based on our document, kLINEAR is compatible with the NCHW data format.
Is your tensor stored in NCHW format?
https://docs.nvidia.com/deeplearning/tensorrt/api/c_api/namespacenvinfer1.html#ac3e115b1a2b1e578e8221ef99d27cd45

Thanks.

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