Replies: 2 comments 3 replies
-
Are you creating the sessions from an in memory array, or by loading the models from disk? |
Beta Was this translation helpful? Give feedback.
3 replies
-
In my experience it is the protobuf (de)serialization that is to blame. I'd love to be proven wrong, though! There is little to be (properly) done about this as long as the upstream ONNX project sticks with protobuf, IMHO. For now you may try to use onnxruntime's internal format, but it is not compatible between onnxruntime versions. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
I have small models that I load (onnx java) on a serverless platform with limited CPU and Memory.
I have tried reducing the amount of threads, increasing ram and such, but it seems that the creation of the session is still very slow (300-400ms).
I have tried to use multithreading to create sessions but seemingly there are some synchronizations going on.
What would be the fastest configuration both for global Ort::Environment and per session to truly load the models as fast as possible from the ONNX side, since it seems to react very differently when initializing sessions with multiple threads (java threads) versus a single thread.
Is there a right way to do it?
Beta Was this translation helpful? Give feedback.
All reactions