【发布时间】:2017-03-21 22:21:24
【问题描述】:
如果我在多 GPU 平台上使用一个 GPU 运行 tensorflow 模型(例如 cifar10),则 tensorflow 会在所有可用的 GPU 上创建和广播(训练/推理)数据。由于我将 num_gpus 设置为 1,因此它仅在一个 GPU 上运行。但是,我也可以在其他 gpus 上看到相同的进程。是有意的吗?这有什么理由吗?我很快检查了其他 DL 框架,如 Caffe,但设计/操作有所不同。当然,我可以在代码级别指定device,但我很好奇。此外,如果机器是共享的,这种默认设计可能会让其他用户感到厌烦。
tensorflow/core/common_runtime/gpu/gpu_device.cc:977] Creating TensorFlow device (/gpu:0) -> (device: 0, name:
tensorflow/core/common_runtime/gpu/gpu_device.cc:977] Creating TensorFlow device (/gpu:1) -> (device: 1, name:
tensorflow/core/common_runtime/gpu/gpu_device.cc:977] Creating TensorFlow device (/gpu:2) -> (device: 2, name:
tensorflow/core/common_runtime/gpu/gpu_device.cc:977] Creating TensorFlow device (/gpu:3) -> (device: 3, name: ...
+-----------------------------------------------------------------------------+
| Processes: GPU Memory |
| GPU PID Type Process name Usage |
|=============================================================================|
| 0 67056 C python 15623MiB |
| 1 67056 C python 15499MiB |
| 2 67056 C python 15499MiB |
| 3 67056 C python 15499MiB |
| 4 67056 C python 15499MiB |
【问题讨论】:
标签: tensorflow multi-gpu