Repository navigation
GRPO: file compute_loss metrics by model.training, not control.should_evaluate - #14112
Merged
danielhanchen merged 3 commits intoOct 19, 2026
Merged
Conversation
…_evaluate eval_on_start=True and a standalone trainer.evaluate() run in eval mode with control.should_evaluate still False, so their kl, completion_length and clip_ratio metrics were logged into the train bucket and eval got none. TRL picks the bucket from model.training; do the same.
danielhanchen
added a commit
that referenced
this pull request
Oct 18, 2026
…pability picks (#14138) ## Summary `Repo tests (CPU, studio)` fails on every PR whose base includes #14083, with the same single test: ``` tests/studio/test_model_picker_contracts.py::test_diffusion_capability_labeled_image_video_gen assert '{ value: "diffusion", label: "Image/video gen" }' in _read("features/hub/lib/model-type-filter.ts") ``` Seen on #14097, #14106, #14112, #14115, #14122 and #14125 (bases `72d0d2db`, `b4a4855e`, `4c5fb400`), and it reproduces on main at `1e2cedde`. ## Cause #14083 (Studio Hub: On Device filters and sort) moved the On Device list onto Discover's capability picks, on purpose. `model-type-filter.ts` no longer keeps its own `MODEL_TYPE_FILTER_OPTIONS` (which held `{ value: "diffusion", label: "Image/video gen" }`). Its `matchesInventoryCapabilities` now takes `HubCapabilityFilter` picks and matches them with Discover's own `matchesHubCapability`, so the On Device panel shows Discover's "Image gen" and "Video gen" tiles. The PR describes this as change 2. The product is right and the test is stale. What the test protects (#11681) is that the diffusion capability is never presented as "Image to text". That still holds: the only names now shown for it are Discover's "Image gen" / "Video gen" options and the capability badge's "Image gen" / "Video gen". ## Change Test only, `test_diffusion_capability_labeled_image_video_gen`: - **Kept as before:** - "Image to text" must not appear in the three hub files. - Discover's options must be `{ value: "image-gen", label: "Image gen" }` and `{ value: "video-gen", label: "Video gen" }`. - **New:** the capability badge in `model-capabilities.ts` must name the same two kinds. - **Replaced** the literal from the deleted On Device list. Now, if `model-type-filter.ts` has a `diffusion` option, it must still be labeled "Image/video gen". Otherwise the file must match through `matchesHubCapability`, so On Device cannot quietly grow a second, unchecked set of names. ## Testing - **This change:** `tests/studio/test_model_picker_contracts.py` gives 201 passed. - **Before (main `1e2cedde`):** the same file gives 1 failed, 200 passed, the failure CI shows. - **Each of these makes the test fail:** - Relabeling Discover's `image-gen` option "Image to text". - Renaming `matchesHubCapability` out of `model-type-filter.ts`, so On Device no longer shares Discover's matcher. - Adding back an On Device `{ value: "diffusion", label: "Image to text" }` option.
Member
|
@codex review |
1 similar comment
Member
|
@codex review |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex Review: Didn't find any major issues. Already looking forward to the next diff. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
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.
GRPO
compute_losspicked the metrics bucket fromcontrol.should_evaluate, which is still False foreval_on_start=Trueand a standalonetrainer.evaluate(). Those eval passes loggedkl,completion_lengthandclip_ratio/*into the train bucket, soeval_*got none and step-1train/completion_lengthaveraged in the eval batch.TRL uses
"train" if self.model.training else "eval"; this does the same. #11337 already moved the eval loss divisor tomodel.training.Test: new
tests/test_grpo_metrics_bucket.pylifts the shippedcompute_loss, stubs the zoo loss, and checks the bucket for train, eval_on_start and a scheduled eval. On main 2 of 4 fail ([] == [4.0], train length6.0instead of8.0); with the fix all 4 pass. CPU only, no GRPO run on a GPU.