You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is there any parallel signaling method in JAX? I want to run parallel optimization on multiple nodes, and stop when all nodes have reached the stopping criterion.
One approach is use psum() every step to check the stopping criterion like below.
However, this will block nodes every step until all other nodes finished stepping.
@partial(jax.pmap, axis_name="num_devices")def_opt_runner(state):
# Evaluatedef_parallel_stop_cond(state):
is_finish=state.may_stop# Stop when all nodes have finished# However, psum will block until all nodes finished a stepis_finish=jax.lax.psum(is_finish, "num_devices") ==device_countreturnis_finishstate=jax.lax.while_loop(_parallel_stop_cond, _optimize_a_step, state)
# some other logic ...
Is there any non-blocking signaling approach, that every node notifies others when it finished, and stops when received notifications from all other nodes? (like code below)
@partial(jax.pmap, axis_name="num_devices")def_opt_runner(state):
# Evaluatedef_parallel_stop_cond(state):
# Stop when all nodes have finishedis_finish=state.may_stop# Notify all other devices that this node have finishedpnotify(is_finish)
# Stop if it get enough notificationsreturnpnotify_count() ==device_countstate=jax.lax.while_loop(_parallel_stop_cond, _optimize_a_step, state)
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Is there any parallel signaling method in JAX? I want to run parallel optimization on multiple nodes, and stop when all nodes have reached the stopping criterion.
One approach is use psum() every step to check the stopping criterion like below.
However, this will block nodes every step until all other nodes finished stepping.
Is there any non-blocking signaling approach, that every node notifies others when it finished, and stops when received notifications from all other nodes? (like code below)
Beta Was this translation helpful? Give feedback.
All reactions