8000 fix grpo save checkpoint by hjh0119 · Pull Request #3865 · modelscope/ms-swift · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

fix grpo save checkpoint #3865

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

Merged
merged 2 commits into from
Apr 14, 2025
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
3 changes: 3 additions & 0 deletions swift/trainers/rlhf_arguments.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,6 @@ def __post_init__(self):
# https://github.com/modelscope/ms-swift/issues/3237
self.deepspeed['zero_optimization']['stage3_prefetch_bucket_size'] = 0
self.deepspeed_plugin.hf_ds_config.config['zero_optimization']['stage3_prefetch_bucket_size'] = 0

# https://github.com/modelscope/ms-swift/issues/3863
self.dataloader_drop_last = True
2 changes: 1 addition & 1 deletion swift/trainers/rlhf_trainer/grpo_trainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -1082,7 +1082,7 @@ def compute_loss(self, model, inputs, return_outputs=False, num_items_in_batch=N

# Log metrics or return them
if return_outputs:
metrics['completions_length'] = completions_length
metrics['completions_length'] = completions_length.item()
return loss, metrics
else:
for key, value in metrics.items():
Expand Down
Loading
0