From 95bc1a1a030178e50f89c134ee1fda1ee54c6d98 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 23 Mar 2026 16:20:32 +0800 Subject: [PATCH] Fix wandb logging step and metrics reporting --- swift/rlhf_trainers/utils.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/swift/rlhf_trainers/utils.py b/swift/rlhf_trainers/utils.py index ee54daaf4b..91f902300f 100644 --- a/swift/rlhf_trainers/utils.py +++ b/swift/rlhf_trainers/utils.py @@ -584,7 +584,10 @@ def profiling_context(trainer, name: str): end_time = time.perf_counter() duration = end_time - start_time - profiling_metrics = {f'profiling/Time taken: {trainer.__class__.__name__}.{name}': duration} + profiling_metrics = { + f'profiling/Time taken: {trainer.__class__.__name__}.{name}': duration, + "step": trainer.state.global_step + } is_main_process = False if hasattr(trainer, 'accelerator'):