Nodir Kodirov
Nodir Kodirov

Reputation: 909

Does TensorFlow job use multiple cores by default?

I am running the imagenet from TensorFlow models repository. I've instrumented sess.run as described in Github comment and got the following view in the chrome://tracing

enter image description here

I am wondering if TF sometime uses multiple cores or single core all the time. I'd think it is using multiple cores when ops can run in parallel as shown in the red box of the figure. However, all these 6 threads are listed under /job:localhost/replicate:0/task:0/cpu:0 which makes me question my interpretation. Does cpu:0 mean all CPU cores?

I am running on a desktop with 8 cores. I run htop to see core utilization during the TF run and I see only one core getting saturated 95-100%.

Upvotes: 24

Views: 37987

Answers (1)

Nodir Kodirov
Nodir Kodirov

Reputation: 909

I found existing answer to this question. All cores are wrapped in cpu:0, i.e., TensorFlow does indeed use multiple CPU cores by default.

Upvotes: 36

Related Questions