data61 / MP-SPDZ

Versatile framework for multi-party computation
Other
888 stars 274 forks source link

Individual timers not shown in final benchmark summary for binary domain #666

Closed siberianhuskies closed 1 year ago

siberianhuskies commented 1 year ago

Hello,

when using timers (start_timer and stop_timer) in a program at the end of a benchmark MP-SPDZ displays a summary of how long the individual timers took

...
Time = ...
Time1 = ...
Time2 = ...
Date sent = ...
...

This is quite useful.

However, programs in the binary domain (compile.py -B) like e.g. CCD do not show the individual timers, and only the total runtime.

...
Time = ...
Date sent = ...
...

The "Starting/Stopped timer" messages during the execution are shown.

...
Starting timer 1 at ...
Stopped timer 1 at ...
Starting timer 2 at ...
Stopped timer 2 at ...
...

Simple example code that triggers the "error":

start_timer(1)
a = sint(0)
stop_timer(1)

start_timer(2)
a = sint(0)
stop_timer(2)

Using compile.py and Scripts/Shamir.sh works as intended, where as compile.py -B 64 and 'Scripts/ccd.sh` does not show the timer summary.

Am I doing something wrong?

Best regards

mkskeller commented 1 year ago

Thank you for raising this. You should find that 091484bc94e720f2fc522301d6b7b5b1560d00eb fixes it.

siberianhuskies commented 1 year ago

It fixes it partially. It seems like for the binary domain ones with "bmr" in their names it still does not work. The others work now.

mkskeller commented 1 year ago

With BMR it's not possible to get a meaningful timing. This is because BMR works in several stages: first the parties run over the code to schedule the garbling, then they execute the garbling, and then the run over the code once more for evaluation. You could time either of the code runs, but it would be far less than the total time, so the timing will only be confusing.

siberianhuskies commented 1 year ago

OK, thanks for clarification!