Skip to content

Commit

Permalink
Add time statistics for nccl-connection.
Browse files Browse the repository at this point in the history
  • Loading branch information
GhostScreaming committed Aug 9, 2023
1 parent 8b927a5 commit 2cf4655
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 @@ -873,7 +874,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()

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

0 comments on commit 2cf4655

Please sign in to comment.