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.
- {lmfuser-0.0.2 → lmfuser-0.0.3}/PKG-INFO +1 -1
- {lmfuser-0.0.2 → lmfuser-0.0.3}/pyproject.toml +1 -1
- {lmfuser-0.0.2 → lmfuser-0.0.3}/src/lmfuser/runners/ddp_runner.py +3 -0
- {lmfuser-0.0.2 → lmfuser-0.0.3}/.github/workflows/python-publish.yml +0 -0
- {lmfuser-0.0.2 → lmfuser-0.0.3}/.gitignore +0 -0
- {lmfuser-0.0.2 → lmfuser-0.0.3}/.vscode/settings.json +0 -0
- {lmfuser-0.0.2 → lmfuser-0.0.3}/LICENSE +0 -0
- {lmfuser-0.0.2 → lmfuser-0.0.3}/README.md +0 -0
- {lmfuser-0.0.2 → lmfuser-0.0.3}/src/lmfuser/__init__.py +0 -0
- {lmfuser-0.0.2 → lmfuser-0.0.3}/src/lmfuser/model_loader.py +0 -0
- {lmfuser-0.0.2 → lmfuser-0.0.3}/src/lmfuser/optimizers.py +0 -0
- {lmfuser-0.0.2 → lmfuser-0.0.3}/src/lmfuser/runners/__init__.py +0 -0
- {lmfuser-0.0.2 → lmfuser-0.0.3}/src/lmfuser/runners/runner.py +0 -0
- {lmfuser-0.0.2 → lmfuser-0.0.3}/src/lmfuser/schedulers.py +0 -0
- {lmfuser-0.0.2 → lmfuser-0.0.3}/src/lmfuser/task.py +0 -0
- {lmfuser-0.0.2 → lmfuser-0.0.3}/src/lmfuser/utils.py +0 -0
|
@@ -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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|