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

[RLlib] Fix frame stacking connector for experiments with more than 1 Learner. #45588

Merged

Conversation

sven1977
Copy link
Contributor

@sven1977 sven1977 commented May 28, 2024

Fix frame stacking connector for experiments with more than 1 Learner.

The bug was that in SingleAgentEpisode.slice(), which the LearnerGroup has to do in order to slice the received episodes in n shards to be sent to the n Learners, we would NOT properly set the observation/action spaces in the returned slices. This then lead to an incorrect fill-value (shape=1D instead of Atari 4D) for the left edges of the episodes (framestacking at the first m episodes timesteps needs to be left-0-padded), where m = num_frames - 1.

Why are these changes needed?

Related issue number

Checks

  • I've signed off every commit(by using the -s flag, i.e., git commit -s) in this PR.
  • I've run scripts/format.sh to lint the changes in this PR.
  • I've included any doc changes needed for https://docs.ray.io/en/master/.
    • I've added any new APIs to the API Reference. For example, if I added a
      method in Tune, I've added it in doc/source/tune/api/ under the
      corresponding .rst file.
  • I've made sure the tests are passing. Note that there might be a few flaky tests, see the recent failures at https://flakey-tests.ray.io/
  • Testing Strategy
    • Unit tests
    • Release tests
    • This PR is not tested :(

Signed-off-by: sven1977 <svenmika1977@gmail.com>
Signed-off-by: sven1977 <svenmika1977@gmail.com>
Signed-off-by: sven1977 <svenmika1977@gmail.com>
Signed-off-by: sven1977 <svenmika1977@gmail.com>
Signed-off-by: sven1977 <svenmika1977@gmail.com>
Signed-off-by: sven1977 <svenmika1977@gmail.com>
Signed-off-by: sven1977 <svenmika1977@gmail.com>
Signed-off-by: sven1977 <svenmika1977@gmail.com>
Signed-off-by: sven1977 <svenmika1977@gmail.com>
Signed-off-by: sven1977 <svenmika1977@gmail.com>
Copy link
Collaborator

@simonsays1980 simonsays1980 left a comment

Choose a reason for hiding this comment

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

LGTM. Some changes from another PR are included here.

self,
stats_dicts,
stats_dicts: List[Dict[str, Any]],
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is already committed in the other PR today?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah, yes, very sorry. I had to make sure the other PR (MetricsLogger log_n_dicts() fix) is also in here otherwise, the Atari benchmark would have failed.

Thanks for pointing this out.

@sven1977 sven1977 enabled auto-merge (squash) May 28, 2024 13:09
@github-actions github-actions bot added the go add ONLY when ready to merge, run all tests label May 28, 2024
@sven1977 sven1977 disabled auto-merge May 28, 2024 13:11
Signed-off-by: sven1977 <svenmika1977@gmail.com>
Signed-off-by: sven1977 <svenmika1977@gmail.com>
Signed-off-by: sven1977 <svenmika1977@gmail.com>
@sven1977 sven1977 enabled auto-merge (squash) May 28, 2024 20:28
@sven1977 sven1977 added bug Something that is supposed to be working; but isn't rllib RLlib related issues rllib-connector Connector related issues rllib-newstack labels May 28, 2024
@sven1977 sven1977 merged commit ce5a90f into ray-project:master May 28, 2024
7 checks passed
ryanaoleary pushed a commit to ryanaoleary/ray that referenced this pull request Jun 6, 2024
… Learner. (ray-project#45588)

Signed-off-by: Ryan O'Leary <ryanaoleary@google.com>
ryanaoleary pushed a commit to ryanaoleary/ray that referenced this pull request Jun 6, 2024
… Learner. (ray-project#45588)

Signed-off-by: Ryan O'Leary <ryanaoleary@google.com>
ryanaoleary pushed a commit to ryanaoleary/ray that referenced this pull request Jun 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something that is supposed to be working; but isn't go add ONLY when ready to merge, run all tests rllib RLlib related issues rllib-connector Connector related issues rllib-newstack
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants