Skip to content
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

Flip env sensing so we can launch gpu with checkpointing #540

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 5 additions & 5 deletions MaxText/max_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,15 +176,15 @@ def maybe_initialize_jax_distributed_system(raw_keys):

For CPUs, we call jax.distributed.initialize() explicitly, with the specified arguments.
"""
if (raw_keys["enable_checkpointing"] and raw_keys["async_checkpointing"]
if is_gpu_backend(raw_keys):
max_logging.log("Attempting to initialize the jax distributed system for GPU backend...")
initialize_jax_for_gpu()
max_logging.log("Jax distributed system initialized on GPU!")
elif (raw_keys["enable_checkpointing"] and raw_keys["async_checkpointing"]
and raw_keys["compile_topology_num_slices"]==-1) or raw_keys["hardware"]=='gpu_multiprocess':
max_logging.log("Attempting to initialize the jax distributed system...")
jax.distributed.initialize()
max_logging.log("Jax distributed system initialized!")
elif is_gpu_backend(raw_keys):
max_logging.log("Attempting to initialize the jax distributed system for GPU backend...")
initialize_jax_for_gpu()
max_logging.log("Jax distributed system initialized on GPU!")
elif is_cpu_backend(raw_keys):
max_logging.log("Attempting to initialize the jax distributed system for CPU backend...")
initialize_jax_for_cpu()
Expand Down