Skip to content

Commit

Permalink
[Trainer] Add time statistics for nccl-connection. (PaddlePaddle#6673)
Browse files Browse the repository at this point in the history
  • Loading branch information
GhostScreaming authored Aug 10, 2023
1 parent 31a5ff2 commit 40bbcb7
Showing 1 changed file with 6 additions and 0 deletions.
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 @@ -883,7 +884,12 @@ def __post_init__(self):
"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()
start_time = time.time()
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))

logger.info(strategy)

Expand Down

0 comments on commit 40bbcb7

Please sign in to comment.