Hi Nvidia Team,
I have Implemented the Custom plugin for the Einsum operator in TensorRT. But When I am loading the plugin during the Conversion from ONNX to TRT I am getting an issue as Cuda failure: illegal memory access was encountered. It is occuring in enqueue().
Enqueue() code snippet:
```
int EinsumPlugin::enqueue(const nvinfer1::PluginTensorDesc* inputDesc,
const nvinfer1::PluginTensorDesc* outputDesc, const void* const* inputs, void* const* outputs, void* workspace,
cudaStream_t stream)
{
std::cout<<"In Enqueue \n";
cublasHandle_t mCublas;
cublasCreate(&mCublas);
float onef{1.0f}, zerof{0.0f};
cublasSetStream(mCublas, stream);
if(equation=="nct, ncp -> ntp")
{
cublasSgemmBatched(mCublas, CUBLAS_OP_N,CUBLAS_OP_T,
M, K,L,&onef,
reinterpret_cast<const float *const *>(inputs[1]), M,
reinterpret_cast<const float *const *>(inputs[0]), K,
&zerof,
reinterpret_cast<float *const *>(outputs[0]),
M,N);
}
else if(equation=="ntg, ncg -> nct")
{
cublasSgemmBatched(mCublas, CUBLAS_OP_T,CUBLAS_OP_N,
L, O, K, &onef,
static_cast<const float*>(inputs[0]), K,
static_cast<const float*>(inputs[1]), K,
static_cast<float*>(outputs[0]), L, N);
}
return 0;
}
```
May I know the reason for the Issue?
I am attaching the screenshot of the log below.
Thanks in advance,
Darshan