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] Enable Bandits to work in batches mode(s) (vector envs + multiple workers + train_batch_sizes > 1). #22465

Merged
merged 5 commits into from
Feb 17, 2022

Conversation

sven1977
Copy link
Contributor

@sven1977 sven1977 commented Feb 17, 2022

Enable Bandits to work in batches mode(s) (vector envs + multiple workers + train_batch_sizes > 1).

  • Removes some TODOs left by the original authors at amazon.
  • For the simple test cases we have, batching does not improve things, as it breaks the on-line assumption. However, for larger action spaces and bandit models, distributing and batching/vectorization could be very useful.

Why are these changes needed?

Related issue number

Checks

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

Copy link
Member

@gjoliver gjoliver 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, just 1 quick suggestion about comment.

self.arm.partial_fit(x[:, action_id], y)
for i, arm in enumerate(arms):
action_id = arm.item()
self.arm.partial_fit(x[[i], action_id], y[[i]])
Copy link
Member

Choose a reason for hiding this comment

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

maybe we can comment here for ParametricLinearModel, x are all the potential arms, arms tells us which one was pulled instead. and the features pointed at by arms should be used to train the actual model "arm" ...
I know it's twisted, maybe it's better left un-explained ...

@sven1977 sven1977 merged commit c58cd90 into ray-project:master Feb 17, 2022
fishbone added a commit that referenced this pull request Feb 18, 2022
…s + multiple workers + train_batch_sizes > 1). (#22465)"

This reverts commit c58cd90.
rkooo567 added a commit to rkooo567/ray that referenced this pull request Feb 18, 2022
…s + multiple workers + train_batch_sizes > 1). (ray-project#22465)"

This reverts commit c58cd90.
simonsays1980 pushed a commit to simonsays1980/ray that referenced this pull request Feb 27, 2022
@sven1977 sven1977 deleted the bandits_batched branch June 2, 2023 20:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants