Repository navigation
Stop accepting JSON Experiment files and --chunk_size in experiment_runner.py - #1705
Conversation
[Medium impact] The PR appears safe to merge in the stated order, after #1701 updates the remaining documentation example. SummaryRemoves legacy JSON Experiment loading and makes typed YAML the only supported format.
cvolkcvolk explicitly requires #1701 to merge first to remove the remaining JSON documentation example. The removal of chunking without a YAML replacement is intentional. No actionable issues found. Reviews (1) · Last reviewed commit: "Remove the environment factory-to-config..." · Reviewed by Greptile |
🤖 Isaac Lab-Arena Review BotSummaryThis PR removes the JSON Experiment path from the Experiment Runner. It deletes Findings🔵 Improvement: isaaclab_arena/evaluation/arena_experiment_config_loader.py:25: 🔵 Improvement: isaaclab_arena/evaluation/legacy_environment_cli_args.py:10: the only production caller passes a graph YAML path. The registered-name branch and the When this was reviewed, pre-commit was still running and the test jobs hadn't reported, so I couldn't confirm test results. VerdictShip it |
Port the Experiment Runner tests that still use legacy JSON to YAML Experiments or typed Run configs, delete the ones YAML tests already cover, and move the graph-spec CLI tests out of `test_legacy_eval_config.py`. After this PR, only the JSON loader's own tests still use JSON, and #1705 removes them together with the loader. ## Why this change? #1705 removes JSON Experiment loading. Nine tests still use it: they write a JSON jobs file or pass a jobs dict to the JSON adapter. Four of them check something no YAML test covers, so they are ported: - `test_experiment_runner_graph_spec_with_variation`: runs a graph-spec environment end to end through the Experiment Runner. - `test_experiment_runner_all_environments`: runs every registered environment for a few steps. - `test_experiment_runner_with_gr00t_remote_closedloop_policy`: runs the Experiment Runner against a remote GR00T policy server. - `test_eval_config_variation_lands_in_events_cfg`: checks that a Run's variations become event terms in `env_cfg.events`. The other five are covered by YAML tests and are deleted: - `test_experiment_runner_two_jobs_zero_action`: `test_experiment_runner_runs_with_different_env_counts`. - `test_experiment_runner_multiple_environments`: `test_experiment_runner_all_environments`. - `test_experiment_runner_different_embodiments`: `test_experiment_runner_runs_with_different_env_counts` and `test_experiment_runner_all_environments`. - `test_experiment_runner_with_variations`: `test_experiment_runner_replays_recorded_variation_samples`. - `test_experiment_runner_enable_cameras`: the ported graph-spec test, which now also runs its camera-less Run. ## What changes? - The subprocess tests write YAML Experiments to `tmp_path` and pass `--experiment_output_directory`, so they no longer write to `outputs/` in the working directory. `run_experiment_runner` always passes `--experiment_config`. - The all-environments smoke test passes `--continue_on_error` and checks every Run's status with a new `read_run_statuses` helper, so it names every broken environment, not only the first. The ported graph-spec and GR00T tests rely on the exit code: without `--continue_on_error`, a failed Run makes the runner exit non-zero. - The graph-spec test becomes `test_experiment_runner_graph_spec_camera_run_and_camera_less_run`. - `test_eval_config_variation_lands_in_events_cfg` becomes `test_run_variation_lands_in_events_cfg` and builds an `ArenaRunCfg` directly. - The tests for `legacy_environment_args_to_cli_args` and `build_arena_builder_from_legacy_graph` move to `test_legacy_graph_environment_cli.py`. YAML graph-spec Runs use both functions. The tests now use the inputs such a Run produces and compare against literal values. ## Validation - Each ported Run equals the `ArenaRunCfg` the JSON adapter built from the old test data. I checked this with a one-off script for all 19 environments, the GR00T Run, the camera-less Run and the typed Runs. The graph-spec Run differs only in `LegacyGraphEnvironmentCfg.enable_cameras`: the YAML loader sets it from the Run, the JSON adapter left it `False`. The environment's CLI arguments are the same. - Locally in the Arena container, every test in `test_experiment_runner.py` passes, including the graph-spec test with both Runs and `test_run_variation_lands_in_events_cfg`. `test_experiment_runner_all_environments` completes all 19 Runs. - The GR00T test skips without a GR00T server, so only CI's `test_gr00t_closedloop_e2e` job runs it. I did not run it. --------- Signed-off-by: Clemens Volk <[email protected]>
Typed YAML Experiments replaced the JSON jobs format. No JSON Experiment is checked in since #1531, and #1704 ported or deleted the tests that still wrote JSON. Delete legacy_eval_config.py, legacy_experiment_runner.py and the .json branch of load_arena_experiment_from_config_file. A .json path now fails before startup with a message that points to YAML Experiments. Remove the --eval_jobs_config alias and --chunk_size. Chunked dispatch only ever worked for JSON jobs. Long sweeps on OSMO already run each Run in its own process. Delete the tests that covered only the JSON adapter, the JSON camera check, chunking and the JSON override rejection. Signed-off-by: Clemens Volk <[email protected]>
EnvironmentRegistry.get_environment_cfg_type and its _cfg_types_by_factory_type map existed so the JSON adapter could turn an environment name into its config type. Their TODO asked to remove both with that adapter. The tests that used the lookup now read get_environment_cfg_types(), which the YAML loader uses. Signed-off-by: Clemens Volk <[email protected]>
build_arena_experiment_submission_cfg asserted a .yaml or .yml path and then called load_arena_experiment_from_config_file, which now rejects every other suffix itself and tells JSON users to write a YAML Experiment. The OSMO copy was only needed while the loader still accepted JSON. Signed-off-by: Clemens Volk <[email protected]>
legacy_environment_cli_args.py turned legacy environment arguments into CLI tokens. Its only caller left, build_arena_builder_from_legacy_graph, always passes a graph YAML path. So the branch for a registered environment name, and the priority ordering that kept parent-parser flags ahead of that positional name, only ran in a unit test. Replace the module with _graph_environment_cli_args in legacy_graph_environment_cli.py, which emits --env_spec and the Run's per-run overrides. Both get deleted together once graph-YAML environments have a typed configuration. The builder test now checks the boolean and value handling the removed unit test covered. Signed-off-by: Clemens Volk <[email protected]>
Describe _graph_environment_cli_args with an input and the arguments it returns, and spell out the three cases in the loop: skip unset values and switched-off flags, pass True as a bare flag, and pass everything else as a flag and value. The returned arguments are unchanged. Signed-off-by: Clemens Volk <[email protected]>
8ffd4b4 to
663bf9d
Compare
david-tingdahl-nvidia
left a comment
There was a problem hiding this comment.
Good riddance. Thanks for cleaning this up!
I had my agent look for any stale json code or mentions, and it found some suggestions:
Stale or wrong docs and docstrings (these should be fixed)
- ~/develop/IsaacLab-Arena/docs/pages/example_workflows/reinforcement_learning/step_3_evaluation.rst:98-143 still documents "Method 3: Batch Evaluation" with a JSON config.
- It says "use experiment_runner.py with a JSON config" and shows an eval_config.json with a "jobs" list. That list uses policy_type, arena_env_args and policy_config_dict.
- It runs experiment_runner.py ... --eval_jobs_config eval_config.json.
- That flag and the JSON format are what the PR removes, and the loader now rejects .json files. This section needs rewriting as a YAML Experiment with Runs.
- ~/develop/IsaacLab-Arena/isaaclab_arena/policy/rsl_rl_action_policy.py:60-80: the RslRlActionPolicy docstring still has a .. code-block:: json "Example configuration for Experiment Runner" in the old {"jobs": [...]} shape. It should become a YAML Run example. The line "No separate
JSON config file is required" is also leftover wording that can go.Fine to leave as is (intentional)
- The rejection message in arena_experiment_config_loader.py:27 and the two tests that assert it:
- test_arena_experiment_config_loader.py:404, the experiment.json parametrization.
- test_osmo_experiment_workflow.py:989, test_submission_rejects_legacy_json_experiment.
- All the arena_experiment_result.json, timings.json, kpis.json and .jsonl output and recording files.
- legacy_environment_cli_args.py and the LegacyGraphEnvironmentCfg classes. They are named "legacy" but are not JSON.
Possibly stale, worth a look
- ~/develop/IsaacLab-Arena/docs/pages/references/release_notes.rst:250 already says legacy evaluation jobs were replaced with typed YAML. Check whether you want a migration note for JSON users in migration_guide_v0_4.rst. I found no mention there.
|
AI-drafted (Claude Code), reviewed by me. @david-tingdahl-nvidia Thanks! 1 and 2 are already fixed on main by #1701 (the RL tutorial and the |
Make
experiment_runner.pyaccept only YAML Experiments. JSON Experiment files, the--eval_jobs_configalias and--chunk_sizeare removed.Why this change?
YAML Experiments replaced the JSON jobs format. Since #1531 no JSON Experiment is checked in, and after #1701 and #1704 no doc or test uses one. The JSON path still kept two modules and a second code path through the loader and the runner.
What changes?
For users:
.jsonExperiment now fails before Isaac Sim starts, with a message that points to YAML. Rewrite each job as a Run in a YAML Experiment, as in the example below.--eval_jobs_configand--chunk_sizeare gone. Passing either fails as an unrecognized argument.In the code:
legacy_eval_config.py,legacy_experiment_runner.pyand the.jsonbranch ofload_arena_experiment_from_config_file.EnvironmentRegistry.get_environment_cfg_type, which only the JSON adapter used.legacy_graph_environment_cli.py, its only user, and deletelegacy_environment_cli_args.py.Why
--chunk_sizecan go--chunk_size(#751) ran each chunk of JSON jobs in a fresh process, to free host memory that leaked on every environment build.cube_goal_posepick_and_place_maple_tablewith camerasOn OSMO each Run runs in its own process anyway.
Usage example
Before:
{ "jobs": [ { "name": "lift_object_model_1000", "policy_type": "rsl_rl", "num_episodes": 1024, "arena_env_args": {"environment": "lift_object", "num_envs": 64}, "policy_config_dict": {"checkpoint_path": "model_1000.pt"} } ] }After:
Validation
Locally in the Arena container:
.jsonconfig,--eval_jobs_configand--chunk_sizeeach fail before Isaac Sim starts.test_experiment_runner.pypass, including the graph-spec Run end to end, and so does the all-environments smoke test.