LMFuser 0.0.2__tar.gz → 0.0.3__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: LMFuser
3
- Version: 0.0.2
3
+ Version: 0.0.3
4
4
  Summary: The LMFuser training framework.
5
5
  Project-URL: Homepage, https://github.com/TYTTYTTYT/LMFuser
6
6
  Project-URL: Documentation, https://github.com/TYTTYTTYT/LMFuser
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "LMFuser"
7
- version = "0.0.2"
7
+ version = "0.0.3"
8
8
  requires-python = ">= 3.11"
9
9
  description = "The LMFuser training framework."
10
10
  readme = "README.md"
@@ -438,6 +438,7 @@ class DDPRunner(Runner[DDPRunnerConfig]):
438
438
  self.scaler.scale(loss).backward()
439
439
  else:
440
440
  loss.backward()
441
+
441
442
  running_loss = dist_avg(running_loss)
442
443
  self.step_log({f'{task.__class__.__name__}/train/loss': running_loss})
443
444
  self.step_log({'train/epoch': self.epoch})
@@ -453,6 +454,8 @@ class DDPRunner(Runner[DDPRunnerConfig]):
453
454
 
454
455
  grad_norm_clip_val = self.config.grad_norm_clip.value()
455
456
  if grad_norm_clip_val is not None:
457
+ if self.scaler is not None:
458
+ self.scaler.unscale_(self.optimizer)
456
459
  norm = clip_grad_norm_(
457
460
  parameters=self.model.parameters(),
458
461
  max_norm=grad_norm_clip_val
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes