Commit b48eb36
Fix W&B step mismatch by consolidating log calls (#15204)
The W&B _step counter was showing approximately 2x the actual
global_step because `log('global_step')` and `log('step')` were
called separately, causing WandbLogger's internal _step counter
to increment twice per training step.
This fix consolidates both metrics into a single `log_dict()` call
in all three strategy files, ensuring W&B step aligns correctly
with trainer.global_step for accurate cross-run comparisons.
Files modified:
- nemo/lightning/pytorch/strategies/megatron_strategy.py
- nemo/lightning/pytorch/strategies/fsdp_strategy.py
- nemo/lightning/pytorch/strategies/fsdp2_strategy.py
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <[email protected]>1 parent 1a3c291 commit b48eb36
File tree
3 files changed
+15
-24
lines changed- nemo/lightning/pytorch/strategies
3 files changed
+15
-24
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
401 | 401 | | |
402 | 402 | | |
403 | 403 | | |
404 | | - | |
405 | | - | |
406 | | - | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
407 | 409 | | |
408 | 410 | | |
409 | 411 | | |
410 | 412 | | |
411 | 413 | | |
412 | | - | |
413 | | - | |
414 | | - | |
415 | | - | |
416 | | - | |
417 | 414 | | |
418 | 415 | | |
419 | 416 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
181 | 181 | | |
182 | 182 | | |
183 | 183 | | |
184 | | - | |
185 | | - | |
186 | | - | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
187 | 189 | | |
188 | 190 | | |
189 | 191 | | |
190 | 192 | | |
191 | | - | |
192 | | - | |
193 | | - | |
194 | | - | |
195 | | - | |
196 | 193 | | |
197 | 194 | | |
198 | 195 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
800 | 800 | | |
801 | 801 | | |
802 | 802 | | |
803 | | - | |
804 | | - | |
805 | | - | |
| 803 | + | |
| 804 | + | |
| 805 | + | |
| 806 | + | |
| 807 | + | |
806 | 808 | | |
807 | 809 | | |
808 | 810 | | |
809 | 811 | | |
810 | | - | |
811 | | - | |
812 | | - | |
813 | | - | |
814 | | - | |
815 | 812 | | |
816 | 813 | | |
817 | 814 | | |
| |||
0 commit comments