Wordle: matched-Tinker posture, harness metric superset, and comparison script - #16
Draft
qywu wants to merge 1 commit into
Draft
Conversation
Aligns examples/wordle with rl-bench's wordle_convergence harness contract while keeping every shipped preset's behavior unchanged (new trainer flags default to the current GRPO semantics): - trainer.advantage_std_normalization / skip_zero_advantage_trajectories / remove_constant_reward_groups: group mean-centred advantages with no std rescaling, every member of a kept group trained (zero-advantage episodes count in XoRL's valid-token loss denominator), and group-level zero-variance drops with a deterministic keep-one fallback (mirrored in the pipeline-restore path so stored totals still verify). - PPO wire params: explicit use_tis=false for XoRL (unknown keys are silently ignored server-side, so the known key is stated), and use_tis stripped from Tinker/River requests. - backends.xorl.sync_pool_per_endpoint: per-endpoint pairwise NCCL pools (r0, r1, ...) with distinct rendezvous ports; one group spanning a multi-replica fleet is known to hang. - Metric superset: every committed step carries an 'overlay' block with the harness metric names (quality/*, env/all/*, optim/kl_sample_train_v1/v2/v3, optim/entropy, tokens/*, bench/*, perf/*, global_step), logged to W&B unprefixed on a global_step axis so curves overlay with harness runs on either stack; compute_k3_metrics gains sq_logratio_mean and abs_logratio_p99 to support the K1/K2 estimators. - configs/tinker_matched.yaml pins the matched posture (ppo clip 0.2/0.28, constant lr 1e-5, Adam 0.9/0.95/1e-8, grad clip 1.0, lora rank 32) for both the xorl and tinker backends. - examples/wordle/compare_tinker.py aligns two runs' metrics.jsonl step by step (overlay-aware with legacy fallback), prints a table, writes comparison.json, and can launch both legs itself with --launch.
Broly Security ScanNote Baseline snapshot is missing for this repo. Broly is running in PR-only fallback mode until the first scheduled baseline completes. This does not block the PR. Note ✅ Clean scan Note Re-scan this PR anytime with
|
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.
Stacked on #14. Aligns the unified Wordle example with the matched-Tinker convergence contract from
rl-bench/harnesses/xorl_client/wordle_convergence.py, adds the harness metric namespace as a superset of the existing metrics, and ships a Tinker comparison script.Training-semantics alignment (opt-in, defaults unchanged)
Three new
trainerflags; every shipped preset keeps its current behavior, andconfigs/tinker_matched.yamlflips them to the matched posture:advantage_std_normalization: false— group mean-centred advantages with no per-group std rescaling (Tinker never applies it).skip_zero_advantage_trajectories: false— every member of a kept group is trained. This matters beyond adding zeros: XoRL'spolicy_lossdenominator is the valid-token count, so dropping zero-advantage episodes silently rescales the gradient relative to Tinker.remove_constant_reward_groups: true— uniform-reward groups are dropped at the group level, with the cookbook's keep-one fallback when every group in a step is uniform (the optimizer step still runs, so Adam state stays step-aligned). The fallback is deterministic and mirrored in the pipeline-restore path so stored totals still verify on resume.Wire-level: PPO to XoRL now states
use_tis=falseexplicitly (XoRL silently ignores unknownloss_fn_paramskeys, so protection is stating the known key), anduse_tisis stripped from Tinker/River requests.tinker_matched.yamlpins clip offsets 0.2/0.28 (ratio bounds [0.8, 1.28] on both stacks via the existing per-backend mapping), constant LR 1e-5, Adam (0.9, 0.95, 1e-8), grad clip 1.0, LoRA rank 32.backends.xorl.sync_pool_per_endpoint: trueregisters each sampler as its own pairwise NCCL pool (r0,r1, …) with a distinct rendezvous port and syncs per pool — one group spanning a multi-replica fleet is known to hang (same fix as the harness).Metric superset
Every committed step now carries an
overlayblock with the rl-bench/Tinker names, logged to W&B unprefixed on a sharedglobal_stepaxis so curves overlay directly with harness runs; all existing metric names are untouched.quality/train_reward{,_std},quality/solve_rate,env/all/*,env/all/by_group/*optim/kl_sample_train_v1/v2/v3,optim/kl_abs_{mean,p99,max},optim/kl_tokensd = sampler − trainer, ourlogratio = trainer − sampler; K3 is symmetric)optim/entropy,optim/lr,optim/grad_norm,losstokens/*,bench/*,perf/*Unlike the harness's every-5-steps KL probe (an extra forward), these KL estimators come free every step from
return_per_token, so both schemas stay useful side by side.compute_k3_metricsgainssq_logratio_meanandabs_logratio_p99to support K1/K2.Tinker comparison script
examples/wordle/compare_tinker.pyaligns two runs'metrics.jsonlstep-by-step (overlay-aware, with a legacy-name fallback for older runs), prints a per-step table (reward / K3 / grad norm per stack), and writescomparison.jsonwith tail-mean reward gaps.--launchruns both legs itself throughexamples.wordle.trainwith one shared config.Deliberate non-goals
</guess>boundary) rather than adopting theverifierspackage; curves are comparable xorl-vs-tinker within this example, not byte-identical to rl-bench runs.Testing
tests/examples/wordle/test_matched_alignment.py(7 tests): matched config wire params for both backends, validator, mean-centring + zero-advantage retention, uniform-group drop +force_keep+ metric-diff bookkeeping, default-preset behavior preserved, overlay name/sign mapping, comparison report (overlay + legacy runs).tests/examples/wordle/+tests/test_types.pytests pass. The 17 failures intests/test_two_phase_integration.py/tests/test_execute_with_retries.pypre-exist on the Add unified Wordle training backends #14 branch (verified with this diff stashed).