Library specific global options are not passed to jobs
See original GitHub issueLibrary 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: https://github.com/joblib/joblib/issues/1064 Scikit-learn specific fix: https://github.com/scikit-learn/scikit-learn/pull/17634
Issue Analytics
- State:
- Created 3 years ago
- Reactions:2
- Comments:13 (12 by maintainers)
Top Results From Across the Web
can I declare a global variable in a shared library?
Yes, libraries can contain global variables. But depending on compiler/linker options, they might be not visible ...
Read more >Extending with Shared Libraries - Jenkins
All global variables defined in a Shared Library should be stateless, i.e. they should act as collections of functions. If your pipeline tried...
Read more >Manual Jobs - Ex Libris Knowledge Center
Name Content Type (set type) Type
Delete Local Authority Records Authority MMS Withdraw
Export Authority Records Authority MMS Export
Add Bib to Collection Bibliographic title MARC21...
Read more >Define variables - Azure Pipelines | Microsoft Learn
Global variables defined in a YAML are not visible in the pipeline settings UI. Variables at the job level override variables at the...
Read more >A Future for R: Common Issues with Solutions
If a global variable is used in a future expression that conditionally ... In short, it is not possible to automatically identify global...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I think it would not be possible for joblib to tell “where the configuration are stored and should be passed into the spawn processes” unless the library somehow registers the how to set and get the configuration from the library.
For scikit-learn it could be something like:
I would think the culprit is very likely cloupickle if I had to do an extra wild-guess (feeling a bit adventurous this morning 😉)