TensorFlow MPI Enable Intro
如何编译并使用支持MPI的tensorflow
官方提供的readme.md中说只需要执行configure时选择MPI Support.但是笔者通过配置openmpi-1.8.15-cuda-8.0也就是cuda aware的mpi,编译过程并不顺利,会出现"fatal error: openmpi/ompi/mpi/cxx/mpicxx.h: No such file or directory"错误, 目前该功能的contributor也没有给出合理的解释.如果有成功的小伙伴麻烦share一下解决方法.
如果第一步你顺利编译得到安装包, 那么在使用的时候需要通过如下方式打开MPI 连接并server定义是增加grpc+mpi的协议.
server = tf.train.Server(cluster, job_name=”local”, task_index=0, protocol=’grpc+mpi’)
默认协议就是grpc.
概述
通过使用MPI协议,tf可以通过使用MPI API充分的利用高性能网络设施的优势.这就使得tf能够更好的利用如何infiniband这类高性能低延迟的网络.这些改变对于使用者而言是透明的,只需要修改对应的协议类型,并使用'mpirun'来启动脚本,比如:
mpirun -np 2 pyt