0

I am using Nvidia Digits Box with GPU (Nvidia GeForce GTX Titan X) and Tensorflow 0.6 to train the Neural Network, and everything works. However, when I check the Volatile GPU Util using nvidia-smi -l 1, I notice that it's only 6%, and I think most of the computation is on CPU, since I notice that the process which runs Tensorflow has about 90% CPU usage. The result is the training process is very slow. I wonder if there are ways to make full usage of GPU instead of CPU to speed up the training process. Thanks!

4

1 回答 1

3

我怀疑你在某个地方遇到了瓶颈(比如在这个 github问题中)——你有一些没有 GPU 实现的操作,所以它被放置在 CPU 上,并且由于数据传输,GPU 处于空闲状态。例如,直到最近reduce_mean才在 GPU 上实现,在此之前Rank也没有在 GPU 上实现,它被许多操作隐式使用。

有一次,我看到来自fully_connected_preloaded.py的网络很慢,因为有一个Rank操作被放置在CPU 上,因此在每一步都触发了整个数据集从GPU 到CPU 的传输。

为了解决这个问题,我首先建议升级到 0.8,因为它为 GPU 实现了更多操作(reduce_prod用于整数输入reduce_mean等)。

然后,您可以创建会话log_device_placement=True并查看是否有任何操作放置在 CPU 或 GPU 上,这些操作会导致每步传输过多。

输入管道(例如parse_example)中经常有没有 GPU 实现的操作,我发现有时使用with tf.device("/cpu:0"):块将整个输入管道固定到 CPU 很有帮助

于 2016-04-30T04:16:26.353 回答