Repository navigation
feat(harbor): training metadata in the gym table, entry, rows and reward (M37) - #4860
Conversation
|
/ok to test efdd560 |
efdd560 to
46413e5
Compare
|
/ok to test 46413e5 |
46413e5 to
3570b60
Compare
|
/ok to test 3570b60 |
|
/ok to test 32a6231 |
ce6c93f to
32a6231
Compare
yuhezhang-ai
left a comment
There was a problem hiding this comment.
Reviewed 32a6231e against immediate stack parent #4827 (342968c5). Please address the three P2 items before approval: associate admission rules with the selected dataset, honor the explicit pairing override during preparation, and preserve compatibility with existing metrics for ordinary prepared datasets. The two P3 comments are non-blocking suggestions.
Focused CPU tests passed, and the three P2 behaviors were reproduced separately. This review did not include a real model/provider rollout or trainer integration run.
|
/ok to test b5ffbe3 |
|
/ok to test 4d758c8 |
|
/ok to test b3876ea |
|
/ok to test a33f451 |
|
/ok to test 26c6749 |
ffrujeri
left a comment
There was a problem hiding this comment.
Thanks for the thorough follow-ups. I re-checked the three P2 items at 26c6749, and each now has a regression test that reproduces the original case: the dispatch guard resolves the dataset entry by the rows' taskset across agent blocks, the early admission check honors the pairing override, and the per-split sidecar keeps the preparation fields. The reward_components contract is clearly documented as Harbor-specific and optional, and the sum check before results are emitted keeps rows consistent. Required CI is green; the only failure is the non-blocking kilocode conformance probe, which this PR doesn't touch. LGTM.
|
/ok to test a3272f9 |
|
/ok to test d0ade33 |
|
/ok to test 4f4efc3 |
|
/ok to test 01cd7e8 |
|
/ok to test 1693638 |
yuhezhang-ai
left a comment
There was a problem hiding this comment.
Thanks for the updates, Adil. I rechecked 16936389 against its current stack parent 2b803462. The early pairing override, per-split metadata compatibility, hostname fixtures, and component-reward documentation points are addressed.
The dataset-association point is partially fixed: the supported custom-name fallback still reproduces the unused-dataset rejection and the restriction bypass after rebinding. I added the reproduction details in the original thread; I would hold approval on that remaining P2.
…ard (M37) The [gym] table of dataset.toml gains allowed_agents, domain, verified and [gym.defaults].num_repeats. With license and type (M33) they flow into the generated datasets: entry (type is the effective split, benchmark without a license; the validation/TBD placeholders are gone) and the run's defaults: num_repeats becomes the run config's top-level count, which +num_repeats= replaces, and +split= follows the entry's type. gym dataset validate plays each reference solution once unless the command line sets a count: validation is not an evaluation. gym eval run refuses a harness outside allowed_agents as soon as dataset.toml is at hand, before any image is recorded or built or any server started, naming the harness and the list; the oracle is always admitted. The collector's pairing guard reads the entry's allowed_agents at dispatch too, so a run config edited to another harness afterwards is refused there as well (the Harbor environment server binds no resources server for the existing guard to read); the oracle's run config carries the entry without the list. A domain outside Gym's values is refused with the values named. Materialized rows carry task_source, the dataset folder's name (the parent's for a single task folder target inside a dataset, one whose parent holds a dataset.toml or a manifest.toml; a standalone task folder is labelled by its own name, so two unrelated task folders prepared from one scratch directory do not share its name; the taskset stays the target's), beside _ng_digest, and collate keeps it on materialized rows. The label is what a results row and a trainer read, not a routing key. The verifier applies the RFC reward rule: a reward key is the score and the other keys are metrics; without one every key is a component, the reward is their sum and the result names them as reward_components, only ever keys that sum to the reward (single turn, final and mean roll-ups; a roll-up that drops components says so in a warning naming the task). Several keys without reward is no longer a terminal failure; a non-finite sum is an invalid reward. Core: DatasetConfig and BenchmarkDatasetConfig accept domain, verified and allowed_agents (omitted from dumps when unset); BenchmarkDatasetConfig's prepare_script is optional for materialized datasets. The metrics sidecar data preparation writes beside a dataset's rows leaves domain, verified and allowed_agents out, like prepare_script: catalog declarations are not properties of the rows, so flipping verified after baselining, widening allowed_agents or changing domain between two runs of one taskset and harness does not conflict with the first run's sidecar (type and license still do, as for every Gym dataset, and the error names the file). A task's digest folds the [gym] table in only when it shapes tasks: identity, run and catalog keys (license, type, allowed_agents, domain, verified, num_repeats) leave every task at its bare folder hash. Docs in the harbor README and the Harbor tasks page. Co-Authored-By: Claude Fable 5.1 <[email protected]> Signed-off-by: Adil Asif <[email protected]>
|
/ok to test 6e09402 |
|
🔄 Merge queue validation started! You can track the progress here: https://github.com/NVIDIA-NeMo/Gym/actions/runs/40411825855 |
Summary
M37 of the Harbor task-format stack: training metadata. The
[gym]table of a dataset'sdataset.tomlgainsallowed_agents,domain,verifiedand[gym.defaults].num_repeats; together withlicenseandtype(M33) they flow into the generated run config'sdatasets:entry and the run's defaults. Materialized rows carrytask_source(the dataset folder's name) beside_ng_digest, and the verifier's result namesreward_components: only keys that sum to the reward.allowed_agentsis enforced bygym eval runbefore any work and by the collector's pairing guard at dispatch. None of the[gym]identity, run or catalog keys enters a task's digest.What changes
nemo_gym/tasks/harbor/dataset_config.py:allowed_agents(list of harness implementation names, validated: non-empty, distinct, no bare string),domain(one of Gym'sDomainvalues; any other value is refused with the values named),verified(strict bool, defaultfalse),[gym.defaults].num_repeats(strict int >= 1),admits(). None of them shapes a task.nemo_gym/tasks/harbor/task.py:task_digestfolds the[gym]table in only when it shapes tasks ([gym.defaults]scaling or a[gym.tasks]override). A table that declares onlylicense,type,allowed_agents,domain,verifiedornum_repeatsleaves every task at its bare folder hash, exactly as no table does (previouslylicense/typealone hashed an all-default slice in).nemo_gym/tasks/harbor/materialize.py:dataset_entry()builds thedatasets:entry from the table:type= effective split (validationwith a license, elsebenchmark),license,domain,verified,allowed_agents. Thevalidation/TBDplaceholders are gone.write_rowsstampstask_sourceon every row: the dataset folder's name, which is the taskset for a dataset target and the parent's name for a single task folder target inside a dataset (a parent that holds adataset.tomlor amanifest.toml: the folder whose table, image records and digests the preparation uses); a standalone task folder, whose parent holds neither, is labelled by its own name, so two unrelated task folders prepared from one scratch directory do not share its name. The taskset (routing, output paths, instance names) is unchanged. The label is what a results row and a trainer read, not a routing key.nemo_gym/tasks/harbor/cli.py:prepare_target(agent=...)refuses a harness outsideallowed_agentsas soon asdataset.tomlis at hand (after a hub fetch, before any manifest check, image record, build or server), naming the harness and the admitted list;gym eval runpasses the resolved--agent, the oracle path is always admitted. Anexampledataset is refused at the same point whatever the harness (refuse_example_dataset), so neithergym eval runnorgym dataset validatewrites a manifest, records or builds an image, or writes rows for smoke-test samples;build_runkeeps the check as a backstop for a hand-built taskset.PreparedTaskset.task_sourcecarries the label (_dataset_label).build_runwrites[gym.defaults].num_repeatsas the run config's top-levelnum_repeats, below config files and command-line overrides (so+num_repeats=replaces it), appends+split=<effective type>and writes the oracle's entry withoutallowed_agents(the list speaks of model harnesses; the dispatch guard would otherwise refusegym dataset validate).gym dataset validateadds+num_repeats=1unless the command line sets a count: validation is not an evaluation. The entry carries nonum_repeats: collate would duplicate rows by it and the collector would multiply on top, and the metrics sidecar records the entry.nemo_gym/rollout_collection.py: the dispatch-time pairing guard (_validate_agent_pairings) also reads theallowed_agentsof every dataset the agent block declares (_dataset_admitted_agents) and refuses an agent type outside it, through the existing error and--allow-unsupported-pairingoverride. The Harbor environment server binds no resources server, so this is what refuses a run config edited to another harness aftergym eval runadmitted one.nemo_gym/train_data_utils.py: collate keeps thetask_sourcea materialized task row already carries; flat rows, and materialized rows without one, are stamped with the declaring instance as before. The metrics sidecar written beside a dataset's rows (and the per-type one collate writes) leavesdomain,verifiedandallowed_agentsout, as it already leftprepare_script/prepare_dependenciesout: catalog declarations are not properties of the rows, so flippingverifiedafter baselining, wideningallowed_agentsor changingdomainbetween two runs of one taskset and harness no longer fails data preparation with a sidecar conflict.typeandlicenseare recorded as before, for every Gym dataset; editing either still conflicts and the error names the sidecar to delete (documented).nemo_gym/config_types.py:DatasetConfigandBenchmarkDatasetConfigacceptdomain,verified,allowed_agents(omitted from dumps when unset);BenchmarkDatasetConfig.prepare_scriptis optional.Domainmoves above the dataset types.environment_servers/harbor/verifier.py,app.py: the reward rule from the RFC. Arewardkey is the score and the other keys are metrics; without one every key is a component, the reward is their sum, and the result carriesreward_components. Several keys withoutrewardis no longer a terminal verification failure. Components whose sum is not finite are measured 0 withharbor:invalid_reward.summing_componentsis the check at the point a verifier result becomes a result (single turn,finalandmeanroll-ups); a roll-up that drops components logs a warning naming the task, the keys, their sum and the reward.environment_servers/harbor/README.md(reward rule, settings table, "Training metadata" section with the digest rule, validate's repeat default, the domain refusal, the dispatch guard and the sidecar rule; thetask_sourceparagraph says what the label is and is not, standalone task folders included),fern/versions/latest/pages/data/harbor-tasks.mdx([gym]section,--agentrow),gym dataset initscaffold comments.Test plan
environment_servers/harbor/tests+responses_api_agents/harbor_oracle_agent/tests(-k "not partial_eval and not buildah and not validate_ and not real_image"): 438 passed, 2 deselected (409 + 22 on the base; 7 new).test_harbor_tasks,test_harbor_manifest,test_harbor_scaffold,test_harbor_validation,test_benchmarks,test_cli_eval,test_cli_main,test_environment_manifest,test_environment_validation,test_environment_publication,test_eval_plan,test_global_config,test_registry,test_task_materialization,test_train_data_utils,test_rollout_collection): 1837 passed, 0 failed, 284 warnings in 186.70s (0:03:06), exit 0.DatasetConfig/BenchmarkDatasetConfig; the licenseless benchmark path through the real parser (entrytype: benchmark,verified: false, noprepare_script, splitbenchmark, one repeat,domain/allowed_agentskept when declared); each non-shaping key alone leaves the task digest at the folder hash while a shaping table moves it;+num_repeats=and+split=through the real parser;gym dataset validateat one repeat unless the command line sets a count;gym eval runrefusal before any work; the single task folder target's label (task_source= parent inside a dataset, taskset = target; a standalone task folder under a bare scratch directory = its own name, and the parent's again once adataset.tomlor a manifest appears there); a[gym]edit ofverified,allowed_agentsordomainbetween two runs validating against the first run's metrics sidecar with no conflict file written, while alicenseedit still conflicts naming the sidecar; the dispatch guard (refusal naming agent, type and dataset; unset, list and bare-string admission; the override; the generated run config passing and its hand-edited copy refused; the oracle's run config passing); anexampledataset refused byprepare_targetfor a harness and for the oracle path with no output folder, manifest or image record written, bygym eval runandgym dataset validatethrough the real parser (exit 2, nothing dispatched, dataset folder and results root untouched) and bybuild_runon a hand-built taskset of that type; a benchmark entry withoutprepare_scriptthrough collate; summed components, metrics-only keys, overflow, multi-turnmean/finalroll-ups with the drop warning asserted.harbor:terminal-bench/terminal-bench-2-1): generated entry with every key, three rows withtask_sourceand_ng_digestequal to the folder digests, refusal of a non-admitted harness, benchmark defaults on the untouched copy, a single task folder target inside the dataset whose row carries the dataset's label and whose entry carries the parent's keys, and two standalone task folders under one bare scratch directory each labelled by its own name.gym dataset validateon OpenSandbox of a one-task dataset whose verifier writes a two-keyreward.jsonand whosedataset.tomlsets every new key withnum_repeats = 2, on the final tree and through the dispatch guard:validating 1 oracle rollout(s)despitenum_repeats = 2,hello [repeat 0] oracle solved 1.0, the result row withtask_source, summingreward_components {"exists": 0.25, "content": 0.75}and an_ng_digestequal to the task's folder digest; the oracle's generated entry withoutallowed_agents. A second validate of the same taskset after editingverified = trueinto itsdataset.toml: the sidecar of the first run records no catalog key, data preparation reports italready up to date, and the run completes with the same result row and the new dataset digest.gym dataset validateof a copy of that dataset withtype = "example": exit 2 with the refusal naming itsdataset.toml, the copy'smanifest.tomlunchanged, no image record, no results folder and no output written; the unchanged dataset validated again afterwards runs as before.ruff check .,ruff format --check .,pre-commit run --files <changed>: clean.🤖 Generated with Claude Code