-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
[Documentation] Can CPUEP infer multithread with one session? #22967
Comments
Sessions are stateless so you can call Run concurrently. |
Thank you very much for your reply. I have another question. Since Run can be called concurrently, does each Run in my example use 4 CPU cores? Is it possible to fully utilize all 16 CPU cores? |
Try setting onnxruntime/include/onnxruntime/core/session/onnxruntime_session_options_config_keys.h Line 118 in c5276ac
to 0, which might help |
@wejoncy Thank you very much for your reply. I tried this parameter, but it doesn't seem to work. I also noticed that when I set n threads, the total number of cores is n, and each thread seems to be limited to using only one CPU core? Are there any other settings that allow configuring the number of CPU cores each thread can use? |
Actually, "use 4 CPU cores" in one session is expected in one session even you run this session concurrently. you can set thread-numbers to 16 and run them in a batch. The session will use all cores then. |
Describe the documentation issue
I have one Ort::Session. Can I use multithreads with one session? My code is roughly set up like this and works, but during execution, it doesn't utilize all 16 CPU cores.
I would like to ask if this multi-threading approach is recommended. Is there a better way to implement multi-threaded inference to increase throughput?
Page / URL
No response
The text was updated successfully, but these errors were encountered: