-
Notifications
You must be signed in to change notification settings - Fork 93
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
Use With Vectorized Environments #130
Comments
Hey, Not really sure what you are actually asking but the type of environment should not really have much impact on how you use Reverb. |
@acassirer Vectorized environments meaning you interact with a batch of environments every time you call Here is a motivating example for why I think the question is worth while.
Having to iterate over every environment is quite slow and defeats the purpose of using a vectorized environment. Surely there must be a better way, I'm just unable to find it in the codebase. In case it's still not 100% clear what I'm looking for is a way to write a batch of experiences from N environments to the table without having to maintain a writer for each one of the N environments. |
This is a very relevant and common use-case in modern DRL. I also came looking for an answer to this. Ideally there would be a section in the documentation regarding batched writing of trajectories. Also, don't understand why this issue was closed. It's clearly not resolved. |
This topic is also discussed in this other issue: #78 |
@thomasbbrunner glad you replied to this thread, I killed so much time trying to use reverb with vectorized envs. What framework are you using (PyTorch, JAX, etc.)? |
I'm using a combination of PyTorch + Numpy. Currently facing problems, as between 50% and 90% of the time in my rollouts is spend on reverb, with the remaining being spent on stepping the environment + metrics. I tried using multithreading as described in #72 (comment), however, it did not lead to improvements (prob. limited by the GIL). Multiprocessing is a pain in Python, so prob. not an option (data has to pickleable). Not sure what to try next. Did you end up finding a solution for your use-case? |
What are the best practices for use with a vectorized environment? Any help is appreciated thank you
The text was updated successfully, but these errors were encountered: