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] PyTorch A2C is not GPU accelerated #4333

Closed
nautilus22 opened this issue Mar 12, 2019 · 2 comments · Fixed by #4553
Closed

[rllib] PyTorch A2C is not GPU accelerated #4333

nautilus22 opened this issue Mar 12, 2019 · 2 comments · Fixed by #4553
Projects

Comments

@nautilus22
Copy link

System information

  • OS Platform and Distribution (e.g., Linux Ubuntu 16.04): Ubuntu 16.04.6 LTS (GCP)
  • Ray installed from (source or binary): source
  • Ray version: 0.6.4
  • Python version: 3.6.8

Describe the problem

I tested atari-a2c with tuned parameter(/tuned_examples/atari-a2c.yaml)
It showed great result for atari breakout.
However if "use_pytorch": true was added, the result is quite different. (I used "atari-a2c-pytorch.yaml" in the 'Source code / logs' section)
It was very slow and it seems that there was no improvement.
I guess there's some performance issue on pytorch a2c, but are there any necessary options for pytorch a2c?

image
image

Source code / logs

atari-a2c.yaml

atari-a2c:
    env:
        grid_search:
            - BreakoutNoFrameskip-v4
            - BeamRiderNoFrameskip-v4
            - QbertNoFrameskip-v4
            - SpaceInvadersNoFrameskip-v4
    run: A2C
    config:
        sample_batch_size: 20
        clip_rewards: True
        num_workers: 5
        num_envs_per_worker: 5
        num_gpus: 1
        lr_schedule: [
            [0, 0.0007],
            [20000000, 0.000000000001],
        ]

atari-a2c-pytorch.yaml

atari-a2c:
    env:
        grid_search:
            - BreakoutNoFrameskip-v4
            - BeamRiderNoFrameskip-v4
            - QbertNoFrameskip-v4
            - SpaceInvadersNoFrameskip-v4
    run: A2C
    config:
        sample_batch_size: 20
        clip_rewards: True
        num_workers: 5
        num_envs_per_worker: 5
        num_gpus: 1
        lr_schedule: [
            [0, 0.0007],
            [20000000, 0.000000000001],
        ]
        use_pytorch: True
@nautilus22 nautilus22 changed the title Different performance on a2c pytorch [rllib] Different performance on a2c pytorch Mar 12, 2019
@ericl
Copy link
Contributor

ericl commented Mar 12, 2019

We haven't spent time tuning the torch vision models, so this is probably expected. Also, PyTorch needs explicit tensor.cuda() calls to support GPU acceleration, which is not implemented as well (help here would be welcome)!

pong-a3c-pytorch.yaml might still work ok though, cc @richardliaw

@ericl ericl added the perf label Mar 12, 2019
@ericl ericl changed the title [rllib] Different performance on a2c pytorch [rllib] PyTorch A2C is not GPU accelerated Mar 12, 2019
@ericl ericl added this to Needs triage in RLlib via automation Mar 12, 2019
@nautilus22
Copy link
Author

Thank you for your answer.
Me and my team are seriously considering working on pytorch A2C acceleration.

RLlib automation moved this from Needs triage to Done Mar 12, 2019
@nautilus22 nautilus22 reopened this Mar 12, 2019
RLlib automation moved this from Done to Needs triage Mar 12, 2019
@ericl ericl moved this from Needs triage to Backlog in RLlib Mar 15, 2019
RLlib automation moved this from Backlog to Done Apr 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
RLlib
  
Done
Development

Successfully merging a pull request may close this issue.

2 participants