Skip to content

ci: track, not gate, raw_reward in the Kimi K3 4-layer tests - #4576

Merged
Rockdu merged 1 commit into
mainfrom
ci/kimi-k3-track-raw-reward
Oct 31, 2026
Merged

Rockdu merged 1 commit into
mainfrom
ci/kimi-k3-track-raw-reward

Conversation

@Rockdu

@Rockdu Rockdu commented Oct 31, 2026

Copy link
Copy Markdown
Collaborator

What

  • rollout/raw_reward in the two Kimi K3 4-layer e2e tests is now tracked, not gated (constraint=None). This is the same mode as perf/actor_train_mfu: the value is still recorded and reported against its own history, but it never fails CI or untrusts a run.
  • No other gate changes. grad_norm, ppo_kl, train_rollout_logprob_abs_diff and train_rollout_kl keep their default bands.

Why

Both tests use --rm-type deterministic_random, because the pruned 4-layer model scores 0 on gsm8k. That reward is sha256(str(tokens) + response)[0] % 2 (miles/rollout/rm_hub/__init__.py). So raw_reward is the mean of 16 coin flips per step. It carries no model-quality signal, and no regression can lower its expected value of 0.5.

The default band floors it at 0.8 x mean. With the current baseline mean of 0.521875 the floor is 0.4175, so the gate fails at 6/16 or fewer. For 16 fair coins that happens 22.7% of the time.

Two more effects make it worse:

  • Step 1 is re-drawn on every run. The step-1 tokens change from run to run even on main with the same code. For example, the nightlies of 2026-10-14, 10-15 and 10-16 have bit-identical step-0 grad_norm (2.4867029190063477), yet their step-1 raw_reward was 0.375, 0.5 and 0.5625.
  • The baseline ratchets upward. A failing nightly is written with trusted=false, and the baseline reads only trusted rows. Low draws never enter the baseline, so its mean and floor keep drifting up.

Validation

Step-1 raw_reward from every scheduled PR Test nightly on main from 2026-10-09 to 10-30 (22 runs):

value 0.375 0.4375 0.5 0.5625 0.625
runs 2 3 5 9 3
  • Two main runs (10-12, 10-14) scored below today's 0.4175 floor. The gate was not enforcing yet then, so they did not fail.
  • On build(docker): bump SGLang to v0.5.23 #4548 (SGLang v0.5.23 bump), the gate failed with cur=0.3125 vs mean=0.521875 (n=20) outside [0.4175, inf]. Its step-0 rollout matched a main cluster (raw_reward 0.625, rollout logprob -10.22097). Its step-1 rollout logprob, logprob abs diff, train/rollout KL and grad norm were all inside the 22-run main range.

Local checks:

  • The parsed specs for both files give rollout/raw_reward: steps="all", constraint=None, enforce=False.
  • pytest tests/ci/test/{test_ci_register,test_history_gate,test_gate_integration,test_metric_selection,test_history_replay}.py: 374 passed. This includes test_every_training_e2e_with_a_history_gate_also_gates_mfu, which scans the e2e files.
  • ruff check on both files is clean.

Not in this PR: the band in GATE_DEFAULTS and the trusted-only baseline. Other tests with a real reward still need them.

Files

  • tests/e2e/megatron/model_scripts/test_kimi_k3_4layer_ci.py: rollout/raw_reward is tracked instead of gated.
  • tests/e2e/megatron/model_scripts/test_kimi_k3_4layer_lora_ci.py: same change.

Checklist

  • pre-commit run --all-files passes (not run; ruff check on the two changed files only)
  • Added/updated tests for new behaviour (no tests added; declaration-only change, covered by the existing gate parser tests)
  • pytest -x is green (partial: the tests/ci/test gate suites above, 374 passed; the full suite and the GPU e2e were not run)
  • If launch flags changed, python3 train.py --help still parses (n/a: no flags changed)
  • If a public flag was added, it appears in the CLI reference docs (n/a)
  • If an example was added, it has a real walkthrough (n/a)

🤖 Generated with Claude Code

Both tests use --rm-type deterministic_random, which scores a sample by
sha256(tokens + response)[0] % 2. raw_reward is therefore the mean of 16
coin flips per step and has nothing to regress. The default band
(floor 0.8 x mean, about 0.42) fails 6/16 or fewer, about 23% of fresh draws.
Two of 22 main nightlies (2026-10-12 and 10-14) scored 0.375 at step 1, and
#4548 failed on 0.3125.

Declare the metric with constraint=None so it is still recorded and
reported against its own history, the same as perf/actor_train_mfu. The
grad_norm, ppo_kl, train_rollout_logprob_abs_diff and train_rollout_kl
gates still cover rollout and train numerics.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Claude Code Review

This repository is configured for manual code reviews. Comment @claude review for a one-time review, or @claude review always to subscribe this PR to a review on every future push.

Tip: disable this comment in your organization's Code Review settings.

@Rockdu

Rockdu commented Oct 31, 2026

Copy link
Copy Markdown
Collaborator Author

@claude review

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code review found no issues

No high-confidence issues detected in this change.

@Rockdu
Rockdu enabled auto-merge (squash) October 31, 2026 04:16
@Rockdu
Rockdu disabled auto-merge October 31, 2026 04:17
@Rockdu
Rockdu merged commit c62ea5d into main Oct 31, 2026
29 checks passed
@Rockdu
Rockdu deleted the ci/kimi-k3-track-raw-reward branch October 31, 2026 04:19
@Rockdu Rockdu mentioned this pull request Oct 31, 2026
6 tasks done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant