Using mp.Pool() hangs while using jax library #17219
Unanswered
mpvanderschelling
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I've got the following issue
I'm using a multiprocessing library (
pathos.multiprocessing
to be exact), and I'm parallelizing a functionrun_optimization
Optimizer
,Function
andSampler
are all custom object. I'm rerunning this function-call with a multitude of seeds. I've parallized this with themp.Pool()
function:This all worked fine, until I ported a jax-based optimizer (
CMA_ES
from the libraryevosax
).Now, the call to pool.starmap makes the program hang, and it seems like it is waiting on resources:
I think that the problem is that
evosax
(and thusjax
) is using multiple cores to do it's internal computation, and thus no resources for multithreading withpathos
are available, thus it hangs.What I've tried solutions in #743 and #2685 by setting environ variables when I first import jax:
However I still get the same results: the call to mp.Pool() hangs because it cannot find the necessary resources.
Can someone point me in the right direction to fix this?
Beta Was this translation helpful? Give feedback.
All reactions