-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
onnxruntime.InferenceSession hangs #20354
Comments
Hi @justinchuby, I am wondering if this could be related to the intro of new transformations 124160. Do you think it could be the case? (sorry to bother you again) |
I suspect there maybe another cause. Could you test with the latest ONNX Runtime release to see if it is still an issue? |
Thanks for checking @justinchuby! I tested now with 1.17.3 and it is still the case :/ |
Is the model open source? Could you share source code to it? |
Please try the following: set the env var model_proto = onnx.load("model.onnx")
inlined = onnx.inliner.inline_local_functions(model_proto)
onnx.save(inlined, "model_inlined.onnx") not guaranteed to succeed but curious if that would help. |
Try different optimization levels and see if this affects the outcome. |
Some observations: the model has ~350k nodes |
|
This code runs, and returns the inlined model. The InferenceSession log now shows an error:
|
Would just this make the inference session take too long to start or not start at all? |
Thanks for the reply @yuslepukhin What is the correct way to debug this? I have no information about where to look for this operation in the original code. I am assuming this is a conversion error. |
The model inlining takes a lot of time. Stand by. |
I have optimized the model and now I can start the inference session and run it. Thank you @yuslepukhin and @justinchuby :) |
Awesome! Curious what was done? |
The initial model fails the check from ONNX:
Graph must be in single static assignment (SSA) form, however '_inlfunc_IsScalar_tmp' has been used as output names multiple times. ==> Context: Bad node spec for node. Name: _inlfunc_aten_mean_dim_n1 OpType: If |
The graph had many constant that were created by the model inside functions, I initialized those with the model instead. Also there were some conversion errors like: |
Do you mean turning
Could you share a concrete example? |
Hello @doloresgarcia , |
I mean just matrices that were created inside functions that were used in many layers. So a solution was to add those as arguments of the main model class and pass them to those layers. This reduced the time to start inference and now it works quickly. |
I am using the |
Okay, thank you for the quick reply. |
Describe the issue
Hi! I have exported an onnx model from pytorch and I am trying to use it for inference, but the onnxruntime.InferenceSession hangs without any error
I have tried this on linux and mac. When using strace, it does not show anything after the last message
The model can be found here:
model
To reproduce
The log gives this:
Urgency
This is a key step to use our model in production
Platform
Linux
OS Version
Linux 9.3
ONNX Runtime Installation
Released Package
ONNX Runtime Version or Commit ID
1.16.3
ONNX Runtime API
Python
Architecture
X86_64
Execution Provider
Default CPU
Execution Provider Library Version
No response
The text was updated successfully, but these errors were encountered: