The meaning of "n_jobs == 1" in GridSearchCV with using multiple GPU

Viewed 8110

I have been training NN model by using Keras framework with 4 NVIDIA GPU. (Data Row Count: ~160,000, Column Count: 5). Now I want to optimize its parameter by using GridSearchCV.

However, I encountered several different errors whenever I tried to change n_jobs to other values than one. Error, such as

CUDA OUT OF MEMORY
Can not get device properties error code : 3

Then I read this web page, "# if you're not using a GPU, you can set n_jobs to something other than 1" http://queirozf.com/entries/scikit-learn-pipeline-examples

So it is not possible to use multiple GPU with GridSearchCV?

[Environment] Ubuntu 16.04 Python 3.6.0 Keras / Scikit-Learn

Thanks!

1 Answers

According to the FAQ in scikit learn - GPU is NOT supported. Link

You can use n_jobs to use your CPU cores. If you want to run at maximum speed you might want to use almost all your cores:

import multiprocessing
n_jobs = multiprocessing.cpu_count()-1
Related