Conversation
There was a problem hiding this comment.
Code Review
This pull request re-enables and configures the Orbax checkpoint Cloud Logger to route save and restore step statistics to Cloud Logging for ML Goodput. It introduces helper functions to attach the logger to Orbax v1 Checkpointer internals and log restore statistics. The review feedback highlights several areas where auxiliary logging operations could potentially crash the training run due to unexpected exceptions (such as changes in Orbax internals, API failures, or GCP credential issues) and recommends wrapping these operations in try-except blocks to ensure robustness.
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
lydhr
force-pushed
the
goodput_orbax_v1_logger
branch
from
September 30, 2026 22:23
a55195b to
41b18c1
Compare
This branch has not been deployed
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
Restore Orbax checkpoint Cloud Logging for ML Goodput after the Orbax V1 migration.
The V1 migration removed
enable_checkpoint_cloud_logger:setup_checkpoint_loggerandcreate_orbax_checkpoint_managernow only log a warning and drop the logger [cl/974668260]. This is because the Orbax V1ocp.training.Checkpointerhas nologgerargument, and it builds its internal V0CheckpointManagerwith the defaultStandardLogger, which doesn't write to Cloud Logging. As a result, checkpoint save/restore step statistics no longer reach thegoodput_<run_name>log, and Goodput cannot measure checkpoint save/restore badput.This PR:
src/maxtext/common/checkpointing.py:setup_checkpoint_logger: creates the OrbaxCloudLoggeragain (log namegoodput_<run_name>) whenenable_checkpoint_cloud_logger=true. IfCloudLoggerisn't available, it warns and returnsNone.create_orbax_checkpoint_manager: attaches the logger to the V1Checkpointer's internal V0 manager, so V0-compatible save step statistics are logged again. This relies on a private attribute until Orbax V1 exposes a public logger option (TODO: b/529622681). If the internal attribute is missing, it warns instead of crashing.load_state_if_possible: V1load_checkpointablesskips the internal manager's restore logging, so restore step statistics (RestoreStepStatistics) are logged around the load.src/maxtext/utils/train_utils.py: updates the outdated comment and removes a pylint suppression that no longer applies.BUGS: b/568044767
Tests
Tested on TPU v6e-8 with
enable_goodput_recording=true monitor_goodput=true enable_checkpoint_cloud_logger=true steps=20 checkpoint_period=5, then resumed the same run withsteps=25:event_type="save", steps 0/5/10/15/19) withcheckpoint_manager_blocking_start_time/checkpoint_manager_blocking_duration_secsare back in the Goodput log: Log Explorer (save)event_type="restore") is logged, followed by saves at steps 20/24: Log Explorer (restore).Note: with checkpoint entries back,
ml-goodput-measurement0.2.3 reportsProductive training time is invalidon this short async-checkpoint run (same symptom as b/553561110). That is a calculator-side issue, tracked separately.Checklist
Before submitting this PR, please make sure (put X in square brackets):
gemini-reviewlabel.