Skip to content

Commit ed42f16

Browse files
BeingGodxysheng-baidu
authored andcommitted
[Bug Fix] fix allreduce tensor dtype (PaddlePaddle#7876)
* [Bug Fix] fix allreduce tensor dtype Reason: some CCL not support bool dtype * update int8 to int32
1 parent 724b524 commit ed42f16

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

paddlenlp/trainer/trainer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -631,7 +631,7 @@ def train(
631631
# The resume_from_checkpoint could be None in some machine node.
632632
# Here we reset None to temp directory.
633633
if args.world_size > 1:
634-
is_resume_from_checkpoint = paddle.to_tensor([resume_from_checkpoint is not None])
634+
is_resume_from_checkpoint = paddle.to_tensor([resume_from_checkpoint is not None], dtype="int32")
635635
paddle.distributed.all_reduce(is_resume_from_checkpoint)
636636
is_resume_from_checkpoint = is_resume_from_checkpoint.item()
637637
if is_resume_from_checkpoint > 0 and is_resume_from_checkpoint < paddle.distributed.get_world_size():

0 commit comments

Comments
 (0)