Skip to content
Merged
Changes from 2 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
8 changes: 8 additions & 0 deletions megatron/core/dist_checkpointing/state_dict_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,14 @@ def save_preprocess(
sharded_part = filter_out_empty_flatten_tensor(sharded_part)
if validate_access_integrity:
preprocessed_common_state_dict = common_state_dict
# M4 clean up dp_cp_group from metadata
from megatron.training.checkpointing import _clean_metadata_for_serialization

Comment thread
yaoyu-33 marked this conversation as resolved.
Resolved
if "content_metadata" in preprocessed_common_state_dict:
preprocessed_common_state_dict["content_metadata"] = _clean_metadata_for_serialization(
preprocessed_common_state_dict["content_metadata"]
)

if preprocess_common_before_consistancy_check:
preprocessed_common_state_dict = preprocess_common_before_consistancy_check(
common_state_dict
Expand Down