GCS bucket-based checkpointing#
In this type of checkpointing, the checkpoints are saved directly to a Google Cloud Storage (GCS) bucket. This is the most straightforward and common method. The training process briefly pauses, for capturing the model’s state and keeping the training in sync with rest of the workers, then the model’s state is asynchronously serialized and written over the network to the specified GCS bucket.
Checkpoint loading priority#
The system follows a specific order when deciding which checkpoint to load at startup. The first valid condition met is the one executed:
Resume Current Run: If a checkpoint already exists for the current
run_name, the system loads the latest fully-saved checkpoint. This is the default behavior to ensure minimal state loss when resuming after an interruption.Load from Specific Path: The system checks for a user-specified path.
If
load_parameters_pathis set, we load a parameter only checkpoint from that path..If
load_full_state_pathis set, we load a full state checkpoint from that path.Note: These two options are mutually exclusive and will cause an error if both are set.
Initialize from Scratch: We don’t load a checkpoint and initialize state instead.
MaxText configuration#
Flag |
Description |
Type |
Default |
|---|---|---|---|
|
A master switch to enable ( |
|
|
|
When set to ( |
|
|
|
The interval, in training steps, for how often a checkpoint is saved. |
|
|
|
If |
|
|
|
Specifies a path to a checkpoint directory to load a parameter only checkpoint. |
|
|
|
Specifies a path to a checkpoint directory to load a full checkpoint including optimizer state and step count from a specific directory. |
|
|
|
Specifies a parent directory containing LoRA (Low-Rank Adaptation) adapters. |
|
|
|
If |
|
|
Storage and format configuration#
These settings control the underlying storage mechanism (Orbax) for performance and compatibility.
Flag |
Description |
Type |
Default |
|---|---|---|---|
|
Sets a target file size for Orbax to chunk large arrays into smaller physical files. This can dramatically speed up loading over a network and in distributed environments. |
|
|
|
If |
|
|
|
If |
|
|
|
Controls the concurrent I/O limit in gigabytes for the checkpointer. Larger models may require increasing this value to avoid I/O bottlenecks. |
|
|
|
A boolean flag to explicitly enable features and behaviors from Orbax version 1. |
|
|
|
Specifies the format of the checkpoint being loaded. This tells the system how to interpret the files at the source path. |
|
|
|
A user-defined function to process a loaded checkpoint dictionary into a format that the model can understand. This is essential for loading checkpoints from different frameworks or formats (e.g., converting keys from a Hugging Face SafeTensors file). |
|
|