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

Optimizing for GPU parallelized environments that return batched torch cuda tensors #13

Open
StoneT2000 opened this issue Oct 31, 2024 · 0 comments

Comments

@StoneT2000
Copy link

StoneT2000 commented Oct 31, 2024

Currently trying to modify my current PPO code for ManiSkill GPU sim (mostly based on clean rl as well) that is modified to do everything on the GPU. I am trying to squeeze as much performance out as possible and am reviewing the torch compile ppo continuous code right now.

A few questions

  1. I can probably remove all the .to(device) calls of tensordicts right? e.g.
    obs = next_obs = next_obs.to(device, non_blocking=True)
    done = next_done.to(device, non_blocking=True)
    container = torch.stack(ts, 0).to(device)

And is the original non_blocking meant to to ensure we don't eagerly move it until we need to (e.g. next inference step in the rollout)?

  1. How bad are .eval, .train calls? and how come they should be avoided? I thought they were like simple switches
  2. Are there potentially any environment side optimizations to make RL faster? Im aware of some things that can be made to do be done non-blocking, I wonder if the same can be done for environment observations and rewards? Are there other tricks?

Thanks! Looking forward to trying to set some training speed records with these improvements!

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

No branches or pull requests

1 participant