Add standalone checkpointer benchmark features and Orbax configuratio… - #4698
Open
Marlon666 wants to merge 1 commit into
Open
Add standalone checkpointer benchmark features and Orbax configuratio…#4698Marlon666 wants to merge 1 commit into
Marlon666 wants to merge 1 commit into
Conversation
…n flags - Add checkpoint_save_use_replica_parallel and checkpoint_storage_pytree_chunk_size_bytes configuration flags to types.py and base.yml (tracked by b/536987093). - Wire checkpoint_save_use_replica_parallel through create_orbax_checkpoint_manager and register Orbax ArrayHandler/SingleReplicaArrayHandler with replica parallel support. - Support custom PyTree chunk size bytes override during checkpoint saving. - Add per_step_interval and drop_page_cache_before_restore configuration flags for standalone checkpointer storage benchmarking. - Update standalone_checkpointer.py loop to execute save, optional interval wait, optional Linux OS page cache eviction, and restore on each step iteration.
Marlon666
requested review from
RissyRan,
SurbhiJainUSC,
abhinavclemson,
bvandermoon,
gagika,
gobbleturk,
hengtaoguo,
khatwanimohit,
richjames0,
shralex and
vipannalla
as code owners
July 31, 2026 23:46
|
Caution The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased. |
Marlon666
requested review from
A9isha,
NuojCheng,
aireenmei,
darisoy,
dipannita08,
huytransformer,
igorts-git,
jiangjy1982 and
xibinliu
as code owners
July 31, 2026 23:46
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR introduces first-class configuration capabilities to
standalone_checkpointer.pyand Orbax checkpointing managers to natively support downstream checkpoint storage benchmarking without requiring file overwriting. See b/540420675 for more of the detailsHow this is a change from the past & Problem being solved
Previously, downstream benchmarking repositories (such as Tessellations) had to manually override 6 core MaxText Python/YAML files using Docker
COPYcommands to inject custom checkpointing benchmark behavior (e.g., save + restore loop, interval delays, cache dropping, and Orbax sharding parameters). This approach caused fragility and code drift whenever upstream MaxText refactored its codebase.This PR eliminates the need for file overwriting by turning these benchmarking requirements into first-class, optional configuration flags in upstream MaxText. Downstream users can now directly use the stable public MaxText Docker image.
Specific Implementation Details
src/maxtext/configs/types.py&src/maxtext/configs/base.yml):checkpoint_save_use_replica_parallel,checkpoint_storage_pytree_chunk_size_bytes,per_step_interval,drop_page_cache_before_restore, andstandalone_checkpointer_enable_restore_in_loop.None,0.0, orFalse) inbase.ymlto guarantee zero breaking changes to existing MaxText workloads.src/maxtext/common/checkpointing.py&src/maxtext/utils/train_utils.py):checkpoint_save_use_replica_parallelintocreate_orbax_checkpoint_managerto register JAXArrayHandlerandSingleReplicaArrayHandlerwith replica parallel support.checkpoint_storage_pytree_chunk_size_bytesoverride inocp.args.PyTreeSavewhile decoupling target file size (ocdbt_target_data_file_size) from array chunking size (chunk_byte_size).TODO(b/536987093): Validate Orbax upstream API changes before closing bug.).src/maxtext/utils/standalone_checkpointer.py):if jax.process_index() == 0:blocks for clean logging and interval sleep (per_step_interval), backed by full-cluster barrier synchronization (sync_global_devices).sudo sh -c 'echo 3 > /proc/sys/vm/drop_caches') and checkpoint restoration underif config.standalone_checkpointer_enable_restore_in_loop:.BUGS: b/540420675, b/536987093
Tests
python3 -m py_compileacross all 5 modified files (types.py,base.yml,checkpointing.py,train_utils.py,standalone_checkpointer.py) with zero syntax or linter errors (git diff --check).standalone_checkpointer_enable_restore_in_loop=False,drop_page_cache_before_restore=False), existing checkpointing regression tests (tests/unit/checkpointing_test.py,end_to_end/test_checkpointing.sh) continue to pass without any breaking changes.To exercise the bidirectional Save + Wait + Cache Eviction + Restore storage benchmark loop:
Checklist
Before submitting this PR, please make sure (put X in square brackets):
gemini-reviewlabel.