From e55b57d771777bcea594c838f4f17a634255dad1 Mon Sep 17 00:00:00 2001 From: ViperEkura <3081035982@qq.com> Date: Fri, 13 Mar 2026 23:00:26 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E6=A2=AF=E5=BA=A6?= =?UTF-8?q?=E5=B9=B3=E5=9D=87=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- khaosz/trainer/trainer.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/khaosz/trainer/trainer.py b/khaosz/trainer/trainer.py index 823511c..89faf26 100644 --- a/khaosz/trainer/trainer.py +++ b/khaosz/trainer/trainer.py @@ -86,8 +86,7 @@ class Trainer: context.iteration += 1 # to make the loss normalized by accumulation steps - stand_batch = self.train_config.accumulation_steps * self.train_config.nprocs - stand_loss = loss / stand_batch + stand_loss = loss / self.train_config.accumulation_steps stand_loss.backward() self._call_callbacks('on_batch_end', context)