+1 vote
in Machine Learning by (351k points)
To use multiple CPUs for CatBoostClassifier(), I am using its parameter 'thread_count'. But it does not work. What parameter should I use to use multiple CPUs?

1 Answer

+2 votes
by (56.8k points)
selected by
 
Best answer

I think 'thread_count' has been deprecated in the latest release of the CatBoost. You need to use two parameters, 'devices' and 'task_type', to specify multiple CPUs or GPUs. 

The possible values for the parameter 'task_type' are 'CPU' and 'GPU'. 

For the parameter 'devices', you can specify the unit ID, multiple unit IDs, or a range of unit IDs. E.g. 'devices'='1' (single unit), 'devices'='0:4:5' (multiple units), 'devices'='0-16' (range of units).

Here are some examples:

For CPU:

from catboost import CatBoostClassifier

model = CatBoostClassifier(iterations=500, task_type='CPU', devices='0-4') # to use 0 to 4 CPUs

For GPU:

model = CatBoostClassifier(iterations=500, task_type='GPU', devices='0-4') # to use 0 to 4 GPUs


...