Skip to content
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

[question] is there a way to set the number of cores/threads used? #5

Open
matrs opened this issue Nov 15, 2023 · 0 comments
Open

[question] is there a way to set the number of cores/threads used? #5

matrs opened this issue Nov 15, 2023 · 0 comments

Comments

@matrs
Copy link

matrs commented Nov 15, 2023

When running this code with 100+ images:

ibed = imgbeddings()
ibed.to_embeddings(images)

All the cores are being used and at times, 100% of the cpu is being used (AMD laptop and desktop is the same). This isn't a problem by itself, but i would like to control this behavior given that I want to run this in a server. When i look at this onnxruntime issue , I see the last comment where a user mentions that sess.run() always uses multiple threads when using the python bindings (I haven't used the onnxruntime directly, only read some code of this library), and here, the official docs mention some option to control the number of threads used.

Here is the profiling of one of my runs in a amd laptop with 4 cores/8 threads.
create_embs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant