Skip to content

feat(adapter/nemo): add keep_mlf_checkpoint_on_train_end flag - #103

Merged
kkkapu merged 2 commits into
mainfrom
keep_checkpoint
Apr 17, 2026
Merged

feat(adapter/nemo): add keep_mlf_checkpoint_on_train_end flag#103
kkkapu merged 2 commits into
mainfrom
keep_checkpoint

Conversation

@kkkapu

@kkkapu kkkapu commented Apr 17, 2026

Copy link
Copy Markdown
Collaborator

This change will add a keep_mlf_checkpoint_on_train_end flag to MLFlashpointCheckpointCallback. It defaults to False, but when set to True, it skips the deletion of the final checkpoint at the end of training. This ensures the
last checkpoint can be preserved for use in E2E testing.

This change will add a `keep_mlf_checkpoint_on_train_end` flag to
MLFlashpointCheckpointCallback. It defaults to False, but when set to
True, it skips the deletion of the final checkpoint at the end of
training. This ensures the
last checkpoint can be preserved for use in E2E testing.

Change-Id: Ic238a9dc94fbd9d3c556f0ad1484e277a21fc71e
@kkkapu
kkkapu requested review from Leahlijuan and g-husam April 17, 2026 14:45
trainer.strategy.checkpoint_io.remove_checkpoint(self.base_container.data)
else:
_LOGGER.info(
"Local rank 0: Skipping final checkpoint cleanup due to keep_mlf_checkpoint_on_train_end=True."

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit:

normally we should not use f-strings in log statements, but this variable is just a boolean, so stringifying it always is cheap, and this allows us to auto log the variable name with its value

Suggested change
"Local rank 0: Skipping final checkpoint cleanup due to keep_mlf_checkpoint_on_train_end=True."
"Local rank 0: Skipping final checkpoint cleanup because keep_mlf_checkpoint_on_train_end=%s.", self.keep_mlf_checkpoint_on_train_end

self.skip_every_n_steps = skip_every_n_steps if skip_every_n_steps is not None else 0
self._enabled = enabled
self._replication_manager = None
self.keep_mlf_checkpoint_on_train_end = keep_mlf_checkpoint_on_train_end

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: let's make this "private" as well:

Suggested change
self.keep_mlf_checkpoint_on_train_end = keep_mlf_checkpoint_on_train_end
self._keep_mlf_checkpoint_on_train_end = keep_mlf_checkpoint_on_train_end

Change-Id: I5ca3c29cf84ede858c39b280ec263210039d83ea
@github-actions

Copy link
Copy Markdown

Python Code Coverage Summary

Code Coverage

Package Line Rate Branch Rate Health
src.ml_flashpoint 100% 100%
src.ml_flashpoint.adapter 100% 100%
src.ml_flashpoint.adapter.megatron 97% 95%
src.ml_flashpoint.adapter.nemo 98% 93%
src.ml_flashpoint.adapter.pytorch 99% 92%
src.ml_flashpoint.checkpoint_object_manager 93% 93%
src.ml_flashpoint.core 95% 92%
src.ml_flashpoint.replication 81% 81%
Summary 95% (2383 / 2514) 91% (569 / 622)

Minimum allowed line rate is 90%

@github-actions

Copy link
Copy Markdown

C++ Code Coverage Summary

Code Coverage

Package Line Rate Branch Rate Health
src.ml_flashpoint.checkpoint_object_manager.buffer_object 93% 54%
src.ml_flashpoint.checkpoint_object_manager.object_manager 69% 33%
src.ml_flashpoint.replication.transfer_service 79% 41%
Summary 81% (930 / 1142) 43% (702 / 1638)

Minimum allowed line rate is 80%

@kkkapu
kkkapu merged commit 4bdfa00 into main Apr 17, 2026
7 checks passed
@kkkapu
kkkapu deleted the keep_checkpoint branch April 17, 2026 18:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants