scikit-learn: Importing sklearn messes with CPU affinity, causing n_jobs=-1 to become useless

Description

Please see a PoC notebook.

tl:dr: import sklearn causes CPU affinity to be set to {0}. Resetting it causes RandomizedSearchCV to freeze.

Expected Results

n_jobs=-1 uses all cores and does not freeze.

Actual Results

Only one core is loaded at 100% and nothing happens for 30+ minutes. Not resetting CPU affinity or not specifying n_jobs=-1 causes the freeze to go away.

Versions

Linux-4.14.36-1-MANJARO-x86_64-with-arch-Manjaro-Linux
Python 3.6.5 (default, Apr 12 2018, 22:45:43) 
[GCC 7.3.1 20180312]
NumPy 1.14.2
SciPy 1.0.1
Scikit-Learn 0.19.1

About this issue

  • Original URL
  • State: open
  • Created 6 years ago
  • Comments: 16 (7 by maintainers)

Most upvoted comments