Library such as pandas and scikit-learn have global config options. These options are not passed to jobs spawned by joblib (with a multiprocess backend):
from joblib import Parallel, delayed
from sklearn import get_config, config_context
def get_working_memory():
return get_config()['working_memory']
with config_context(working_memory=123):
results = Parallel(n_jobs=2)(
delayed(get_working_memory)() for _ in range(2)
)
results
# [1024, 1024]
Related: #1064
Scikit-learn specific fix: scikit-learn/scikit-learn#17634