Comments (6)
@kashif thanks for your response. The TF version does not use the GPU either. I will try torch.no_grad() wrappers
. I test your code in my experiments.
Thanks
Han
from firedup.
I've observed the same thing in the official Spinning Up PyTorch SAC code. For whatever reason, it's just slower, even when you're being very careful to only calculate quantities that are absolutely necessary. I haven't figured out why, yet! Hopefully will crack this eventually.
from firedup.
@zhan0903 thanks for trying it out! So there could be 2 reasons for this:
- I am calculating the gradients of the computational graph un-necessarily (thats where TF is better since it only runs the part of the graph that is needed) and a solution might be to add
torch.no_grad()
wrappers where needed - TF will use the GPU if you are running on a GPU machine whereas currently I only run on the CPU
Do you have a benchmarking setup to test these reasons?
Thanks!
Kashif
from firedup.
thank you!
from firedup.
@kashif Hi, I used the torch.no_grad()
in the backpropagation process for SAC, but it didn't improve the speed. The TF version doesn't use the GPU, but it is faster than the pytorch GPU version (TF version SAC takes 7000 seconds, while the pytorch GPU version takes around 15000 seconds).
from firedup.
Thanks @jachiam I'll have a look too perhaps after the icml deadline...
from firedup.
Related Issues (9)
- Performance Differences between Tensorflow and Pytorch HOT 8
- Use `q1_pi1` for `pi_loss` HOT 4
- ddpg torch error HOT 3
- Confusion: Why are you adding 1 here? HOT 1
- How can I easily modify the code? HOT 1
- Is there any requirements for the env to fit in this repo? HOT 5
- Run on GPU HOT 1
- pi = policy.rsample()? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from firedup.