Repository navigation
fix(inverse_if): grade with the policy model server, as the README documents - #4941
Merged
Merged
Conversation
Contributor
Author
|
/ok to test 4a8e9e8 |
…cuments Both README `gym env start` commands load only inverse_if and the policy model, and the README's Basic Setup names `policy_model` as the judge, but inverse_if.yaml referenced a `judge_model` server whose only definition was commented out. Config validation rejected the dangling reference (ServerRefNotFoundError) before any rollout, on every model. Point judge_model_server at policy_model, matching multichallenge.yaml that this config was derived from. Keep the commented judge_model block as the example for grading with a separate endpoint, with the override that selects it. Add a regression test that replays each README start command through the CLI and resolves it offline against placeholder policy values. Co-Authored-By: Claude Fable 5.1 <[email protected]> Signed-off-by: qiaochuz <[email protected]>
qiaochuz-nv
force-pushed
the
qiaochuz/nvb-6790320-inverse-if-judge-model
branch
from
November 7, 2026 07:22
4a8e9e8 to
9a412c3
Compare
Contributor
Author
|
/ok to test 9a412c3 |
…test tree #5589 mirrors nemo_gym packages under tests/unit_tests; the sibling README config tests live in tests/unit_tests/benchmarks and import nemo_gym.config.global_config (the nemo_gym.global_config path only resolves through the moved-module shim, with a warning). Follow them. Signed-off-by: qiaochuz <[email protected]>
Contributor
Author
|
/ok to test 0761237 |
yaoyu-33
approved these changes
Nov 18, 2026
yaoyu-33
left a comment
Contributor
There was a problem hiding this comment.
LGTM. The README launch now resolves the judge correctly, with explicit separate-judge overrides preserved. All 22 focused tests passed.
Contributor
|
🔄 Merge queue validation started! You can track the progress here: https://github.com/NVIDIA-NeMo/Gym/actions/runs/44431985655 |
Contributor
|
🔄 Merge queue validation started! You can track the progress here: https://github.com/NVIDIA-NeMo/Gym/actions/runs/44434151015 |
This branch was previously deployed
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.
What does this PR do?
The Inverse IF README's start command (
gym env start --resources-server inverse_if --model-type vllm_model) now starts. Onmainit exits 1 at config validation before any rollout:inverse_if.yamlreferences ajudge_modelserver that nothing in the README's stack defines. The failure is the same on every model type.Fixes NVBug 6790320. Closes #4503.
Cause
resources_servers/inverse_if/configs/inverse_if.yaml:24-26pointsjudge_model_serveratjudge_model, and the only definition of that server (:128-136) is commented out — both since the file was added in #1529. The config was derived frommultichallenge.yaml, which shipsname: policy_modelwith the same commented-outjudge_modelblock; inverse_if flipped the name without shipping a definition. The README was written for policy-as-judge throughout: both start commands load onlyinverse_ifand the policy model, "Basic Setup" namespolicy_modelas the judge, and nojudge_*value is documented anywhere. Config validation rejects the dangling reference (nemo_gym/global_config.py,ServerRefNotFoundError).Fix
inverse_if.yaml:judge_model_server.name: policy_model. This is the only change to the parsed config; the README commands and its Basic Setup already match it. The header comment now says the policy model judges by default, and the commentedjudge_modelblock stays as the example for grading with a separate endpoint, together with the override that selects it (++inverse_if.resources_servers.inverse_if.judge_model_server.name=judge_model).tests/unit_tests/test_inverse_if_readme_config.py: finds everygym env startblock in the README (asserts there are two), replays each through the real CLI withdispatchintercepted, resolves the overrides offline withGlobalConfigDictParserand placeholder policy values (noenv.yaml), and asserts the judge reference resolves topolicy_modelwith the policy server defined. Onmainit fails with the NVBug's error.Not chosen: an opt-in
configs/judge_model.yamlloaded with--config(the terminus_judge shape from #4557). That README had documented a dedicated judge that a later config change broke; this README never described one, so that fix would have edited both README commands and started a second model server by default for an environment whose docs and sibling (multichallenge) are policy-as-judge. Also not chosen: definingjudge_modelinsideinverse_if.yaml, which would stop a recipe that defines its ownjudge_modelwith another adapter from composing.Before the fix
Gym
80ace9f0f:gym env validate --strict --resources-server inverse_if --model-type vllm_model \ ++policy_base_url=http://127.0.0.1:9/v1 ++policy_model_name=Qwen/Qwen3-8B '++policy_api_key='Exit 1. The QA run that filed the bug hit the same three lines in
stack.logfrom the README'sgym env start; no server started and no inference ran.After the fix
Gym
0761237e2(this branch, rebased on69a514999; main's later inverse_if changes — #4953, #4837, #5108 — leave the judge reference untouched), same command:Exit 0. QA testcase
inverse_if(the README start command with a case-owned Qwen3-8B vLLM on one H100, all five example rows, per-criterion live judging, and four controlled/verifycalls): PASS 1/1 on this branch (202 s onc434dc221, this same change on thec62f9cc67base; an earlier run on the80ace9f0fbase also passed). Onmainthe same case stops at startup with the error above (the NVBug's runs on06123724,804c12a7, and r0.7.0 rc1).Validation
tests/unit_tests/test_inverse_if_readme_config.py: 2 failed / 1 passed onmain, 3 passed on this branch.test_global_config,test_cli_main,test_cli_resources_servers,test_checkpoint_server_declarations,test_environment_scaffold,test_ray_opt_out,test_task_data::TestSchemaPresence, the terminus_judge README test): 593 passed.gym env test --resources-server inverse_if: 19 passed.pre-commit run --all-files: passed, no changes.policy_model, as judge; shipped judge params 8192/0.7/0.8):All 4 / 4 servers ready;gym eval runon the five committed example rows wrote 5/5 rollouts with an empty failures sidecar; every responsecompleted, every rowmask_sample: false; 15 judge calls, each with a parsedPASS/FAILverdict and explanation; rewards 1.0, 1.0, 0.67, 1.0, 1.0 (run onc434dc221, the same diff on thec62f9cc67base) (example_3, the letter-swap task, is the one the policy gets partly wrong; in the earlier run it rendered C++ as'+ + C'and the judge failed the "exactly five languages" and "first/last letter swapped" criteria with matching explanations);mean/reward0.933, identical from the eval run's aggregate and from replaying the rows through/aggregate_metrics. Four controlled/verifycalls on the same stack (reference answer, all-wrong answer, mixed, and reference wrapped in<thinking>) scored exactly their expected[1,1,1],[0,0,0],[1,0,1],[1,1,1].Compatibility
A stack started from the shipped config goes from failing validation to grading with the policy model. A user config that defines its own
judge_modeland relied on the shipped reference now needs the one-line override above; nothing in this repo does (benchmarks/nemotron_3.5_super/reward_profilingalready repoints inverse_if tonl2bash_judge_model). No data or scoring change.