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

MultithreadedEnvs and Trajectories #920

Open
HenriDeh opened this issue Jul 6, 2023 · 1 comment
Open

MultithreadedEnvs and Trajectories #920

HenriDeh opened this issue Jul 6, 2023 · 1 comment
Labels
Milestone

Comments

@HenriDeh
Copy link
Member

HenriDeh commented Jul 6, 2023

I'm creating this issue to pin down that MultiThreadedEnvs do not currently work.

It steps each inner env in parallel and stores the traces, but there's nothing that can be done with that currently as we would need to store each separate trajectory (in the seminal sense of "trajectory") contiguously in the replay buffer. Right now with the caching implementation, they can only be mixed up in the storage.

Options I see to address that

  1. extend trajectories to have N (number of parallel envs) containers, each will pertain to one env and have a capacity of 1/Nth the total capacity of the trajectory.
  2. partition the container into N partitions.
  3. Create a small Trajectory for each env and append to the main Trajectory at the end of an episode.

I clearly prefer the first option, it is straightfoward and probably the most efficient.

@Mytolo
Copy link
Contributor

Mytolo commented Jul 10, 2023

In my opinion, in the first option, each container should have the full capacity? The MultiThreadEnv is simply to speed up experience gathering, so each container should behave as it would be a single environment. User perspective would be to define how much experience should be stored for one environment. That way, there are also no worries about rounding / ceiling for the capacity, since it has to be a whole number.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants