Repository navigation
Adds optimizations and additional training configs for SB3 - #2022
Conversation
|
@Mayankm96 failure on the CI seems to be due to a timeout, probably unrelated to this PR? |
|
@Mayankm96 when do you think that you or someone from your team can have a look at this PR? and do you need anything else from me? |
Signed-off-by: Antonin RAFFIN <[email protected]>
| print("[INFO] Unfortunately a pre-trained checkpoint is currently unavailable for this task.") | ||
| return | ||
| elif args_cli.checkpoint is None: | ||
| # FIXME: last checkpoint doesn't seem to really use the last one' |
There was a problem hiding this comment.
Shall I open a separate issue? (it is already broken on master and not related to this PR which is about speed optim)
There was a problem hiding this comment.
it seems to be picking up the last checkpoint in my test, what was the issue you were seeing? this might not work with envs that have a PLAY cfg for inferencing. it will not be able to find for example logs/sb3/Isaac-Velocity-Rough-Unitree-A1-Play-v0. is there a way to specify an experiment name or directory in the agent cfg like the other libraries?
There was a problem hiding this comment.
the issue was that it is using alphabetical order instead of number of timesteps to decide which checkpoint is last.
I'll try to give you an example to reproduce.
There was a problem hiding this comment.
ah I see, we can probably pass sort_alpha=False in get_checkpoint_path to sort it by timestamp then
|
|
||
| We performed training with each RL library on the same ``Isaac-Humanoid-v0`` environment | ||
| with ``--headless`` on a single RTX 4090 GPU | ||
| with ``--headless`` on a single RTX 4090 GPU using 4096 environments |
There was a problem hiding this comment.
Specify the number of environments is not necessary. Any configuration used is implicit in the task: Isaac-Humanoid-v0
There was a problem hiding this comment.
same as https://github.com/isaac-sim/IsaacLab/pull/2022/files#r2020574675, as a user I would need to really dig in the code to know what is happening (for instance if you want to compare to another simulator).
EDIT: if the default number of envs is changed in the future, those results won't be valid anymore, being explicit makes it more reproducible
|
@Toni-SM could you please re-review this MR so we can merge it in a timely manner. Thank you! |
Signed-off-by: Antonin RAFFIN <[email protected]>
|
@Mayankm96 could you maybe assign someone else? |
|
Toni has reviewed the PR, we'll try to get this merged in soon. Thanks for staying on top of this, @araffin! |
kellyguo11
left a comment
There was a problem hiding this comment.
Thanks so much for the update! the humanoid environment now trains in just 300s!!
| checkpoint_path = args_cli.checkpoint | ||
| log_dir = os.path.dirname(checkpoint_path) | ||
|
|
||
| agent_cfg = load_yaml(os.path.join(log_dir, "params", "agent.yaml")) |
There was a problem hiding this comment.
is this file different than loading it from load_cfg_from_registry?
There was a problem hiding this comment.
this is actually an important small detail. This loads the exact config used to train the agent, not the default one present in IsaacLab.
| "env_cfg_entry_point": f"{__name__}.rough_env_cfg:UnitreeA1RoughEnvCfg", | ||
| "rsl_rl_cfg_entry_point": f"{agents.__name__}.rsl_rl_ppo_cfg:UnitreeA1RoughPPORunnerCfg", | ||
| "skrl_cfg_entry_point": f"{agents.__name__}:skrl_rough_ppo_cfg.yaml", | ||
| "sb3_cfg_entry_point": f"{agents.__name__}:sb3_ppo_cfg.yaml", |
There was a problem hiding this comment.
this didn't seem to train well for me with the default parameters. was it training fine on your end?
There was a problem hiding this comment.
maybe you didn't try with num_envs=1024? (see discussion above about this hyperparameter)
i fixed it and tested it, should work out of the box now.
| print("[INFO] Unfortunately a pre-trained checkpoint is currently unavailable for this task.") | ||
| return | ||
| elif args_cli.checkpoint is None: | ||
| # FIXME: last checkpoint doesn't seem to really use the last one' |
There was a problem hiding this comment.
it seems to be picking up the last checkpoint in my test, what was the issue you were seeing? this might not work with envs that have a PLAY cfg for inferencing. it will not be able to find for example logs/sb3/Isaac-Velocity-Rough-Unitree-A1-Play-v0. is there a way to specify an experiment name or directory in the agent cfg like the other libraries?
|
do you mind adding in the version update in extension.toml? then we can get this merged. |
Signed-off-by: Kelly Guo <[email protected]>
…#2022) # Description <!-- Thank you for your interest in sending a pull request. Please make sure to check the contribution guidelines. Link: https://isaac-sim.github.io/IsaacLab/main/source/refs/contributing.html --> Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change. Implement part of isaac-sim#1769 (optimization) This is a breaking change because the fast variant is now enabled by default. I also improve sb3 training script, fixed loading of normalization and fixed the humanoid hyperparameters to be similar to rsl-rl, so we can compare apples to apples in terms of training speed. I will probably open another PR for the rest of the proposals. <!-- As a practice, it is recommended to open an issue to have discussions on the proposed pull request. This makes it easier for the community to keep track of what is being developed or added, and if a given feature is demanded by more than one party. --> ## Type of change <!-- As you go through the list, delete the ones that are not applicable. --> - Bug fix (non-breaking change which fixes an issue) - Breaking change (fix or feature that would cause existing functionality to not work as expected) - This change requires a documentation update With respect to testing, how do you run a single test? and is there anything I should add? ## Checklist - [x] I have run the [`pre-commit` checks](https://pre-commit.com/) with `./isaaclab.sh --format` - [x] I have made corresponding changes to the documentation - [x] My changes generate no new warnings - [ ] 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 - [x] I have added my name to the `CONTRIBUTORS.md` or my name already exists there <!-- As you go through the checklist above, you can mark something as done by putting an x character in it For example, - [x] I have done this task - [ ] I have not done this task --> --------- Signed-off-by: Antonin RAFFIN <[email protected]> Signed-off-by: Kelly Guo <[email protected]> Co-authored-by: Kelly Guo <[email protected]>
…#2022) # Description <!-- Thank you for your interest in sending a pull request. Please make sure to check the contribution guidelines. Link: https://isaac-sim.github.io/IsaacLab/main/source/refs/contributing.html --> Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change. Implement part of isaac-sim#1769 (optimization) This is a breaking change because the fast variant is now enabled by default. I also improve sb3 training script, fixed loading of normalization and fixed the humanoid hyperparameters to be similar to rsl-rl, so we can compare apples to apples in terms of training speed. I will probably open another PR for the rest of the proposals. <!-- As a practice, it is recommended to open an issue to have discussions on the proposed pull request. This makes it easier for the community to keep track of what is being developed or added, and if a given feature is demanded by more than one party. --> ## Type of change <!-- As you go through the list, delete the ones that are not applicable. --> - Bug fix (non-breaking change which fixes an issue) - Breaking change (fix or feature that would cause existing functionality to not work as expected) - This change requires a documentation update With respect to testing, how do you run a single test? and is there anything I should add? ## Checklist - [x] I have run the [`pre-commit` checks](https://pre-commit.com/) with `./isaaclab.sh --format` - [x] I have made corresponding changes to the documentation - [x] My changes generate no new warnings - [ ] 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 - [x] I have added my name to the `CONTRIBUTORS.md` or my name already exists there <!-- As you go through the checklist above, you can mark something as done by putting an x character in it For example, - [x] I have done this task - [ ] I have not done this task --> --------- Signed-off-by: Antonin RAFFIN <[email protected]> Signed-off-by: Kelly Guo <[email protected]> Co-authored-by: Kelly Guo <[email protected]>
…#2022) # Description <!-- Thank you for your interest in sending a pull request. Please make sure to check the contribution guidelines. Link: https://isaac-sim.github.io/IsaacLab/main/source/refs/contributing.html --> Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change. Implement part of isaac-sim#1769 (optimization) This is a breaking change because the fast variant is now enabled by default. I also improve sb3 training script, fixed loading of normalization and fixed the humanoid hyperparameters to be similar to rsl-rl, so we can compare apples to apples in terms of training speed. I will probably open another PR for the rest of the proposals. <!-- As a practice, it is recommended to open an issue to have discussions on the proposed pull request. This makes it easier for the community to keep track of what is being developed or added, and if a given feature is demanded by more than one party. --> ## Type of change <!-- As you go through the list, delete the ones that are not applicable. --> - Bug fix (non-breaking change which fixes an issue) - Breaking change (fix or feature that would cause existing functionality to not work as expected) - This change requires a documentation update With respect to testing, how do you run a single test? and is there anything I should add? ## Checklist - [x] I have run the [`pre-commit` checks](https://pre-commit.com/) with `./isaaclab.sh --format` - [x] I have made corresponding changes to the documentation - [x] My changes generate no new warnings - [ ] 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 - [x] I have added my name to the `CONTRIBUTORS.md` or my name already exists there <!-- As you go through the checklist above, you can mark something as done by putting an x character in it For example, - [x] I have done this task - [ ] I have not done this task --> --------- Signed-off-by: Antonin RAFFIN <[email protected]> Signed-off-by: Kelly Guo <[email protected]> Co-authored-by: Kelly Guo <[email protected]>
Description
Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context.
List any dependencies that are required for this change.
Implement part of #1769 (optimization)
This is a breaking change because the fast variant is now enabled by default.
I also improve sb3 training script, fixed loading of normalization and fixed the humanoid hyperparameters to be similar to rsl-rl, so we can compare apples to apples in terms of training speed.
I will probably open another PR for the rest of the proposals.
Type of change
With respect to testing, how do you run a single test?
and is there anything I should add?
Checklist
pre-commitchecks with./isaaclab.sh --formatconfig/extension.tomlfileCONTRIBUTORS.mdor my name already exists there