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

[BE] Fix the env pause issue #1744

Merged
merged 2 commits into from
Jan 12, 2024
Merged

[BE] Fix the env pause issue #1744

merged 2 commits into from
Jan 12, 2024

Conversation

jimmytyyang
Copy link
Contributor

Motivation and Context

This is to fix the issue when doing an evaluation on the HRL policy, the size of internal stateful parameters does not match the number of active skills. The issue has been known in multiple places:

(1) our team's slack channel
(2) github issues: #1718
(3) myself
issue_be

How Has This Been Tested

Loading the social nav checkpoint and run full dataset evaluation

Types of changes

  • [Bug Fix] (non-breaking change which fixes an issue)

Checklist

  • My code follows the code style of this project.
  • I have updated the documentation if required.
  • I have read the CONTRIBUTING document.
  • I have completed my CLA (see CONTRIBUTING)
  • I have added tests to cover my changes if required.

@facebook-github-bot facebook-github-bot added the CLA Signed Do not delete this pull request or issue due to inactivity. label Jan 10, 2024
@@ -302,6 +302,10 @@ def evaluate_agent(
rgb_frames,
)

# We pause the statefull parameters in the policy
if any(envs_to_pause):
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why add this? Should on_envs_pause should be able to handle empty lists of ends to pause?

Copy link
Contributor

@xavierpuigf xavierpuigf left a comment

Choose a reason for hiding this comment

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

Same comment as Andrew, I think you dont need the if condition and can always call envs_to_pause with empty list. Unless the reason is efficiecny in not doing these checks.
Thanks for the fix!

@jimmytyyang
Copy link
Contributor Author

@xavierpuigf and @ASzot Thanks for the review! I noticed that this code (

) could prevent us from removing the condition if any(envs_to_pause):

Maybe we could add a check inside def filter_envs(self, curr_envs_to_keep_active)?

@xavierpuigf
Copy link
Contributor

xavierpuigf commented Jan 11, 2024

@xavierpuigf and @ASzot Thanks for the review! I noticed that this code (

) could prevent us from removing the condition if any(envs_to_pause):
Maybe we could add a check inside def filter_envs(self, curr_envs_to_keep_active)?

good point! yeah I would add the check in fixed_policy instead, as you suggest. @jimmytyyang

@jimmytyyang
Copy link
Contributor Author

jimmytyyang commented Jan 12, 2024

Thanks for the review! Andrew spoke with me saying that he is fine with the current implementation, and it might introduce an overhead if there are no envs to pause. So based on this and what Xavi suggested, I feel that I would like to expose this and I will add a comment there to say why we want to have this condition. Thanks for the awesome review! :)

@jimmytyyang jimmytyyang merged commit 654830f into main Jan 12, 2024
3 of 4 checks passed
dannymcy pushed a commit to dannymcy/habitat-lab that referenced this pull request Jul 8, 2024
* fix the env pause issue

* add comment

---------

Co-authored-by: Jimmy Yang <jimmytyyang@meta.com>
HHYHRHY pushed a commit to SgtVincent/habitat-lab that referenced this pull request Aug 31, 2024
* fix the env pause issue

* add comment

---------

Co-authored-by: Jimmy Yang <jimmytyyang@meta.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