MCPcopy Create free account
hub / github.com/BVLC/caffe / solve

Function solve

python/train.py:65–86  ·  view source on GitHub ↗
(proto, snapshot, gpus, timing, uid, rank)

Source from the content-addressed store, hash-verified

63
64
65def solve(proto, snapshot, gpus, timing, uid, rank):
66 caffe.set_mode_gpu()
67 caffe.set_device(gpus[rank])
68 caffe.set_solver_count(len(gpus))
69 caffe.set_solver_rank(rank)
70 caffe.set_multiprocess(True)
71
72 solver = caffe.SGDSolver(proto)
73 if snapshot and len(snapshot) != 0:
74 solver.restore(snapshot)
75
76 nccl = caffe.NCCL(solver, uid)
77 nccl.bcast()
78
79 if timing and rank == 0:
80 time(solver, nccl)
81 else:
82 solver.add_callback(nccl)
83
84 if solver.param.layer_wise_reduce:
85 solver.net.after_backward(nccl)
86 solver.step(solver.param.max_iter)
87
88
89if __name__ == '__main__':

Callers

nothing calls this directly

Calls 7

set_solver_countMethod · 0.80
set_solver_rankMethod · 0.80
set_multiprocessMethod · 0.80
SGDSolverMethod · 0.80
add_callbackMethod · 0.80
timeFunction · 0.70
NCCLMethod · 0.45

Tested by

no test coverage detected