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.

BUG: parallel crashes when array too big.

See original GitHub issue

I am not sure whether this is a bug or a bad parametrization on my part, but I get an error when passing a unique large arrays to Parallel with max_nbytes=None, and n_jobs > 1.

from joblib import Parallel, delayed
import numpy as np

def func(X):
    pass

X = np.random.rand(841, 306, 1445)
chunks = map(list, zip(*[np.array_split(X, 1)]))  # note n_jobs > n_splits

parallel = Parallel(-1, max_nbytes=None)
p_func = delayed(func)

out = parallel(p_func(chunk) for chunk in chunks)

However, it works is max_nbytes isn’t provided, or when the array is smaller.

This issue is replicable on ubuntu 14.04 + anaconda build with joblib 0.9.4 and numpy 1.11.0

It may be related to https://github.com/joblib/joblib/issues/138

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:14 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
lestevecommented, Jun 20, 2016

So this is bleeding edge from pickle? Shall we add an explicit error when more than 2**31 bytes are sent through the socket?

It’s not pickle but multiprocessing. You can have a look at https://bugs.python.org/issue17560 for more details. I think this quote extracted from it pretty much sums it up:

But I can’t help feeling that multigigabyte arrays should be transferred using shared mmaps rather than serialization.

0reactions
kingjrcommented, Jul 12, 2016

ok thanks @lesteve & @ogrisel

Read more comments on GitHub >

github_iconTop Results From Across the Web

OpenMP Crashing with Large Arrays - fortran - Stack Overflow
Specifying -fopenmp in GNU Fortran implies -frecursive which means that all local variables (even large arrays) are automatic (i.e. allocated on the stack)....
Read more >
Error reading and/or creating large meshes - FEAP User Forum
There seems to be a bug in parallel FEAP which effects reading or creating very large meshes. The bug is triggered mostly when...
Read more >
Resolve "Out of Memory" Errors - MATLAB & Simulink
MATLAB has built-in protection against creating arrays that are too large. For example, this code results in an error, because MATLAB cannot create...
Read more >
R session crash for a multinomial model; Multiple Indexing in ...
R session crash for a multinomial model; Multiple Indexing in arrays ... For another, I get the error for parallel chains ... (2)[array...
Read more >
[Compute Shader] Compiler crashes when trying to read value ...
Update nope, it just moved the error, Definitely connected to arrays - Update confirmed nothing todo with the shader being too big, ...
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