kempnerforge.config.checkpoint¶
Checkpoint configuration.
Functions
|
Whether an exclude list asks for the weights-only warm start. |
|
Check an exclude list: a list of distinct DCP keys, |
Classes
Checkpointing settings. |
|
A bounded step range with a registered checkpoint strategy. |
- class kempnerforge.config.checkpoint.AsyncCheckpointMode[source]¶
Bases:
StrEnum- disabled = 'disabled'¶
- async_ = 'async'¶
- async_pinned = 'async_with_pinned_mem'¶
- __new__(value)¶
- class kempnerforge.config.checkpoint.DynamicCheckpointWindow[source]¶
Bases:
objectA bounded step range with a registered checkpoint strategy.
Inside
[start, stop]the strategy decides which steps to save, and every such step is exempt fromCheckpointConfig.keep_last_nretention. Outside the window the regularCheckpointConfig.intervalcadence applies."power2"(default) saves atstartand at everystart + 2^kwhile<= stop– tight at the start of the window, doubling thereafter. New strategies register via@registry.register_dyn_ckpt_strategy(name)and become selectable by settingstrategy.
- kempnerforge.config.checkpoint.is_weights_only(keys)[source]¶
Whether an exclude list asks for the weights-only warm start.
- kempnerforge.config.checkpoint.validate_exclude_keys(keys, name)[source]¶
Check an exclude list: a list of distinct DCP keys,
"train_state"only in the pair.
- class kempnerforge.config.checkpoint.CheckpointConfig[source]¶
Bases:
objectCheckpointing settings.
- dyn_ckpt_window: DynamicCheckpointWindow | None = None¶
- async_mode: AsyncCheckpointMode = 'disabled'¶
- should_save(step)[source]¶
Whether to write a checkpoint at
step.Inside
dyn_ckpt_window: the registered strategy decides (default"power2"saves atstartand eachstart + 2^kwhile<= stop). Outside the window: everyintervalsteps. Dynamic milestones are exempt fromkeep_last_n(seeCheckpointManager._cleanup).
- is_dynamic_milestone(step)[source]¶
True if
stepis a milestone of the configureddyn_ckpt_window.CheckpointManager._cleanupexcludes these fromkeep_last_nso the dense early-window checkpoints survive a finite retention.
- __init__(dir='checkpoints', interval=1000, dyn_ckpt_window=None, async_mode=AsyncCheckpointMode.disabled, keep_last_n=3, load_path=None, export_dtype='bfloat16', exclude_from_loading=<factory>, ignore_freeze_mismatch=False, ignore_rank_state_mismatch=False)¶
- Parameters:
- Return type:
None