I am running TensorFlow 0.10.0rc0 on an Ubuntu 14.04 server with 48 cores and python 2.7. I noticed that I have an unusual high thread count. I thought found the explanation that TensorFlow will spawn multiple threads for two threadpools and that they can be controlled by:
sess = tf.Session(
config=tf.ConfigProto(inter_op_parallelism_threads=NUM_CORES,
intra_op_parallelism_threads=NUM_CORES))
However, that does not work and after some investigation, I found out that just calling import tensorflow as tf
increases the thread count already by around 50-60.
Why is this happening? How can I prevent it and limit the actual number of threads? What are those extra threads doing if I limit the number of inter_op_parallelism_threads
and intra_op_parallelism_threads
?