Multinode Training Log Files
Hi,
I have read the Multinode wiki, but some of the aspects of intel's implementation of synchronous parallel training is still not clear to me. I appreciate if someone could help me with the following:
-
As I far as I understood, each process prints out its loss function to that log file. It is stated that intel uses the Synchronous method for parallelization. But why does each of the processes report a different loss function? Shouldn't all the weights be the same? Is this perhaps because each of them starts from a different set of weights (due to initialization with a different random seed?, is there anyway to avoid that, so all of them have the same weights throughout the training?)
-
Assuming that each mpi process has a different set of weights, then how should we compute the final top-1/5 accuracy? Currently each of them reports a different number. Perhaps average them?
-
Is there anyway to control which processes print to the log file? This is specially important for large number of mpi processes, since the output gets really cluttered
As always your help is greatly appreciated
For data parallelism, each process gets different data input so loss is different. Each process has the same weight value. They are synced via allreduce operation. You may add "-l" option to "mpirun" so that you can get the rank id at the beginning of each line of log.
Ok that makes sense. Many thanks,
@jgong5 I found that different rank ID are not running at the same time, such as for a certain iteration some rank ID can be minutes earlier than others, and they won't wait, so I wander how does it upgrade the weights synchronously?I have tried the mpirun and run_intelcaffe.sh, both turned out asynchronously.
Could you provide the command and logs? If synchronous SGD is enabled, the weight gradient is synchronized every iterations. You can go through the code in multi_solver.cpp and multi_sync.hpp.
@fzou1 Thanks for your reply! Here is the command: ./scripts/run_intelcaffe.sh --hostfile $PBS_NODEFILE --solver ~/caffe/models/intel_optimized_models/ssd/VGGNet/coco/SSD_300x300/solver_16.prototxt --weights ~/caffe/models/intel_optimized_models/ssd/VGGNet/VGG_ILSVRC_16_layers_fc_reduced.caffemodel >run_16_tcp.out 2>&1 some of the training log :
MLSL_NUM_SERVERS: 2 MLSL_SERVER_AFFINITY: 6,7 Pin internal threads to: 22,23 Number of OpenMP threads: 10 Run caffe with 9 nodes...
5] I0325 23:29:21.732120 125918 sgd_solver.cpp:215] Iteration 570, lr = 0.003764 [6] I0325 23:29:24.325081 129886 solver.cpp:312] Iteration 620, loss = 8.78523 [6] I0325 23:29:24.325187 129886 solver.cpp:333] Train net output #0: mbox_loss = 8.86919 (* 1 = 8.86919 loss) [6] I0325 23:29:24.325193 129886 sgd_solver.cpp:215] Iteration 620, lr = 0.004024 [7] I0325 23:29:49.322942 44761 solver.cpp:312] Iteration 600, loss = 8.64949 [7] I0325 23:29:49.323079 44761 solver.cpp:333] Train net output #0: mbox_loss = 8.79793 (* 1 = 8.79793 loss) [7] I0325 23:29:49.323087 44761 sgd_solver.cpp:215] Iteration 600, lr = 0.00392 [4] I0325 23:29:59.895072 77895 solver.cpp:312] Iteration 660, loss = 8.76228 [4] I0325 23:29:59.895213 77895 solver.cpp:333] Train net output #0: mbox_loss = 8.78238 (* 1 = 8.78238 loss) [4] I0325 23:29:59.895222 77895 sgd_solver.cpp:215] Iteration 660, lr = 0.004232 [3] I0325 23:30:09.331172 229316 solver.cpp:312] Iteration 710, loss = 8.39254 [3] I0325 23:30:09.331315 229316 solver.cpp:333] Train net output #0: mbox_loss = 8.72813 (* 1 = 8.72813 loss)
Okay. Is it possible to attach full log?
I believe you should not enable multinode functionality and synchronous SGD. Please rebuild caffe with USE_MLSL=1 or use latest caffe release (ver: 1.1.1) which set this flag by default. And suggest to use 2^n nodes for multinode training, like 2, 4, 8 nodes.
BTW, we're also working on multinode convergence of SSD topology.
Really appreciate for that! It worked for me but the detection_eval didn't show the right result, I have to test it offline.
[29] I0329 01:00:03.226524 76734 net.cpp:1560] Ignoring source layer mbox_loss [25] I0329 01:04:41.338580 159427 solver.cpp:700] Test net output #0: detection_eval = 153.772 [18] I0329 01:04:41.341315 86088 solver.cpp:700] Test net output #0: detection_eval = 153.772 [17] I0329 01:04:41.338052 237317 solver.cpp:700] Test net output #0: detection_eval = 153.772 [0] I0329 01:04:41.343241 105754 solver.cpp:700] Test net output #0: detection_eval = 0.232988 [3] I0329 01:04:41.338836 24511 solver.cpp:700] Test net output #0: detection_eval = 153.772
BTW, what should I do to merge the relu and BN with conv layers , is there any guide for that?