Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changing gym registration to be faster #1144

Merged

Conversation

vincentpierre
Copy link
Contributor

Motivation and Context

Using gym.auto_name forces us to parse all files, load them and check the auto_name value. This is very slow. This change makes it such that the auto_gym environments are defined in a dictionary PRE_REGISTERED_GYM_TASKS in gym_definitions.py

How Has This Been Tested

Types of changes

  • Docs change / refactoring / dependency upgrade
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have completed my CLA (see CONTRIBUTING)
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@vincentpierre vincentpierre self-assigned this Feb 17, 2023
@facebook-github-bot facebook-github-bot added the CLA Signed Do not delete this pull request or issue due to inactivity. label Feb 17, 2023
Copy link
Contributor

@eundersander eundersander left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Will people forget to add their new task to PRE_REGISTERED_GYM_TASKS? If a task lookup fails, can we print a pretty message with reminder to check PRE_REGISTERED_GYM_TASKS?

@vincentpierre
Copy link
Contributor Author

The lookup is managed by gym so it will be hard to have custom error messages on missing environments. I do not expect users to register their environments this way, I would prefer they used make_gym_env as documented in the README.

Copy link
Collaborator

@rpartsey rpartsey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like these changes!

@rpartsey
Copy link
Collaborator

I would prefer they used make_gym_env as documented in the README.

@vincentpierre do you mean habitat.gym.make_gym_from_config?

@vincentpierre
Copy link
Contributor Author

@vincentpierre do you mean habitat.gym.make_gym_from_config?

Yes, exactly.

@vincentpierre vincentpierre merged commit 7a89657 into facebookresearch:main Feb 22, 2023
dannymcy pushed a commit to dannymcy/habitat-lab that referenced this pull request Jul 8, 2024
Co-authored-by: vincentpierre <vincentpierre@users.noreply.github.com>
HHYHRHY pushed a commit to SgtVincent/EMOS that referenced this pull request Aug 31, 2024
Co-authored-by: vincentpierre <vincentpierre@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed Do not delete this pull request or issue due to inactivity.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants