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 - Offline RL] Allow incomplete SampleBatch data and fully compressed observations. #48699

Conversation

simonsays1980
Copy link
Collaborator

@simonsays1980 simonsays1980 commented Nov 12, 2024

Why are these changes needed?

Some users have observations in their old SampleBatch data that are fully compressed, i.e. compression is over all timesteps (instead of compressing each single observation in a list). These observations cannot be read in the actual state of the OfflinePreLearner. Furthermore, if experiences are incomplete, SingleAgentEpisodes cannot be built.

This PR suggests multiple small changes to the _map_sample_batches_to_episodes to enable reading old SampleBatch data with incomplete experiences and/or fully compressed observations.

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 :(

…d observations. Furthermore, enabled reading incomplete SampleBatch data (e.g. missing terminateds, truncateds, done, or next observations.

Signed-off-by: simonsays1980 <simon.zehnder@gmail.com>
@simonsays1980 simonsays1980 added enhancement Request for new feature and/or capability actor-based-usecase Issues when running large scale actor-based usecases. rllib-offline-rl Offline RL problems rllib RLlib related issues and removed actor-based-usecase Issues when running large scale actor-based usecases. labels Nov 12, 2024
@simonsays1980 simonsays1980 marked this pull request as ready for review November 12, 2024 11:40
Copy link
Contributor

@sven1977 sven1977 left a comment

Choose a reason for hiding this comment

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

Very nice PR! Thanks @simonsays1980!

A handful of nits and one question. Otherwise, good to go.

Signed-off-by: simonsays1980 <simon.zehnder@gmail.com>
@sven1977 sven1977 enabled auto-merge (squash) November 12, 2024 15:17
@github-actions github-actions bot added the go add ONLY when ready to merge, run all tests label Nov 12, 2024
@github-actions github-actions bot disabled auto-merge November 22, 2024 13:32
…sts.

Signed-off-by: simonsays1980 <simon.zehnder@gmail.com>
@sven1977 sven1977 changed the title [RLlib - Offline RL] - Allow incomplete SampleBatch data and fully compressed observations. [RLlib - Offline RL] Allow incomplete SampleBatch data and fully compressed observations. Nov 25, 2024
@sven1977 sven1977 merged commit 415ee19 into ray-project:master Nov 25, 2024
5 checks passed
jecsand838 pushed a commit to jecsand838/ray that referenced this pull request Dec 4, 2024
…pressed observations. (ray-project#48699)

Signed-off-by: Connor Sanders <connor@elastiflow.com>
dentiny pushed a commit to dentiny/ray that referenced this pull request Dec 7, 2024
…pressed observations. (ray-project#48699)

Signed-off-by: hjiang <dentinyhao@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Request for new feature and/or capability go add ONLY when ready to merge, run all tests rllib RLlib related issues rllib-newstack rllib-offline-rl Offline RL problems
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants