1
據我所知TF只要並行調用多個運算符並行。 (link)TensorFlow:指定並行運行的Ops數
而並行可通過inter_op_parallelism_threads
和intra_op_parallelism_threads
如果在CPU(link)運行運營商ARë來控制。但是,這些參數完全不會影響GPU運算符。我該如何控制GPU的並行性? (例如,運行操作人員連續雖然有獨立的運營商)
編輯:
a=tf.random_normal([N,N])
b=tf.random_normal([N,N])
c=tf.random_normal([N,N])
d=tf.random_normal([N,N])
x=tf.matmul(a,b)
y=tf.matmul(c,d)
z=tf.matmul(x,y)
GPU僅運行在時間s一個計算運算 –
http://stackoverflow.com/questions/39481453/tensorflow-device-contexts-streams-and-context-switching –
@YaroslavBulatov然後sess.run(z)的應採取比sess.run 3倍(x),對嗎?但是,在我的實驗中,它只需要2倍。 – enc