Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Configuring Tensorflow to use all CPU's

Tags:

Reading : https://www.tensorflow.org/versions/r0.10/resources/faq.html it states :

Does TensorFlow make use of all the devices (GPUs and CPUs) available on my machine?

TensorFlow supports multiple GPUs and CPUs. See the how-to documentation on using GPUs with TensorFlow for details of how TensorFlow assigns operations to devices, and the CIFAR-10 tutorial for an example model that uses multiple GPUs.

Note that TensorFlow only uses GPU devices with a compute capability greater than 3.5.

Does this mean Tensorflow can automatically make use of all CPU's on given machine or does it ned to be explicitly configured ?

like image 232
blue-sky Avatar asked Sep 08 '16 15:09

blue-sky


People also ask

Can TensorFlow use multiple CPUs?

Running TensorFlow on multicore CPUs can be an attractive option, e.g., where a workflow is dominated by IO and faster computational hardware has less impact on runtime, or simply where no GPUs are available. This talk will discuss which TensorFlow package to choose, and how to optimise performance on multicore CPUs.

Can TensorFlow use both CPU and GPU?

If a TensorFlow operation has both CPU and GPU implementations, by default, the GPU device is prioritized when the operation is assigned. For example, tf. matmul has both CPU and GPU kernels and on a system with devices CPU:0 and GPU:0 , the GPU:0 device is selected to run tf.

Can TensorFlow use multiple GPUs?

Strategy is a TensorFlow API to distribute training across multiple GPUs, multiple machines, or TPUs. Using this API, you can distribute your existing models and training code with minimal code changes.


1 Answers

CPUs are used via a "device" which is just a threadpool. You can control the number of threads if you feel like you need more:

sess = tf.Session(config=tf.ConfigProto(
  intra_op_parallelism_threads=NUM_THREADS))
like image 123
Alexandre Passos Avatar answered Sep 18 '22 13:09

Alexandre Passos