Skip to content

Commit 7bf31a3

Browse files
authored
Add main process print (#8604)
1 parent 439f8f3 commit 7bf31a3

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

paddlenlp/trainer/trainer_utils.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,17 @@
5858
"get_last_checkpoint",
5959
"get_scheduler",
6060
"set_hyrbid_parallel_seed",
61+
"log_trainer_start",
6162
]
6263

6364

65+
def log_trainer_start():
66+
if "MAIN_PROCESS_STARTED" not in os.environ:
67+
start_time = time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())
68+
logger.info(f"The Training Main Process Started Successfully. time: {start_time}, pid: {os.getpid()}")
69+
os.environ["MAIN_PROCESS_STARTED"] = "1"
70+
71+
6472
def _get_distributed_seeds(seed: int = 1234, topo: Topology = None):
6573
"""
6674
Get the seeds from distributed environment strategy.

0 commit comments

Comments
 (0)