-
-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Why load_balanced_view use so many memory? #539
Comments
The IPython client is spending all its time serializing 100k messages here. The main thing is that a load balanced view creates one message per item by default, which is 100k tasks in this case. That's a lot! The second is that IPython has special-handling of numpy arrays, preserving the arguments as numpy arrays through serialization, and reconstructing the result as a numpy array. That means that IPython is creating 100,000 single-field numpy arrays to send and then serializing them. This saves a lot when sending large arrays, but costs a lot when sending a very large number of tiny arrays. It's not sending You'll see much better behavior if you don't use a numpy array for this very simple case, or if you use e.g. You might also consider the new |
How to |
source = range(1024)
gen = view.imap(lambda x: x, source)
for result in tqdm.tqdm(gen, total=len(source)):
... |
After you cancel, what do you get for |
I take a look the Windows Task Manager, python no CPU usage, but it still stucks. |
Do simple executions work? |
Can you call getpid before the code that's causing the problem? |
Does |
The text was updated successfully, but these errors were encountered: