Python Tensorflow GPU-设备互连、流执行器和强度1边缘矩阵?

Python Tensorflow GPU-设备互连、流执行器和强度1边缘矩阵?,python,tensorflow,keras,Python,Tensorflow,Keras,我有一个装有4个Nvidia K80 GPU的盒子。我在运行Tensorflow 2。当我运行培训课程(tf.keras=>model.fit())时,我会看到以下日志语句: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1102] Device interconnect StreamExecutor with strength 1 edge matrix: I tensorflow/core/common_runtime/gpu/gpu_

我有一个装有4个Nvidia K80 GPU的盒子。我在运行Tensorflow 2。当我运行培训课程(
tf.keras
=>
model.fit()
)时,我会看到以下日志语句:

I tensorflow/core/common_runtime/gpu/gpu_device.cc:1102] Device interconnect StreamExecutor with strength 1 edge matrix:
I tensorflow/core/common_runtime/gpu/gpu_device.cc:1108]      0 1 2 3
I tensorflow/core/common_runtime/gpu/gpu_device.cc:1121] 0:   N Y N N
I tensorflow/core/common_runtime/gpu/gpu_device.cc:1121] 1:   Y N N N
I tensorflow/core/common_runtime/gpu/gpu_device.cc:1121] 2:   N N N Y
I tensorflow/core/common_runtime/gpu/gpu_device.cc:1121] 3:   N N Y N
问题: 这个网格的意义是什么,我能利用多少


值得一提的是,我的模型如下所示,我无法让它使用多个GPU:

model = tf.keras.Sequential([
    tf.keras.layers.Embedding(vocab_size, emb_dim, mask_zero=mask_zero),
    tf.keras.layers.Bidirectional(tf.keras.layers.LSTM(lstm_dim)),
    tf.keras.layers.Dense(dense_dim, activation='relu'),
    tf.keras.layers.Dense(2, activation='softmax')
])
简言之,“Y”(是)表示在多GPU设置中,GPU之间以及对网络适配器、固态驱动器等具有直接内存访问。它被调用,您利用它的程度取决于特定任务和
tf.distribute.Strategy

要了解影响,您必须在正常设置下评测代码,然后直接使用GPU。一般来说,CPU开销越大是您的瓶颈,您就越有可能从这项技术中获益

“潜在”,因为实际上这取决于任务的性质。如果CPU主要忙于启动内核(因为您使用了GRU层和ReLU激活,而这一层没有cuDNN优化版本),那么GPU direct无法以任何方式帮助您


但是,如果GPU需要交换信息或经常从IO读取信息,那么您就有了一个良好的开端。

我是否回答了您的问题?是的。非常感谢你。