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

Batch being moved to gpu repeatedly with multiple optimizers and single gpu training #1566

Closed
karlinjf opened this issue Apr 22, 2020 · 2 comments · Fixed by #1576
Closed
Labels
bug Something isn't working help wanted Open to be worked on

Comments

@karlinjf
Copy link
Contributor

If you have multiple optimizers, then transfer_batch_to_gpu winds up getting called once per opt_idx, and the batch is copied each time via copy.copy(batch) in training_forward. Why copy the batch when there is only a single gpu? By removing the copy.copy() my GAN model moves from 8.53it/s to 9.25it/s. Pretty significant speedup.

@karlinjf karlinjf added bug Something isn't working help wanted Open to be worked on labels Apr 22, 2020
@williamFalcon
Copy link
Contributor

amazing find! mind submitting a PR?

@karlinjf
Copy link
Contributor Author

Sure, will do.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Open to be worked on
Projects
None yet
2 participants