Skip to content
Discussion options

You must be logged in to vote

Hi Garo,

GPy doesn’t expose n_jobs on classifiers. CPU use comes from the BLAS backend under NumPy (and from whatever launches many fits in your bootstrap).

  1. Try setting thread limits before Python starts, or at the very top of the script before any import numpy / import GPy:
OMP_NUM_THREADS=2 OPENBLAS_NUM_THREADS=2 MKL_NUM_THREADS=2 \
VECLIB_MAXIMUM_THREADS=2 NUMEXPR_NUM_THREADS=2 python your_script.py
  1. Or after imports, with threadpoolctl:
from threadpoolctl import threadpool_limits
with threadpool_limits(limits=2):
    model = GPy.models.GPClassification(X_train, Y_train, kernel)
    model.optimize()
  1. If you use optimize_restarts(..., parallel=True), that spawns processes. You can use …

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by lawrennd
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