Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add flag for saving only composer checkpoint #1356

Merged
merged 1 commit into from
Jul 15, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
6 changes: 6 additions & 0 deletions llmfoundry/train/train.py
Original file line number Diff line number Diff line change
Expand Up @@ -537,6 +537,12 @@ def train(cfg: DictConfig) -> Trainer:
hf_checkpointer_callback._save_checkpoint(trainer.state, trainer.logger)
return trainer

if train_cfg.only_composer_checkpoint:
log.info('Not training. Only saving composer checkpoint.')
trainer.save_checkpoint_to_save_folder()
log.info('Done saving checkpoint.')
return trainer

if train_cfg.log_config:
log.info('Logging config')
log_config(logged_cfg)
Expand Down
1 change: 1 addition & 0 deletions llmfoundry/utils/config_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ class TrainConfig:
load_ignore_keys: Optional[List[str]] = None
save_ignore_keys: Optional[List[str]] = None
only_hf_checkpoint: bool = False
only_composer_checkpoint: bool = False

# Dataloader
device_train_microbatch_size: Union[str, int, float] = 'auto'
Expand Down
Loading