Add configurable console metrics filter with presets#523
Draft
YujiaBao wants to merge 2 commits intothinking-machines-lab:mainfrom
Draft
Add configurable console metrics filter with presets#523YujiaBao wants to merge 2 commits intothinking-machines-lab:mainfrom
YujiaBao wants to merge 2 commits intothinking-machines-lab:mainfrom
Conversation
Add ConsoleMetricsFilter and preset system ("compact", "detailed", "all")
to control which metrics appear in the console table. Default is "compact"
which shows only key metrics (reward, progress, timing phases). All metrics
are always written to metrics.jsonl regardless of the console filter.
A one-time hint is logged when metrics are filtered, telling users how to
see more: set console_metrics='all' or 'detailed'.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Include turns_per_episode, ac_tokens_per_turn, ob_tokens_per_turn in the compact preset so users see rollout behavior at a glance. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
3ea9585 to
f68be50
Compare
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.
Summary
Add a configurable filter system for the console metrics table (
PrettyPrintLogger), with named presets that users can select via CLI or Config.Depends on #522 (telemetry unification).
Motivation
The console table shows ~50 metrics per step. Most users only care about a handful (reward, progress, key timing). The rest is useful for debugging but clutters the default view. All metrics are always written to
metrics.jsonlregardless of the console filter.Changes
ConsoleMetricsFilterdataclass (ml_log.py)Pattern-based filter using
fnmatchglobs:include: list of patterns — metric must match at least one to be shownexclude: list of patterns — metric is hidden if it matches any (takes precedence)Three presets (
CONSOLE_METRICS_PRESETS)"compact"(default for training Configs): Shows key metrics — reward, correct/format, rollout stats (turns, tokens), progress, optim, and top-level timing (time/total,time/sampling,time/train_step). ~16 rows instead of ~50."detailed"(default for directsetup_logging()callers): Shows everything except:total/:countaggregates."all": No filtering — shows every metric.Config integration
New
console_metrics: str = "compact"field on all three training Configs (RL, SL, DPO). Passed through tosetup_logging().Discoverability
On the first
log_metricscall where metrics are filtered, a one-time hint is logged:CLI usage
Backward compatibility
setup_logging()callers (e.g.,rl_loop.py,sl_loop.py) that don't passconsole_metricsget"detailed"— same behavior as before."compact"— UX change (fewer metrics shown), but the hint message tells users how to see more.metrics.jsonl, Wandb, Neptune regardless of the console filter.Before/after console output (RL sync, step 0)
Before (59 keys in metrics.jsonl, all shown in console):
39
time/*rows + 13env/*rows + 7 other = ~59 rowsAfter (compact preset, 16 rows in console, 51 keys in metrics.jsonl):
Test plan
ruff format,ruff check,pyrightclean (0 new errors)test_recipe_math_rl::test_math_rl_synce2e smoke test passes with compact presetmetrics.jsonl(verified: 51 keys)🤖 Generated with Claude Code