Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

speed benchmark for testing tensorflow install

Tags:

I'm doubting whether tensorflow is correctly configured on my gpu box, since it's about 100x slower per iteration to train a simple linear regression model (batchsize = 32, 1500 input features, 150 output variables) on my fancy gpu machine than on my laptop.

I'm using a Titan X, with a modern cpu, etc. nvidia-smi says that I'm only at 10% gpu utilization, but I expect that's because of the small batchsizes. I'm not using a feed_dict to move data into the computation graph. Everything is coming via a tf.decode_csv and tf.train.shuffle_batch.

Does anyone have any recommendations for how to easily test whether my install is correct? Are there any simple speed benchmarks? The speed difference between my laptop and the gpu machine is so dramatic that I'm expecting that things aren't configured properly.

like image 306
DBelanger Avatar asked Feb 29 '16 15:02

DBelanger


People also ask

How do you benchmark a TensorFlow model?

To run benchmarks on iOS device, you need to build the app from source. Put the TensorFlow Lite model file in the benchmark_data directory of the source tree and modify the benchmark_params. json file. Those files are packaged into the app and the app reads data from the directory.

How do I know if TensorFlow is running on CPU or GPU?

Session(config=tf. ConfigProto(log_device_placement=True)) which is outlined in other answers as well as in the official TensorFlow documentation, you can try to assign a computation to the gpu and see whether you have an error. "/cpu:0": The CPU of your machine. "/gpu:0": The GPU of your machine, if you have one.


1 Answers

Try tensorflow/tensorflow/models/image/mnist/convolutional.py, that'll print per-step timing.

On Tesla K40c that should get about 16 ms per step, while about 120 ms for CPU-only on my 3 year old machine


Edit: This moved to the models repositories: https://github.com/tensorflow/models/blob/master/tutorials/image/mnist/convolutional.py.

The convolutional.py file is now at models/tutorials/image/mnist/convolutional.py

like image 57
Yaroslav Bulatov Avatar answered Dec 11 '22 22:12

Yaroslav Bulatov