Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions megatron/training/checkpointing.py
Original file line number Diff line number Diff line change
Expand Up @@ -1247,6 +1247,7 @@ def _load_global_dist_base_checkpoint(
sharded_state_dict,
checkpoint_name,
load_strategy,
validate_access_integrity=args.ckpt_load_validate_sharding_integrity,
strict=args.dist_ckpt_strictness,
)
return state_dict, checkpoint_name, release, CheckpointType.GLOBAL
Expand Down
5 changes: 5 additions & 0 deletions megatron/training/config/training_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -529,6 +529,11 @@ class CheckpointConfig:
ckpt_assume_constant_structure: bool = False
"""Assume the checkpoint structure is constant across saves to enable optimizations."""

ckpt_load_validate_sharding_integrity: bool = True
"""Whether to validate sharding access integrity when loading a distributed checkpoint.
When True (default), each tensor shard is checked to be accessed exactly once as main
replica by some rank. Disabling skips this validation"""

strict_fsdp_dtensor_load: bool = True
"""Whether to enforce strict loading for FSDP DTensor checkpoints. When False, allows partial loading."""

Expand Down
Loading