Skip to content

Is botorch using multiple jobs (available CPU cores) by default? #2959

Closed Answered by saitcakmak
Hrovatin asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @Hrovatin. BoTorch does use multiple CPU cores (or threads) for its operations, but it is primarily due to PyTorch tensor operations rather than the scipy optimizer. We actually intentionally limit the scipy optimizer to a single thread, since having it multi-threaded while the underlying PyTorch operations are also multi-threaded leads to too many threads being spawned (aka oversubscription), which can slow things down significantly.

In short, BoTorch by default will try to utilize all CPU cores available to it where appropriate (though you won't see 100% utilization). If you'd like to limit it to use only a subset of the CPU, you can use torch.set_num_threads to specify this. This mi…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by saitcakmak
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants