Hi all.
I’m trying to figure out whether the default behavior for Booster.predict
in the Python API is to utilize all available threads. I came across a number of posts on the default threading behavior specifically in the context of model training, but couldn’t find the same information for model prediction.
I did find this GitHub comment from 2016, but found the following statement counter-intuitive, given that predict
was known to be thread unsafe as documented in this issue among a few others.
the model would by default use all the available threads (as if nthread=0), provided that
OMP_NUM_THREADS
environment variable wasn’t set.
I tried digging into the C++ source code and even attempted to look into OpenMP but haven’t had much luck, as I have limited experience in either.
Thanks in advance!