Algorithm Tensorflow如何转储结果放置算法

Algorithm Tensorflow如何转储结果放置算法,algorithm,tensorflow,Algorithm,Tensorflow,我对模型并行性很感兴趣,我已经从中阅读了代码。在那个例子中,我们应该将我们的模型(或者在tensorflow中我们称之为Graph)手动划分为不同的分区(left_网络和right_网络)。 所以,我想知道如果我必须手动进行分区,simple\u placer.cc和graph\u partition.cc对整个图形做了什么?我还是不太清楚 在我看来(如果有什么不对劲,请告诉我): 如果图中有8个分区(子图),可以看作是8个作业和4个辅助对象,那么如何通过以下方式将分区分配给辅助对象: 通过t

我对模型并行性很感兴趣,我已经从中阅读了代码。在那个例子中,我们应该将我们的模型(或者在tensorflow中我们称之为Graph)手动划分为不同的分区(left_网络和right_网络)。 所以,我想知道如果我必须手动进行分区,
simple\u placer.cc
graph\u partition.cc
对整个图形做了什么?我还是不太清楚

  • 在我看来(如果有什么不对劲,请告诉我): 如果图中有8个分区(子图),可以看作是8个作业和4个辅助对象,那么如何通过以下方式将分区分配给辅助对象:

    • 通过
      tf.device()
      进行显式注释,或
    • 分布式训练,
      tf.train.replica\u device\u setter()
      在参数服务器之间共享变量,否则将所有 工作设备上的操作

  • 但是图形是如何生成分区的呢? 我想追踪子图(op节点集)是什么样子的? 我可以转储结果还是需要跟踪/修改哪个代码文件

    请让我知道,如果有任何概念是错误的或含糊不清的。 我是这些方面的新手,任何意见都值得赞赏

  • 在下面的代码中,
    matmul
    是一个op节点吗,它会被划分成 不同的工作

    y_ = tf.placeholder(tf.float32, [None, 10])
    x = tf.placeholder(tf.float32, [None, 784])
    W = tf.Variable(tf.zeros([784, 10]))
    b = tf.Variable(tf.zeros([10]))
    y = tf.matmul(x, W)  + b
    

  • 调用
    tf.Session.run()


    非常有用的代码片段。我仍然在想,在插入发送/接收操作后,是否有办法将图形转储为PB?
    # ...
    y = tf.matmul(x, W) + b
    
    sess = tf.Session()
    options = tf.RunOptions(output_partition_graphs=True)
    metadata = tf.RunMetadata()
    
    sess.run(y, options=options, run_metadata=metadata)
    
    # `metadata` now contains information about what happened during the `run()` call.
    for partition in metadata.partition_graphs:
    
      # `partition` is a `tf.GraphDef` representing all the nodes that ran on a single
      # device. All nodes in `partition` have the same `device` value.
      device = partition.node[0].device
    
      for node in partition.node:
        # e.g. print each node or store it in a dictionary for further analysis.
        # ...