-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FusedConv Cuda EP invalid argument error. #12321
Comments
@kiennguyen94: thanks for reporting this - we are on a similar issue #11548. |
@kiennguyen94 : BTW, for your case mind share us a model and some sample script to double confirm the fix working? |
@RandySheriffH Sorry for the late reply, here's the repro https://github.com/kiennguyen94/ort_load_repro. I have the fix in this temp draft PR #12366. This PR fixes this particular repro, but I'm not sure if it introduces unwanted behavior. |
@kiennguyen94, thanks! For this issue your fix #12366 should work, plan to bring it in along with other fixes into https://github.com/microsoft/onnxruntime/tree/FuseConvShapeMismatch. |
For anyone else who runs into this issue: we were able to circumvent this by by turning off optimizations. sess_opt = ort.SessionOptions()
sess_opt.graph_optimization_level = ort.GraphOptimizationLevel.ORT_ENABLE_BASIC
return ort.InferenceSession(onnx_path, providers=providers, sess_options=sess_opt) The theory being that some of the optimizations lead to a graph which cannot be executed using CUDA, while the ONNX file itself is fine. |
Describe the bug
When running models with conv layers with optimization, ORT throws the following error
Urgency
None
System information
ddb45e9
, also observed with 1.12To Reproduce
tar xvzf ./citrinet.tgz && python ./final_repo.py
Expected behavior
Screenshots
None
Additional context
onnxruntime/onnxruntime/contrib_ops/cuda/fused_conv.cc
Line 87 in de57daa
CUDNN_STATUS_BAD_PARAM
, which means either dimension ofZ
andY
don't match, or incompatible datatype. (per Cudnn docs)Z
is the output of some previous OP, it can have missing dimension, (egZ
is[1, 1024, 16]
whereasY
is[1, 1024, 16, 1]
)cuda/FusedConv
? If so, I think simply adding a dimension check if len(Z.shape) == len(Y.shape) - 1: extend Z.shape by 1, then setORT_RETURN_IF_ERROR(s_.z_tensor.Set(new_z_dim, CudnnTensor::GetDataType<CudaT>()));
right around hereonnxruntime/onnxruntime/core/providers/cuda/nn/conv.cc
Line 231 in de57daa
Reshape
onZ
beforeFusedConv
. But given thatcpu/FusedConv
works fine, I don't think we want this.The text was updated successfully, but these errors were encountered: