altosaar opened a new issue #10508: MXNet much slower than TensorFlow
URL: https://github.com/apache/incubator-mxnet/issues/10508
 
 
   I might be doing this comparison wrong - please let me know! Most likely I 
have written a bug that causes the slowdown.
   
   I implemented a variational autoencoder in MXNet using the Gluon library, 
and hybridized it. Here is the code: 
https://gist.github.com/altosaar/6c153e9ebd89a4b8ef6a638ed1520de4
   
   I also implemented it in TensorFlow: 
https://github.com/altosaar/variational-autoencoder
   
   However, it is orders of magnitude slower in MXNet than in TensorFlow. I 
made sure to match the hyperparameters and checked that I get the same results 
in both frameworks, so I don't think there is a bug in terms of the math (both 
implementations get to a training ELBO of around -100 on the binary MNIST 
dataset in a few thousand iterations). 
   
   I'm using MXNet 1.1.0 with a P100 GPU, and TensorFlow 1.6.0. 
   
   Here is the timing information:
   
   
   MXNet:
   
   With GPU:
   
   ```
   $ python train.py
   Iter 1000       ELBO: -144.5    speed: 3.567e-03 s/iter
   Iter 2000       ELBO: -118.3    speed: 3.686e-03 s/iter
   ```
   
   
   Without GPU:
   
   ```
   $ python train.py
   Iter 1000       ELBO: -143.0    speed: 1.171e-02 s/iter
   Iter 2000       ELBO: -121.2    speed: 1.192e-02 s/iter
   ```
   
   TensorFlow:
   
   On CPU: 
   
   ```
   $ python vae.py
   Iteration: 1000 ELBO: -137.405 sec/iter: 1.878e-06
   Iteration: 2000 ELBO: -125.329 sec/iter: 1.929e-06
   ```

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to