Carry reward and per-token model_version, log reward/version metrics#562
Open
jlamypoirier wants to merge 1 commit into
Open
Carry reward and per-token model_version, log reward/version metrics#562jlamypoirier wants to merge 1 commit into
jlamypoirier wants to merge 1 commit into
Conversation
Add two optional per-token fields to the RL streaming schema and thread them through the data pipeline alongside `advantages` / `old_log_probabilities` (reusing `TokenDataDocument`/`TokenDataBatch`): - `reward`: the raw (un-normalized) reward, a per-rollout scalar broadcast per-token — distinct from the group-relative `advantage`. - `model_version`: the model version each token was generated under (documents-seen units), one per token, for staleness diagnostics. Both are optional (absent when the producer does not send them), so the batch/target plumbing guards on presence. The shared policy-gradient loss logs mean/max/min of each supplied field when `metrics != none` (GRPO and GSPO), registered only when the data is present. Staleness is `documents_seen - model_version`, derivable from the logged version stats and `documents_seen`. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
Claude Sonnet 5, on behalf of @jlamypoirier.
Summary
Extracted from #553, as an independent piece with no dependency on the
documents_seen/weights_readyPRs (#559, #561) — verified by cherry-picking this commit directly ontomainwith no involvement of the other two. The "staleness" framing (
documents_seen - model_version)is a usage note for whoever reads the logged metrics; the code here doesn't compute or need
documents_seenitself.Was briefly combined with the
weights_readybroadcast in #557 (now closed) before splittinginto fully independent pieces.
pipeline alongside
advantages/old_log_probabilities(reusingTokenDataDocument/TokenDataBatch):reward: the raw (un-normalized) reward, a per-rollout scalar broadcast per-token — distinctfrom the group-relative
advantage.model_version: the model version each token was generated under (documents-seen units),one per token, for staleness diagnostics.
guards on presence.
metrics != none(GRPO and GSPO).
Paired PipelineRL change (raw-reward forwarding) is in a separate PR against PipelineRL's
fast-llmbranch.Tests
tests/data/test_streaming.py(schema round-trip) andtests/layers/test_lm_losses.py(metric registration, single-process and distributed): 584 passed / 21 skipped, 23 passed.
model_versionconsumer and its metric are in place, but the producer(tagging tokens with the active version inside vLLM's output path) is a separate,
cluster-validated follow-up; until it lands, the
model_version/staleness metrics simply don'tpopulate.