TensorFlow 作业是否默认使用多核? [英] Does TensorFlow job use multiple cores by default?

查看:42
本文介绍了TensorFlow 作业是否默认使用多核?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在从 TensorFlow 模型运行 imagenet

我想知道 TF 有时是否一直使用多核或单核.当操作可以并行运行时,我认为它使用了多个内核,如图中的红框所示.但是,所有这 6 个线程都列在/job:localhost/replicate:0/task:0/cpu:0 下,这让我质疑我的解释.cpu:0 是否表示所有 CPU 内核?

我在具有 8 核的台式机上运行.我运行 htop 以查看 TF 运行期间的核心利用率,但我看到只有一个核心达到 95-100% 的饱和度.

解决方案

我发现 该问题的现有答案.所有内核都包裹在 cpu:0 中,即 TensorFlow 确实默认使用多个 CPU 内核.

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

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%.

解决方案

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.

这篇关于TensorFlow 作业是否默认使用多核?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆