Repository navigation
Deprecate multi-GPU evaluation with torchrun - #1459
Conversation
[Low impact] The PR appears safe to merge; no blocking issues were found. SummaryDeprecates multi-GPU evaluation through
No actionable issues found. Tests were not run during this review. Reviews (2) · Last reviewed commit: "Deprecate multi-GPU evaluation with torc..." · Reviewed by Greptile |
🤖 Isaac Lab-Arena Review BotSummaryThis is a re-review after the rebase onto
CI hasn't validated the rebased head yet. On Findings🔵 Improvement: isaaclab_arena/cli/isaaclab_arena_cli.py:65: The help text marks the shared 🔵 Improvement: docs/pages/concepts/concept_arena_experiments.rst:239: The "Choosing a runner" note says VerdictShip it, once CI passes on the rebased head. |
policy_runner.py --distributed under torchrun starts one independent process per GPU. The ranks do not merge their metrics, can write to different timestamped directories, and rank 0 builds the report without waiting for the other ranks. No test covers it, and its original use, one local GR00T policy per GPU, went away with #662. Deprecate it together with policy_runner.py instead of porting it to the Experiment Runner: - Warn with a FutureWarning when policy_runner.py gets --distributed, and mark the flag as deprecated in its help text. - Remove the multi-GPU tabs from the static manipulation, sequential static manipulation, and locomanipulation evaluation pages. - Update the runner note in the Experiments concept page and the run-experiment skill. Signed-off-by: Clemens Volk <[email protected]>
9f4673d to
7af2d1e
Compare
The deprecation warning now also says that ranks do not merge their metrics and that the report from local rank 0 can miss results from the other ranks. The docs no longer show this path, so the warning is the only place a remaining user learns this. Drop the docstring line that still recommended --distributed, and add the missing --viz kit to the parallel evaluation command on the sequential static manipulation page, which says it opens the GUI. Signed-off-by: Clemens Volk <[email protected]>
The docs no longer show multi-GPU evaluation with torchrun, and policy_runner.py warns when it gets --distributed. Drop the sentence from the runner note on the Experiments concept page. Signed-off-by: Clemens Volk <[email protected]>
--distributed is a shared Arena flag. The Isaac Lab callback reads it when it starts the simulation app, so multi-GPU RL training through train.py still needs it. Only its use for policy_runner.py evaluation is deprecated, so the help text now says that. Signed-off-by: Clemens Volk <[email protected]>
--distributed is a shared flag, and its help text appears in every script that uses the Arena parser. policy_runner.py already warns when it gets the flag, so restore the original help text. The docs no longer show torchrun evaluation, so the run-experiment skill does not need to tell agents not to suggest it. Signed-off-by: Clemens Volk <[email protected]>
Move `rollout_policy` into a new `isaaclab_arena/evaluation/rollout.py`, and replace `get_policy_cls` with `resolve_policy_type_from_name_or_class_path` in `arena_experiment_config_loader.py`. After this, nothing that `experiment_runner.py` uses imports `policy_runner.py`. ## Why this change? We plan to deprecate `policy_runner.py` in favor of `experiment_runner.py`. Two modules that `experiment_runner.py` uses still imported code from it: - `run_execution.py` imported `rollout_policy`. - `legacy_eval_config.py` imported `get_policy_cls` to resolve a legacy JSON Experiment's policy. `policy_runner.py` could not be deleted without breaking `experiment_runner.py`. ## What changes? - `rollout_policy` moves into `isaaclab_arena/evaluation/rollout.py`. `run_execution.py` and `policy_runner.py` import it from there. The only change to it: it reads `env.unwrapped.cfg.metrics` without `hasattr`, because `IsaacLabArenaManagerBasedRLEnvCfg` always declares `metrics`. - `get_policy_cls` is replaced by `resolve_policy_type_from_name_or_class_path` in `arena_experiment_config_loader.py`. It returns the policy class for a registered name or a dotted class path. `_resolve_policy_cfg_type_from_name_or_class_path`, which resolves `policy.type` in typed YAML Experiments, already had the same logic and now calls `resolve_policy_type_from_name_or_class_path`. `legacy_eval_config.py` and `policy_runner.py` also call `resolve_policy_type_from_name_or_class_path` in place of `get_policy_cls`. - `resolve_policy_type_from_name_or_class_path` does not print the "Policy ... is not registered. Dynamically importing from path" message that `get_policy_cls` printed. - `test_rollout_policy.py` targets the new module. ## Validation - Rebased onto `main` at `02a9b1e413`, after #1459. CI passed on the earlier head `afc9e006cd`. - After dropping the `hasattr` checks: `test_rollout_policy.py`, `test_run_execution.py`, and `test_experiment_runner.py::test_experiment_runner_from_typed_yaml` pass. - Locally, in the Arena Docker image built from `main`: - `test_rollout_policy.py` (2 passed), `test_run_execution.py` (23), `test_arena_experiment_config_loader.py` (26), `test_policy_cfgs.py` (13), `test_legacy_eval_config.py` (6), and the `test_policy_runner.py` deprecation test. - Subprocess runs that start Isaac Sim: `test_policy_runner.py::test_zero_action_policy`, `test_experiment_runner.py::test_experiment_runner_from_typed_yaml`, and `test_experiment_runner.py::test_experiment_runner_two_jobs_zero_action` (legacy JSON) all pass. - `pre-commit` passes. --------- Signed-off-by: Clemens Volk <[email protected]>
Replace the `policy_runner.py` commands on the GR00T evaluation pages of the sequential static manipulation and locomanipulation workflows with `experiment_runner.py` and three new Experiment files. Replace the sample outputs with output from running these Experiments. ## Why this change? Experiments run with `experiment_runner.py` are becoming the only way to evaluate, but these two tutorial pages still use `policy_runner.py`. This is the follow-up promised in [#1459](#1459). The sample outputs were also out of date. On current `main`, the old `policy_runner.py` command for the 10-environment sequential step reaches a success rate of 0.73 over 45 episodes, where the page showed 0.98. The Experiment version reaches 0.83 over 46 episodes. ## What changes? - `gr1_put_ranch_bottle_in_fridge_gr00t_experiment.yaml` has one Run for Steps 1 and 2 of the sequential page. Step 2 sets 10 environments on the command line with `runs.gr1_put_ranch_bottle_in_fridge_and_close_door.environment_builder.num_envs=10`. - `gr1_put_sauce_bottles_in_fridge_gr00t_experiment.yaml` replaces `--object_set` in Step 3 with the asset selection variation. The Run builds the scene once per bottle and reports a success rate for each bottle. Before, each parallel environment held a different bottle and the page showed one combined rate. - `g1_locomanip_gr00t_experiment.yaml` has one Run for both locomanipulation steps. - Locomanipulation Step 2 now runs 1500 steps instead of 1200. An episode times out after 1500 steps, so with 1200 steps the attempts that timed out never counted. The old sample showed 1.0 over 2 episodes. With 1500 steps the same setup gives 0.5 over 6. - The locomanipulation device note said the evaluation uses `--device cpu`, but neither the old nor the new commands do. It now says the commands run physics on the GPU, and that `--device cpu` switches to CPU physics. - Step 4 of the sequential page already used `experiment_runner.py`. Its intro now builds on Steps 1 to 3. - The removed Low Hardware Requirements tab was the only place that mentioned `checkpoint-30000`. A sentence next to the server command now says to serve that checkpoint after training with that option, because that training also keeps `checkpoint-20000`. ## Validation I ran every command on both pages in the Arena Docker image built from `main`. The GR00T server ran from the Isaac-GR00T submodule with the pre-trained checkpoints from Hugging Face. All Runs completed: | Page step | Envs | Limit | Episodes | Success rate | | --- | --- | --- | --- | --- | | Sequential Step 1 | 1 | 2000 steps | 5 | 0.80 | | Sequential Step 2 | 10 | 2000 steps | 46 | 0.83 | | Sequential Step 3 | 10 | 40 episodes, 4 builds | 40 | 0.60 (ranch dressing 0.8, ketchup 0.6, barbecue 0.5, mayonnaise 0.5) | | Locomanipulation Step 1 | 1 | 1500 steps | 1 | 1.0 | | Locomanipulation Step 2 | 5 | 1500 steps | 6 | 0.5 | For comparison, the old `policy_runner.py` commands on `main` gave 0.73 over 45 episodes for sequential Step 2. For locomanipulation Step 2 at 1200 steps they gave 1.0 over 2 episodes, the same result as the Experiment with those settings. A 100-step locomanipulation run with `--device cpu` completed with the environment on the CPU. I did not re-run sequential Step 4, because its Experiment file and command did not change. After #1456 removed the metrics, I rebased onto `main` and re-rendered the sample outputs in the new Run table format. The tables come from `build_runs_info_table` and `build_categorical_variation_table` on `main`, applied to the saved episode results of the runs above. The numbers did not change. The three Experiment files load with `main`'s loader, and the docs build with `-W` passes. --------- Signed-off-by: Clemens Volk <[email protected]>
) Cherry-pick #1459 into `release/0.4.0`, so v0.4 no longer documents multi-GPU evaluation with `torchrun`, and `policy_runner.py --distributed` prints a `FutureWarning`. ## Why this change? `release/0.4.0` was cut from `main` two days before #1459 merged, so the v0.4 docs still show the "Distribute Multi-GPU Evaluation" tabs on the GR00T evaluation pages. The v0.4 VDR followed them and hit the problems that #1459 gives as the reason to drop the feature: each rank writes to its own output directory, and the report covers only some of the episodes. ## What changes? The same change as #1459: - `policy_runner.py` warns when it gets `--distributed`. The shared `--distributed` flag stays, because RL training with `train.py` uses it. - The "Distribute Multi-GPU Evaluation" tabs are removed from `step_5_evaluation.rst` in `sequential_static_manipulation` and `locomanipulation`. - The concept page on Experiments and the `run-experiment` skill no longer send `torchrun` users to the Policy Runner. The only conflict was in `test_policy_runner.py`, where the release branch already has the viewport video tests in the same place. Both sets of tests are kept, in the same order as on `main`. Signed-off-by: Clemens Volk <[email protected]>
Deprecate multi-GPU evaluation with
torchrunandpolicy_runner.py --distributed, and remove it from the evaluation tutorials. To use several GPUs, run an Experiment on OSMO, which runs each Run on its own GPU and combines the results;policy_runner.py --distributedstill works but prints aFutureWarninguntilpolicy_runner.pyis removed.Why this change?
torchrunevaluation is one of the reasons the docs still send users topolicy_runner.py, which we plan to deprecate in favor ofexperiment_runner.py. We decided to drop it rather than port it, because its results were never combined into one evaluation.Running in parallel itself works:
torchrunstarts onepolicy_runner.pyprocess per GPU, and each process runs the full step or episode budget with--seedplus its rank, so more GPUs evaluate more episodes in the same time. What doesn't work is everything after the rollouts:Metrics:line, and nothing adds them up into one success rate.build_report, right after its ownenv.close(), without waiting for the others. It reads only its own output directory, and each process picks a timestamped directory (timestamped_run_dir) after Isaac Sim starts, so processes that get there in different seconds write to different directories.LOCAL_RANK), so with more than one machine every machine runs the same episodes. The tutorials only use one machine.No test or CI job covers it. It was added in #411 for multi-GPU benchmarking of Arena environments. Each process ran its own simulation and its own local GR00T policy (
Gr00tClosedloopPolicy). #662 removedGr00tClosedloopPolicy.What changes?
policy_runner.pyemits aFutureWarningwhen it gets--distributed. The warning also says that ranks do not merge their metrics and that the report from local rank 0 can miss results from other ranks. The shared--distributedflag itself stays unchanged, becauseenvironment_registration_callbackreads it when it starts the app for RL training.step_5_evaluation.rstinsequential_static_manipulationandlocomanipulation. The single-GPU commands remain. The parallel command on thesequential_static_manipulationpage also gets the--viz kitit was missing.docs/pages/concepts/concept_arena_experiments.rstand the "Hand off other workflows" list inskills/user/run-experiment/SKILL.mdno longer mentiontorchrun.Using several GPUs instead:
environment_builder.num_envsin an Experiment).osmo/submit_arena_experiment.py(see the Multi-Node Evaluation page).ArenaExperimentWorkflowruns each Run in its own OSMO group, starts its policy server next to it if needed, and collects all Runs into one Experiment result and report. A single Run uses one GPU, so spreading one configuration over several GPUs means splitting it into several Runs, for example with different seeds.Gr00tServerTaskon OSMO only serves the GR00T DROID checkpoint, so the GR1 and G1 GR00T tutorials that lose their multi-GPU tab cannot move to OSMO as they are.The RL training page
reinforcement_learning/step_2_policy_training.rststill passes--distributedtotrain.py. There, Isaac Lab's training CLI and Arena'senvironment_registration_callbackboth read it, and multi-GPU training is not deprecated.The release notes are written when a release is cut, so the deprecation should be listed in the next release's notes.
Validation
mainat9b9e5b8350. Before the rebase, CI passed: Run tests, Run tests with subprocess, GR00T closed-loop E2E, the docs build, and pre-commit.main:test_distributed_evaluation_warns_about_deprecationpasses,make SPHINXOPTS=-W htmlindocs/passes, andpre-commitpasses.mainuses PyTorch built for CUDA 13.0, which needs a newer NVIDIA driver than the test machine has.