data61 / MP-SPDZ

Versatile framework for multi-party computation
Other
899 stars 278 forks source link

MPC computation times on heterogeneous hardware #952

Closed karannewatia closed 1 year ago

karannewatia commented 1 year ago

Hi,

I am trying to benchmark the computation times of an MPC on heterogeneous hardware, and was not sure how to reason about the pattern I'm seeing.

I am using the SPDZ-wise Shamir protocol which handles an honest-majority while having security against malicious parties. I use a committee size of 42. I ran the same MPC code each time. I use a combination of PowerEdge R430 servers and raspberry pi's in the committee to evaluate the computation time of an MPC in the presence of both powerful (PowerEdge servers) and slow (raspberry pi) devices.

My initial thought was that the MPC computation time would be bottlenecked by the slowest device. Although I did expect that adding even one raspberry pi would slow down the computation time compared to the time taken with no pi's, I thought that adding more than one pi would not further affect the computation time.

Here's some numbers I got when I ran with a variable number of pi's: 42 parties, 0 pi: Time = 72 seconds 42 parties, 1 pi: Time = 70 seconds 42 parties, 2 pi: Time = 76 seconds 42 parties, 3 pi: Time = 86 seconds These numbers are fairly stable when I run it multiple times.

Do you have any thoughts on why the computation times keeps increasing with more pi's added to the committee, and why the computation is actually slightly faster with one pi in the committee, compared to when there's no pi's in the committee? The total committee size is constant (42) across the runs. Please let me know.

Thank you, Karan

mkskeller commented 1 year ago

With Shamir, the work isn't evenly distributed between parties. Have you tried replacing different party numbers with Pis? Furthermore, is the network setup exactly the same for the Pis and the servers? It could be that there is a bottleneck in a router that used for the Pis but not the servers.