Intel® Distribution of OpenVINO™ Toolkit
Community assistance about the Intel® Distribution of OpenVINO™ toolkit, OpenCV, and all aspects of computer vision-related on Intel® platforms.

Chaining Movidius Sticks

idata
직원
2,157 조회수

I would like to chain several Movidus Sticks together to increase throughput. Do I need any special hardware, or will a standard USB 3 hub be sufficient?

0 포인트
13 응답
idata
직원
1,796 조회수

Jessica are you thinking of doing RCNN by sending each region to a stick for inference?

0 포인트
idata
직원
1,796 조회수

I saw a picture of a 4-headed USB hub with four of the sticks plugged into it on one of the websites, but I don't remember which one.

0 포인트
idata
직원
1,796 조회수

Hi @Jessica, @chicagobob123, @znmeb

 

No special hardware is required to use multiple NCS devices. A standard USB hub will work for this. Your software will need to handle each device by feeding it input and retrieving inferences from it.

 

Neal

0 포인트
idata
직원
1,796 조회수

@neal thanks

0 포인트
idata
직원
1,796 조회수

I saw the picture last night someplace as well. 4 connected to a single hub.

 

They reported that they worked together, like it was magic, but left no details on how.
0 포인트
idata
직원
1,796 조회수

@chicagobob123 the concept of scaling is quite simple - every device that's plugged into your host machine gets a zero-index unique ID, which can be used to reference a specific stick while calling any of the MvNC APIs. Use EnumerateDevices function to get a list of devices, which can be used with the Device class to generate a handle. Here's a code snippet to help you get started:

 

from mvnc import mvncapi as mvnc devices = mvnc.EnumerateDevices() devHandle.append(mvnc.Device(devices[devnum])) devHandle[devnum].OpenDevice()

 

You can now use devHandle to perform any operations on a specific device.

0 포인트
idata
직원
1,796 조회수

Hi@AshwinVijayakumar

 

In order to use 4 movidius sticks at the same time, I changed a part of the code of classification_example.py as follows.

 

devHandle.append(mvnc.Device(devices[0])) devHandle.append(mvnc.Device(devices[1])) devHandle.append(mvnc.Device(devices[2])) devHandle.append(mvnc.Device(devices[3])) devHandle[0].OpenDevice() devHandle[1].OpenDevice() devHandle[2].OpenDevice() devHandle[3].OpenDevice()

 

However, inference time does not change.

 

Is this code correct? Please give me some advices.

 

Thanks.

 

hide

0 포인트
idata
직원
1,796 조회수

Can you please paste your complete code here. The trick is to send four images, one to each stick using LoadTensor and then trying to get the result back from each stick using GetResult()

 

Hope this code below helps

 

def runparallel(count=100, num=[]): numdevices = num if len(num) == 0: numdevices = range(len(devices)) for i in range(count): # ***************************************************************** # Load the Tensor to each of the devices # ***************************************************************** for devnum in numdevices: img = choice(imgarr) graphHandle[devnum].LoadTensor(img, 'user object') # ***************************************************************** # Read the result from each of the devices # ***************************************************************** for devnum in numdevices: tensor, userobj = graphHandle[devnum].GetResult()
0 포인트
idata
직원
1,796 조회수

Thanks @ramana.rachakonda

 

Is it possible to use 4 sticks for inference of just 1 image in parallel as GPU does?
0 포인트
idata
직원
1,796 조회수

No, not at this time You can send four different images to each of the four sticks. Or you can load different networks on each stick and run them independently.

0 포인트
idata
직원
1,796 조회수

@ramana.rachakonda

 

Oh, I see.Thank you for the nice advice.
0 포인트
idata
직원
1,796 조회수

I have opened a pull request at: https://github.com/duangenquan/YoloV2NCS/pull/6

 

Enable multiple NCS devices to improve the throughput, hope this helps.
0 포인트
idata
직원
1,796 조회수

My previous pull request was merged, visit this link for details: https://github.com/duangenquan/YoloV2NCS

0 포인트
응답