log(metrics): show exact step/samples + bump loss precision to 6dp#292
Merged
Conversation
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this does
The metrics log line was losing detail for two reasons:
format_big_numbercollapsesstep:15123tostep:15K, so 14903 and 15127 look identical in the log.:.3f, so a reall1_loss: 0.0001reads asl1_loss:0.000— indistinguishable from a true zero.This PR:
stepandsmplinMetricsTracker.__str__, e.g.step:15K(15123) smpl:968K(968000). Small values render asstep:42(42) smpl:336(336)— uniform shape across the whole run.total_loss,mse_loss,ce_loss,l1_loss) from:.3fto:.6fin both the training tracker and the validation tracker inscripts/train.py.accuracy,grad_norm, andlrare unchanged..github/scripts/check_loss_drop.py(mse_loss:([0-9.eE+-]+)) and.github/scripts/check_nonzero_grad_norm.py(grad_norm:([0-9.eE+-]+)) still match the new precision — the[0-9.eE+-]+char class captures0.105234just as cleanly as0.105.Example before / after:
Label: 📝 Documentation (logging cosmetics) — feel free to relabel.
How it was tested
test_metrics_tracker_str_step_and_samples_exact_valueandtest_metrics_tracker_str_step_and_samples_small_valueintests/utils/test_logging_utils.pycovering both the rounded (15K(15123)) and small (42(42)) cases.test_metrics_tracker_strstill passes — its assertions don't touch the step/samples columns.pytest tests/utils/test_logging_utils.py tests/utils/test_utils_utils.py tests/scripts/test_train.py→ 71 passed, 4 skipped, 0 failed.pytest -m "not gpu" -n auto). The 44 failures and 10 errors that remain are all pre-existing on the branch base (5dfd5df):tests/policies/test_pi07_paligemma_low_level_planner.py,tests/utils/test_hub.py,tests/utils/test_libero_utils.py(missingrobosuite),tests/datasets/test_loc_tokens_paligemma.py. None touch logging.pre-commit runon all changed files: clean.How to checkout & try? (for the reviewer)
To see the new format in a real log line, run a smoke training:
Checklist
Note: Before submitting this PR, please read the contributor guideline.
Generated by Claude Code