question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Library specific global options are not passed to jobs

See original GitHub issue

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: https://github.com/joblib/joblib/issues/1064 Scikit-learn specific fix: https://github.com/scikit-learn/scikit-learn/pull/17634

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:2
  • Comments:13 (12 by maintainers)

github_iconTop GitHub Comments

2reactions
thomasjpfancommented, Jun 22, 2020

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:

import joblib

joblib.register_global_config(getter=sklearn.get_config,
                              setter=sklearn.set_config)
1reaction
lestevecommented, Jun 19, 2020

I would think the culprit is very likely cloupickle if I had to do an extra wild-guess (feeling a bit adventurous this morning 😉)

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found