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 time statistics for nccl-connection. #6673

Merged
merged 1 commit into from
Aug 10, 2023
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
6 changes: 6 additions & 0 deletions paddlenlp/trainer/training_args.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import json
import math
import os
import time
import types
import warnings
from dataclasses import asdict, dataclass, field
Expand Down Expand Up @@ -873,7 +874,12 @@
"The enable_stage1_tensor_fusion or enable_stage1_overlap is not supported "
"by current version of Paddle. Please try latest develop Paddle."
)
paddle.device.cuda.synchronize()
Copy link
Collaborator

Choose a reason for hiding this comment

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

额,这里会不会有其他设备 跑 混合并行呢? 比如 npu?

start_time = time.time()

Check warning on line 878 in paddlenlp/trainer/training_args.py

View check run for this annotation

Codecov / codecov/patch

paddlenlp/trainer/training_args.py#L877-L878

Added lines #L877 - L878 were not covered by tests
fleet.init(is_collective=True, strategy=strategy)
paddle.device.cuda.synchronize()
elapsed = time.time() - start_time
logger.info("NCCL-Connection costs {:.2f} ms.".format(elapsed))

Check warning on line 882 in paddlenlp/trainer/training_args.py

View check run for this annotation

Codecov / codecov/patch

paddlenlp/trainer/training_args.py#L882

Added line #L882 was not covered by tests

logger.info(strategy)

Expand Down