Repository navigation
Update RSL-RL configs to work with newer versions 4.0 and 5.0 - #4379
kellyguo11 merged 20 commits into
Conversation
11521b9 to
dea941e
Compare
2ef7fc8 to
f3061a4
Compare
Greptile OverviewGreptile Summary
Confidence Score: 2/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant U as User CLI
participant P as play.py / train.py
participant CA as cli_args.py
participant H as Hydra/Registry
participant RL as isaaclab_rl.rsl_rl cfgs
participant R as rsl_rl Runner
U->>P: launch with --task/--agent
P->>H: load env_cfg + agent_cfg (entry_point)
P->>CA: update_rsl_rl_cfg(agent_cfg, args)
P->>CA: handle_deprecated_rsl_rl_cfg(agent_cfg, installed_version)
CA->>RL: map legacy policy<->model cfgs
P->>R: construct Runner(env, agent_cfg.to_dict())
R->>R: load checkpoint (play) / learn (train)
alt rsl-rl >= 4.0.0 (play)
P->>R: export_policy_to_jit / export_policy_to_onnx
else rsl-rl < 4.0.0 (play)
P->>RL: export_policy_as_jit / export_policy_as_onnx
end
|
Additional Comments (1)
|
In rsl-rl 4.0.0, the Actor (MLPModel) contains the obs normalizer internally. The velocity and tracking runners were extracting the normalizer and passing it to the ONNX exporter, which wraps it and applies it in forward(). Since the actor also applies its own internal normalizer, observations were being normalized twice. This was originally fixed in db076d9 but regressed in cc69cec. Confirmed by referencing isaac-sim/IsaacLab#4379, where the rsl-rl author uses the runner's built-in export (which doesn't pass a separate normalizer) for v4.0.0. Fix: pass normalizer=None so the exporter uses Identity, relying on the actor's internal normalizer.
In rsl-rl 4.0.0, the Actor (MLPModel) contains the obs normalizer internally. The velocity and tracking runners were extracting the normalizer and passing it to the ONNX exporter, which wraps it and applies it in forward(). Since the actor also applies its own internal normalizer, observations were being normalized twice. This was originally fixed in db076d9 but regressed in cc69cec. Confirmed by referencing isaac-sim/IsaacLab#4379, where the rsl-rl author uses the runner's built-in export (which doesn't pass a separate normalizer) for v4.0.0. Fix: pass normalizer=None so the exporter uses Identity, relying on the actor's internal normalizer.
* upgrades rsl-rl-lib from 3.1.0 to 4.0.0 * fixes breaking changes * makes legacy checkpoint format work * adds function annotation to the runner * removes annoying warning by changing policy to actor * formats * fixes ty checks * updates tests * updates notebook * updates lab_api changelog * reverts back the normalization logic * fixes normalization * uses pypi version instead of the github tag now that it has been published * fix double normalization in ONNX export for rsl-rl 4.0.0 In rsl-rl 4.0.0, the Actor (MLPModel) contains the obs normalizer internally. The velocity and tracking runners were extracting the normalizer and passing it to the ONNX exporter, which wraps it and applies it in forward(). Since the actor also applies its own internal normalizer, observations were being normalized twice. This was originally fixed in db076d9 but regressed in cc69cec. Confirmed by referencing isaac-sim/IsaacLab#4379, where the rsl-rl author uses the runner's built-in export (which doesn't pass a separate normalizer) for v4.0.0. Fix: pass normalizer=None so the exporter uses Identity, relying on the actor's internal normalizer. * Revert "fix double normalization in ONNX export for rsl-rl 4.0.0" This reverts commit 4c30060. * add test for ONNX exporter normalization correctness Verifies that _OnnxPolicyExporter with the normalizer passed in produces identical output to MLPModel.forward, and that omitting the normalizer skips normalization entirely. * fix comment style in rl/runner.py * restore trailing newline in exporter.py * move local torch import to module level in test_runner --------- Co-authored-by: Kevin Zakka <[email protected]>
* upgrades rsl-rl-lib from 3.1.0 to 4.0.0 * fixes breaking changes * makes legacy checkpoint format work * adds function annotation to the runner * removes annoying warning by changing policy to actor * formats * fixes ty checks * updates tests * updates notebook * updates lab_api changelog * reverts back the normalization logic * fixes normalization * uses pypi version instead of the github tag now that it has been published * fix double normalization in ONNX export for rsl-rl 4.0.0 In rsl-rl 4.0.0, the Actor (MLPModel) contains the obs normalizer internally. The velocity and tracking runners were extracting the normalizer and passing it to the ONNX exporter, which wraps it and applies it in forward(). Since the actor also applies its own internal normalizer, observations were being normalized twice. This was originally fixed in db076d9da but regressed in cc69cec2e. Confirmed by referencing isaac-sim/IsaacLab#4379, where the rsl-rl author uses the runner's built-in export (which doesn't pass a separate normalizer) for v4.0.0. Fix: pass normalizer=None so the exporter uses Identity, relying on the actor's internal normalizer. * Revert "fix double normalization in ONNX export for rsl-rl 4.0.0" This reverts commit 4c30060bf60017703386a7e3d171d0364f21815e. * add test for ONNX exporter normalization correctness Verifies that _OnnxPolicyExporter with the normalizer passed in produces identical output to MLPModel.forward, and that omitting the normalizer skips normalization entirely. * fix comment style in rl/runner.py * restore trailing newline in exporter.py * move local torch import to module level in test_runner --------- Co-authored-by: Kevin Zakka <[email protected]>
bc56432 to
8587112
Compare
|
@ClemensSchwarke could you run the formatter? |
|
I am not sure if the |
hmm perhaps making it a utility under isaaclab_rl/rsl_rl could make sense? |
Sounds good, thanks! |
…isaac-sim#4379)" This reverts commit 47c9f95.
…sim#4379) This PR updates the rsl-rl config classes to be compatible with version 4.0 and 5.0. It also adds a configuration handling function to ensure that old configs work with version 4.0/5.0 and adapts `train.py` and `play.py` accordingly. Lastly, it updates the config classes for ANYmal D locomotion for reference and adds recurrent configs. The main change for 4.0 is that the policy config is split into seperate actor and critic / student and teacher configs. For more details see the [Release Notes](https://github.com/leggedrobotics/rsl_rl/releases/tag/v4.0.0). The main change for 5.0 is that the noise distribution is now configured via the `distribution_cfg` to allow for arbitrary distributions. For more details see the [Release Notes](https://github.com/leggedrobotics/rsl_rl/releases/tag/v5.0.0). - [x] I have run the [`pre-commit` checks](https://pre-commit.com/) with `./isaaclab.sh --format` - [x] My changes generate no new warnings - [x] I have added tests that prove my fix is effective or that my feature works - [x] I have updated the changelog and the corresponding version in the extension's `config/extension.toml` file
* upgrades rsl-rl-lib from 3.1.0 to 4.0.0 * fixes breaking changes * makes legacy checkpoint format work * adds function annotation to the runner * removes annoying warning by changing policy to actor * formats * fixes ty checks * updates tests * updates notebook * updates lab_api changelog * reverts back the normalization logic * fixes normalization * uses pypi version instead of the github tag now that it has been published * fix double normalization in ONNX export for rsl-rl 4.0.0 In rsl-rl 4.0.0, the Actor (MLPModel) contains the obs normalizer internally. The velocity and tracking runners were extracting the normalizer and passing it to the ONNX exporter, which wraps it and applies it in forward(). Since the actor also applies its own internal normalizer, observations were being normalized twice. This was originally fixed in db076d9 but regressed in cc69cec. Confirmed by referencing isaac-sim/IsaacLab#4379, where the rsl-rl author uses the runner's built-in export (which doesn't pass a separate normalizer) for v4.0.0. Fix: pass normalizer=None so the exporter uses Identity, relying on the actor's internal normalizer. * Revert "fix double normalization in ONNX export for rsl-rl 4.0.0" This reverts commit 4c30060. * add test for ONNX exporter normalization correctness Verifies that _OnnxPolicyExporter with the normalizer passed in produces identical output to MLPModel.forward, and that omitting the normalizer skips normalization entirely. * fix comment style in rl/runner.py * restore trailing newline in exporter.py * move local torch import to module level in test_runner --------- Co-authored-by: Kevin Zakka <[email protected]>
…sim#4379) This PR updates the rsl-rl config classes to be compatible with version 4.0 and 5.0. It also adds a configuration handling function to ensure that old configs work with version 4.0/5.0 and adapts `train.py` and `play.py` accordingly. Lastly, it updates the config classes for ANYmal D locomotion for reference and adds recurrent configs. The main change for 4.0 is that the policy config is split into seperate actor and critic / student and teacher configs. For more details see the [Release Notes](https://github.com/leggedrobotics/rsl_rl/releases/tag/v4.0.0). The main change for 5.0 is that the noise distribution is now configured via the `distribution_cfg` to allow for arbitrary distributions. For more details see the [Release Notes](https://github.com/leggedrobotics/rsl_rl/releases/tag/v5.0.0). ## Checklist - [x] I have run the [`pre-commit` checks](https://pre-commit.com/) with `./isaaclab.sh --format` - [x] My changes generate no new warnings - [x] I have added tests that prove my fix is effective or that my feature works - [x] I have updated the changelog and the corresponding version in the extension's `config/extension.toml` file
* upgrades rsl-rl-lib from 3.1.0 to 4.0.0 * fixes breaking changes * makes legacy checkpoint format work * adds function annotation to the runner * removes annoying warning by changing policy to actor * formats * fixes ty checks * updates tests * updates notebook * updates lab_api changelog * reverts back the normalization logic * fixes normalization * uses pypi version instead of the github tag now that it has been published * fix double normalization in ONNX export for rsl-rl 4.0.0 In rsl-rl 4.0.0, the Actor (MLPModel) contains the obs normalizer internally. The velocity and tracking runners were extracting the normalizer and passing it to the ONNX exporter, which wraps it and applies it in forward(). Since the actor also applies its own internal normalizer, observations were being normalized twice. This was originally fixed in db076d9 but regressed in cc69cec. Confirmed by referencing isaac-sim/IsaacLab#4379, where the rsl-rl author uses the runner's built-in export (which doesn't pass a separate normalizer) for v4.0.0. Fix: pass normalizer=None so the exporter uses Identity, relying on the actor's internal normalizer. * Revert "fix double normalization in ONNX export for rsl-rl 4.0.0" This reverts commit 4c30060. * add test for ONNX exporter normalization correctness Verifies that _OnnxPolicyExporter with the normalizer passed in produces identical output to MLPModel.forward, and that omitting the normalizer skips normalization entirely. * fix comment style in rl/runner.py * restore trailing newline in exporter.py * move local torch import to module level in test_runner --------- Co-authored-by: Kevin Zakka <[email protected]>
…sim#4379) This PR updates the rsl-rl config classes to be compatible with version 4.0 and 5.0. It also adds a configuration handling function to ensure that old configs work with version 4.0/5.0 and adapts `train.py` and `play.py` accordingly. Lastly, it updates the config classes for ANYmal D locomotion for reference and adds recurrent configs. The main change for 4.0 is that the policy config is split into seperate actor and critic / student and teacher configs. For more details see the [Release Notes](https://github.com/leggedrobotics/rsl_rl/releases/tag/v4.0.0). The main change for 5.0 is that the noise distribution is now configured via the `distribution_cfg` to allow for arbitrary distributions. For more details see the [Release Notes](https://github.com/leggedrobotics/rsl_rl/releases/tag/v5.0.0). ## Checklist - [x] I have run the [`pre-commit` checks](https://pre-commit.com/) with `./isaaclab.sh --format` - [x] My changes generate no new warnings - [x] I have added tests that prove my fix is effective or that my feature works - [x] I have updated the changelog and the corresponding version in the extension's `config/extension.toml` file
…sim#4379) This PR updates the rsl-rl config classes to be compatible with version 4.0 and 5.0. It also adds a configuration handling function to ensure that old configs work with version 4.0/5.0 and adapts `train.py` and `play.py` accordingly. Lastly, it updates the config classes for ANYmal D locomotion for reference and adds recurrent configs. The main change for 4.0 is that the policy config is split into seperate actor and critic / student and teacher configs. For more details see the [Release Notes](https://github.com/leggedrobotics/rsl_rl/releases/tag/v4.0.0). The main change for 5.0 is that the noise distribution is now configured via the `distribution_cfg` to allow for arbitrary distributions. For more details see the [Release Notes](https://github.com/leggedrobotics/rsl_rl/releases/tag/v5.0.0). ## Checklist - [x] I have run the [`pre-commit` checks](https://pre-commit.com/) with `./isaaclab.sh --format` - [x] My changes generate no new warnings - [x] I have added tests that prove my fix is effective or that my feature works - [x] I have updated the changelog and the corresponding version in the extension's `config/extension.toml` file
This PR updates the rsl-rl config classes to be compatible with version 4.0 and 5.0. It also adds a configuration handling function to ensure that old configs work with version 4.0/5.0 and adapts
train.pyandplay.pyaccordingly. Lastly, it updates the config classes for ANYmal D locomotion for reference and adds recurrent configs.The main change for 4.0 is that the policy config is split into seperate actor and critic / student and teacher configs. For more details see the Release Notes.
The main change for 5.0 is that the noise distribution is now configured via the
distribution_cfgto allow for arbitrary distributions. For more details see the Release Notes.Checklist
pre-commitchecks with./isaaclab.sh --formatconfig/extension.tomlfile