【dist-train】 train cifar10 with multi-machine but something blocked
I follow this(https://github.com/dmlc/mxnet/tree/master/example/image-classification) to train cifar10 with multi-machine,but nothing happened but this log:
../../tools/launch.py -n 2 -H hosts --slave-dir /tmp/mxnet python train_cifar10.py --data-dir /opt/cifar10/ --kv-store dist_sync 2015-12-02 17:17:51,994 INFO start listen on 10.78.165.245:9091 2015-12-02 17:17:51,995 INFO rsync /public/wuxuewu/mxnet/mxnet-master/example/image-classification/ -> 10.78.165.245:/tmp/mxnet 2015-12-02 17:17:52,178 INFO rsync /public/wuxuewu/mxnet/mxnet-master/example/image-classification/ -> 10.78.140.142:/tmp/mxnet ssh -o StrictHostKeyChecking=no 10.78.165.245 'export DMLC_ROLE=worker; export DMLC_PS_ROOT_PORT=9091; export DMLC_PS_ROOT_URI=10.78.165.245; export DMLC_NUM_SERVER=0; export DMLC_NUM_WORKER=2; cd /tmp/mxnet; python train_cifar10.py --data-dir /opt/cifar10/ --kv-store dist_sync' ssh -o StrictHostKeyChecking=no 10.78.140.142 'export DMLC_ROLE=worker; export DMLC_PS_ROOT_PORT=9091; export DMLC_PS_ROOT_URI=10.78.165.245; export DMLC_NUM_SERVER=0; export DMLC_NUM_WORKER=2; cd /tmp/mxnet; python train_cifar10.py --data-dir /opt/cifar10/ --kv-store dist_sync'
1、I change launch.py from '--sync-dir' to '--slave-dir',because launch.py and dmlc_ssh.py is not same in the arg 2、the output above ‘ssh **’ is added for debug @tqchen @piiswrong
DMLC_NUM_SERVER=0
maybe this is a problem
I use the following script: ../../tools/launch.py -n 2 -s 1 -H hosts --slave-dir /tmp/mxnet python train_cifar10.py --data-dir /opt/cifar10/ --kv-store dist_sync and no nothing happened yet,somethig like blocked too. " 2015-12-03 08:57:39,706 INFO rsync /public/wuxuewu/mxnet/mxnet-master/example/image-classification/ -> 10.78.165.245:/tmp/mxnet 2015-12-03 08:57:39,913 INFO rsync /public/wuxuewu/mxnet/mxnet-master/example/image-classification/ -> 10.78.140.142:/tmp/mxnet
ssh -o StrictHostKeyChecking=no 10.78.165.245 'export DMLC_ROLE=server; export DMLC_PS_ROOT_PORT=9859; export DMLC_PS_ROOT_URI=10.78.165.245; export DMLC_NUM_SERVER=1; export DMLC_NUM_WORKER=2; cd /tmp/mxnet; python train_cifar10.py --data-dir /opt/cifar10/ --kv-store dist_sync'
ssh -o StrictHostKeyChecking=no 10.78.140.142 'export DMLC_ROLE=worker; export DMLC_PS_ROOT_PORT=9859; export DMLC_PS_ROOT_URI=10.78.165.245; export DMLC_NUM_SERVER=1; export DMLC_NUM_WORKER=2; cd /tmp/mxnet; python train_cifar10.py --data-dir /opt/cifar10/ --kv-store dist_sync'
ssh -o StrictHostKeyChecking=no 10.78.165.245 'export DMLC_ROLE=worker; export DMLC_PS_ROOT_PORT=9859; export DMLC_PS_ROOT_URI=10.78.165.245; export DMLC_NUM_SERVER=1; export DMLC_NUM_WORKER=2; cd /tmp/mxnet; python train_cifar10.py --data-dir /opt/cifar10/ --kv-store dist_sync' "
There is only process "../../tools/launch.py -n 2 -s 1 -H hosts --slave-dir /tmp/mxnet python train_cifar10.py --data-dir /opt/cifar10/ --kv-store dist_sync" on 10.78.165.245; And on 10.78.140.142, there is no process.
sometimes I interrupt the script by enter ctrl+c, nothing happened ,and on the two machines there are no process yet; While sometimes on machine 10.78.165.245, it will output: " ^C2015-12-03 09:12:02,262 INFO Stop luancher root@Master:/public/wuxuewu/mxnet/mxnet-master/example/image-classification# 2015-12-03 09:12:33,660 Node[0] start with arguments Namespace(batch_size=128, data_dir='/opt/cifar10/', gpus=None, kv_store='dist_sync', load_epoch=None, lr=0.05, lr_factor=1, lr_factor_epoch=1, model_prefix=None, network='inception-bn-28-small', num_epochs=20, num_examples=60000) 2015-12-03 09:12:15,894 Node[1] start with arguments Namespace(batch_size=128, data_dir='/opt/cifar10/', gpus=None, kv_store='dist_sync', load_epoch=None, lr=0.05, lr_factor=1, lr_factor_epoch=1, model_prefix=None, network='inception-bn-28-small', num_epochs=20, num_examples=60000) [09:12:33] src/io/iter_image_recordio.cc:212: ImageRecordIOParser: /opt/cifar10/train.rec, use 3 threads for decoding.. [09:12:15] src/io/iter_image_recordio.cc:212: ImageRecordIOParser: /opt/cifar10/train.rec, use 3 threads for decoding.. [09:12:33] src/io/./iter_normalize.h:98: Load mean image from /opt/cifar10/mean.bin [09:12:16] src/io/./iter_normalize.h:98: Load mean image from /opt/cifar10/mean.bin [09:12:33] src/io/iter_image_recordio.cc:212: ImageRecordIOParser: /opt/cifar10/test.rec, use 3 threads for decoding.. [09:12:34] src/io/./iter_normalize.h:98: Load mean image from /opt/cifar10/mean.bin 2015-12-03 09:12:34,283 Node[0] Start training with [cpu(0)] [09:12:17] src/io/iter_image_recordio.cc:212: ImageRecordIOParser: /opt/cifar10/test.rec, use 3 threads for decoding.. [09:12:17] src/io/./iter_normalize.h:98: Load mean image from /opt/cifar10/mean.bin 2015-12-03 09:12:17,828 Node[1] Start training with [cpu(0)] " And will show on Machine 10.78.165.245: root@Master:/tmp# ps -ef|grep train root 21777 1 0 09:12 pts/13 00:00:00 /bin/sh -c python train_cifar10.py --data-dir /opt/cifar10/ --kv-store dist_sync root 21778 1 0 09:12 pts/13 00:00:00 /bin/sh -c ssh -o StrictHostKeyChecking=no 10.78.140.142 'export DMLC_ROLE=worker; export DMLC_PS_ROOT_PORT=9859; export DMLC_PS_ROOT_URI=10.78.165.245; export DMLC_NUM_SERVER=1; export DMLC_NUM_WORKER=2; cd /tmp/mxnet; python train_cifar10.py --data-dir /opt/cifar10/ --kv-store dist_sync' root 21779 1 0 09:12 pts/13 00:00:00 /bin/sh -c ssh -o StrictHostKeyChecking=no 10.78.165.245 'export DMLC_ROLE=server; export DMLC_PS_ROOT_PORT=9859; export DMLC_PS_ROOT_URI=10.78.165.245; export DMLC_NUM_SERVER=1; export DMLC_NUM_WORKER=2; cd /tmp/mxnet; python train_cifar10.py --data-dir /opt/cifar10/ --kv-store dist_sync' root 21780 1 0 09:12 pts/13 00:00:00 /bin/sh -c ssh -o StrictHostKeyChecking=no 10.78.165.245 'export DMLC_ROLE=worker; export DMLC_PS_ROOT_PORT=9859; export DMLC_PS_ROOT_URI=10.78.165.245; export DMLC_NUM_SERVER=1; export DMLC_NUM_WORKER=2; cd /tmp/mxnet; python train_cifar10.py --data-dir /opt/cifar10/ --kv-store dist_sync' root 21781 21777 6 09:12 pts/13 00:00:00 python train_cifar10.py --data-dir /opt/cifar10/ --kv-store dist_sync root 21782 21778 0 09:12 pts/13 00:00:00 ssh -o StrictHostKeyChecking=no 10.78.140.142 export DMLC_ROLE=worker; export DMLC_PS_ROOT_PORT=9859; export DMLC_PS_ROOT_URI=10.78.165.245; export DMLC_NUM_SERVER=1; export DMLC_NUM_WORKER=2; cd /tmp/mxnet; python train_cifar10.py --data-dir /opt/cifar10/ --kv-store dist_sync root 21783 21779 0 09:12 pts/13 00:00:00 ssh -o StrictHostKeyChecking=no 10.78.165.245 export DMLC_ROLE=server; export DMLC_PS_ROOT_PORT=9859; export DMLC_PS_ROOT_URI=10.78.165.245; export DMLC_NUM_SERVER=1; export DMLC_NUM_WORKER=2; cd /tmp/mxnet; python train_cifar10.py --data-dir /opt/cifar10/ --kv-store dist_sync root 21784 21780 0 09:12 pts/13 00:00:00 ssh -o StrictHostKeyChecking=no 10.78.165.245 export DMLC_ROLE=worker; export DMLC_PS_ROOT_PORT=9859; export DMLC_PS_ROOT_URI=10.78.165.245; export DMLC_NUM_SERVER=1; export DMLC_NUM_WORKER=2; cd /tmp/mxnet; python train_cifar10.py --data-dir /opt/cifar10/ --kv-store dist_sync root 21858 21786 0 09:12 ? 00:00:00 bash -c export DMLC_ROLE=worker; export DMLC_PS_ROOT_PORT=9859; export DMLC_PS_ROOT_URI=10.78.165.245; export DMLC_NUM_SERVER=1; export DMLC_NUM_WORKER=2; cd /tmp/mxnet; python train_cifar10.py --data-dir /opt/cifar10/ --kv-store dist_sync root 21859 21785 0 09:12 ? 00:00:00 bash -c export DMLC_ROLE=server; export DMLC_PS_ROOT_PORT=9859; export DMLC_PS_ROOT_URI=10.78.165.245; export DMLC_NUM_SERVER=1; export DMLC_NUM_WORKER=2; cd /tmp/mxnet; python train_cifar10.py --data-dir /opt/cifar10/ --kv-store dist_sync root 21860 21858 5 09:12 ? 00:00:00 python train_cifar10.py --data-dir /opt/cifar10/ --kv-store dist_sync root 21861 21859 5 09:12 ? 00:00:00 python train_cifar10.py --data-dir /opt/cifar10/ --kv-store dist_sync root 21889 10940 0 09:12 pts/14 00:00:00 grep --color=auto train
show on machine 10.78.140.142: root@Slave1:~# ps -ef|grep train root 18059 18017 0 09:11 ? 00:00:00 bash -c export DMLC_ROLE=worker; export DMLC_PS_ROOT_PORT=9859; export DMLC_PS_ROOT_URI=10.78.165.245; export DMLC_NUM_SERVER=1; export DMLC_NUM_WORKER=2; cd /tmp/mxnet; python train_cifar10.py --data-dir /opt/cifar10/ --kv-store dist_sync root 18060 18059 70 09:11 ? 00:01:11 python train_cifar10.py --data-dir /opt/cifar10/ --kv-store dist_sync root 18254 1914 0 09:13 pts/6 00:00:00 grep --color=auto train
Anybody have run training with multi-machine successfully? @qiaohaijun Did you have run training with multi-machine successfully? what's you config or script? I have install mpich and set env well,but run the following script and nothing happened....
hadoop@Master:/public/wuxuewu/mxnet/mxnet-master/example/image-classification$ ../../tools/launch.py -n 2 -s 1 -H hosts --launcher mpirun --log-file /tmp/wuxuewu python train_cifar10.py --data-dir /opt/cifar10/ --kv-store dist_sync
please help me,thank you very much
@tqchen I have the same problem. Please have a look.
it looks normal to me.... probably the network port 9859 is getting blocked? i will do a PR to print more debug information soon.