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

store numpy.array instead of DeviceArray in trajectories #386

Merged
merged 1 commit into from
Mar 19, 2020

Conversation

pkol
Copy link
Contributor

@pkol pkol commented Mar 18, 2020

This speeds up trajectory collection because extract_info_at_index() in
t2t/.../trjaectory.py now index numpy.array instead of DeviceArray and
it's about 10000x times faster.

I've benchmarked using command:
python trax/rl_trainer.py --config_file=trax/rl/configs/ppo_acrobot.gin --train_batch_size=32 --output_dir=/tmp/ppo_acrobot --alsologtostderr

Epoch time goes down from 84s to 9s per iteration.

This speeds up trajectory collection because extract_info_at_index() in
t2t/.../trjaectory.py now index numpy.array instead of DeviceArray and
it's about 10000x times faster.

I've benchmarked using command:
python trax/rl_trainer.py   --config_file=trax/rl/configs/ppo_acrobot.gin   --train_batch_size=32   --output_dir=/tmp/ppo_acrobot   --alsologtostderr

Epoch time goes down from 84s to 9s per iteration.
@afrozenator
Copy link
Contributor

This is great, thanks @pkol !

@afrozenator afrozenator added the ready to pull Added when the PR is ready to be merged. label Mar 19, 2020
@trax-robot trax-robot merged commit c239229 into google:master Mar 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes ready to pull Added when the PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants