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

[Bug Fix] fix allreduce tensor dtype #7876

Merged
merged 2 commits into from
Jan 25, 2024
Merged
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
2 changes: 1 addition & 1 deletion paddlenlp/trainer/trainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -626,7 +626,7 @@
# The resume_from_checkpoint could be None in some machine node.
# Here we reset None to temp directory.
if args.world_size > 1:
is_resume_from_checkpoint = paddle.to_tensor([resume_from_checkpoint is not None])
is_resume_from_checkpoint = paddle.to_tensor([resume_from_checkpoint is not None], dtype="int32")

Check warning on line 629 in paddlenlp/trainer/trainer.py

View check run for this annotation

Codecov / codecov/patch

paddlenlp/trainer/trainer.py#L629

Added line #L629 was not covered by tests
paddle.distributed.all_reduce(is_resume_from_checkpoint)
is_resume_from_checkpoint = is_resume_from_checkpoint.item()
if is_resume_from_checkpoint > 0 and is_resume_from_checkpoint < paddle.distributed.get_world_size():
Expand Down