onnxruntime icon indicating copy to clipboard operation
onnxruntime copied to clipboard

cuda's FusedConv is not support Sigmod

Open marktohark opened this issue 1 year ago • 0 comments

Describe the issue

2024-05-17 09:41:31.333218349 [E:onnxruntime:, inference_session.cc:1981 operator()] Exception during initialization: /onnxruntime_src/onnxruntime/contrib_ops/cuda/fused_conv.cc:19 onnxruntime::contrib::cuda::FusedConv<T>::FusedConv(const onnxruntime::OpKernelInfo&) [with T = float] [ONNXRuntimeError] : 2 : INVALID_ARGUMENT : unsupported conv activation mode "Sigmoid"

I use CUDA Provider to load onnx model, and show error.

python: 3.8.10 onnxruntime-gpu: 1.17.1 os: ubuntu 20.04 cuda: 11.8 cuDNN: 8.5.0

In onnxruntime/contrib_ops/cuda/fused_conv.cc

image

If I edit it to below and build wheel, will it work?
cudnnactivationmode-t struct

  Status MapMode(const std::string& activaton_mode) {
    if (activaton_mode == "Relu") {
      activation_mode_ = cudnnActivationMode_t::CUDNN_ACTIVATION_RELU;
    } else if (activaton_mode == "Sigmoid")
      activation_mode_ = cudnnActivationMode_t::CUDNN_ACTIVATION_SIGMOID;
    else {
      return ORT_MAKE_STATUS(
          StatusCategory::ONNXRUNTIME, StatusCode::INVALID_ARGUMENT,
          "unsupported conv activation mode \"", activaton_mode, "\"");
    }
    return Status::OK();
  }
  cudnnActivationMode_t activation_mode_;
  cudnnActivationDescriptor_t activation_desc_ = nullptr;
};

btw, cpu is supported. image

To reproduce

In onnx model, use FusedConv, and activation is "Sigmod".

Urgency

No response

Platform

Linux

OS Version

Ubuntu 20.04

ONNX Runtime Installation

Released Package

ONNX Runtime Version or Commit ID

onnxruntime-gpu 1.17.1

ONNX Runtime API

Python

Architecture

X64

Execution Provider

CUDA

Execution Provider Library Version

CUDA 11.8 and cuDNN 8.5.0

marktohark avatar May 17 '24 10:05 marktohark