Skip to content

orbax to reg checkpointer conversion #1246

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

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

lkolluru05
Copy link
Contributor

@lkolluru05 lkolluru05 commented Jun 6, 2025

Command

Orbax Emergency test:

`axlearn gcp bundle --name=$NAME
--bundler_spec=allow_dirty=True
--bundler_type=artifactregistry
--bundler_spec=dockerfile=Dockerfile
--bundler_spec=image=tpu
--bundler_spec=target=tpu

axlearn gcp launch run --cluster=stoelinga-axlearn
--runner_name gke_tpu_single
--name=$NAME
--instance_type=tpu-v6e-16
--host_mount_spec=name=tmp,host_path=/tmp,mount_path=/host-tmp
--num_replicas=3
--bundler_spec=allow_dirty=True
--bundler_type=artifactregistry --bundler_spec=image=tpu
--bundler_spec=dockerfile=Dockerfile --bundler_spec=target=tpu
-- python3 -m axlearn.common.launch_trainer_main
--init_module=axlearn.common.checkpointer_orbax_emergency:local_ckpt_dir=/host-tmp/checkpoints
--module=text.gpt.c4_trainer
--config=fuji-7B-v2-flash-orbaxem
--trainer_dir=$OUTPUT_DIR
--data_dir=gs://axlearn-public/tensorflow_datasets
--jax_backend=tpu
--mesh_selector=tpu-v6e-16
--trace_at_steps=3`

Orbax test

`axlearn gcp bundle --name=$NAME
--bundler_spec=allow_dirty=True
--bundler_type=artifactregistry
--bundler_spec=dockerfile=Dockerfile
--bundler_spec=image=tpu
--bundler_spec=target=tpu

axlearn gcp launch run --cluster=lkolluru-axlearn
--runner_name=gke_tpu_pathways
--name=$NAME
--instance_type=tpu-v6e-16
--num_replicas=1
--bundler_spec=allow_dirty=True
--bundler_type=artifactregistry --bundler_spec=image=tpu
--bundler_spec=dockerfile=Dockerfile --bundler_spec=target=tpu
-- python3 -m axlearn.common.launch_trainer_main
--init_module=axlearn.common.checkpointer_orbax
--module=text.gpt.c4_trainer
--config=fuji-7B-v2-flash-orbax
--trainer_dir=$OUTPUT_DIR
--data_dir=gs://axlearn-public/tensorflow_datasets
--jax_backend=proxy
--mesh_selector=tpu-v6e-16
--trace_at_steps=3`

Comment on lines +828 to +829
logging.info("Saving an AXLearn tensorstore from the restored Orbax state...")
save_axlearn_checkpoint(step, restored_state, cfg.dir, cfg.name)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I understand it correctly, here we're still using an online approach to do the checkpoint conversion. This means that we have to allocate the same resource (or at least a slice) of training stage for each checkpoint conversion.

I'm wondering if we can do the conversion offline on a CPU only node with a large memory.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants