Caffe supports multi-GPU distributed computing

Source: Internet
Author: User

Caffe allows parallel computing between multiple GPU, and multi-GPU mode is "not sharing data, but sharing network". When the number of GPU on the target machine is greater than 1 o'clock, Caffe will allow multiple solver to exist and be applied to different GPU.

Vector<int> GPUs;
Get_gpus (&gpus);
if (gpus.size () > 0)
{
    caffe::setdevice (gpus[0]);
    Caffe::set_mode (CAFFE::GPU);
    Enable multiple Solver
    Caffe::set_solver_count (Gpus.size ());
}


The first solver will become Root_solver_, and other solver will become shared_solver. Root_solver_ has a large part of the franchise, specifically the following points:


1 Log information: Avoid producing multiple duplicate information, so only allow Root_solver_ output log information;

2. Test: Only Root_solver_ can be tested, should be to reduce redundancy calculation;

3. Statistical results: Only ROOT_SOLVER_ can output statistical results, the reason is the 1th.


The place to use Solver_count directly is the DataReader object in the DataLayer layer. Each datalayer has a datareader,datareader working as an asynchronous thread, and the program allows multiple datalayer to be executed at the same time, but not multiple convlayer.


PS: This article mainly refers to Physcal "from the beginning of the Zero cottage Caffe three: Global thread Manager" article.


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.