Inconsistent joblib.Parallel behaviour between v0.12 and v0.14 when running from within an imported module?
See original GitHub issueI have a joblib.Parallel
statement which is run from within an imported module. From v0.12 to v0.12.5 it works nicely, but with v0.13+ it goes serial with no errors.
The schema of my code (which spans several files) follows. Input arguments are omitted for the sake of readability.
# main file
import f1
for _ in range(n):
f1()
# file containing f1
import f2
def f1():
# do something with f2
return something
# file containing f2
def f2():
def help():
return something
joblib.Parallel(delayed(help)) # parallel with loki backend
return something
I tried to find some information online regarding joblib.Parallel
and its use on nested functions, with no luck.
However, if I change my workflow as follows
# main file
import f1
joblib.Parallel(delayed(f1)) # parallel with loki backend
# file containing f1
import f2
def f1():
# do something with f2
return something
# file containing f2
def f2():
def help():
return something
for _ in range():
# run help() in serial with a plain for loop
return something
everything starts working also with v0.14.
What am I missing? And why with joblib v0.12-0.12.5 it works fine but with joblib v0.13+ it goes serial?
Issue Analytics
- State:
- Created 3 years ago
- Comments:10 (6 by maintainers)
Top Results From Across the Web
Cannot use imported modules with joblib #13632 - GitHub
Run joblib with an imported local function. This will generate an error "ModuleNotFoundError: No module named 'MyOwnModule' ending up with ...
Read more >Your First Machine Learning Project in Python Step-By-Step
In this step we are going to load the iris data from CSV file URL. 2.1 Import libraries. First, let's import all of...
Read more >Changelog — sktime documentation
We keep track of changes in this file since v0.4.0. ... This was inconsistent previously between types of transformers: the series-to-series ...
Read more >Release 0.21.3 unknown - Pyodide
Pyodide makes it possible to install and run Python packages in the ... using the js module (see Importing JavaScript objects into Python)....
Read more >Introduction to Python for Econometrics, Statistics and Data ...
14 Dates and Times ... 28.6 Other Concerns when executing in Parallel . ... programs due to backward incompatible changes in a module....
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
@ogrisel
Sorry, since you were mentioning errors or tracebacks I thought you meant bugs as errors/crashes.
I will try my best to provide a minimal working example.
Hi @pierreglaser I have updated my code snippet with info on joblib’s backends.
I will try to craft a minimal working example, but this ain’t going to be easy. Unfortunately, things are quite nested here. I’ll try to work it out anyway