-
Notifications
You must be signed in to change notification settings - Fork 270
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Different timings for operations on sfix and sint #1400
Comments
It's not based on one particular paper, but a raft of works depending on the protocol and the options you chose. The following section in the documentation has pointers to the most important ones: https://mp-spdz.readthedocs.io/en/latest/non-linear.html
sfix uses 31-bit numbers by default whereas the default for sint is 63 or 64 depending on the domain.
Truncation is applied after every multiplication. The generic operation is based on https://www.ifca.ai/pub/fc10/31_47.pdf but there are also specific operations for certain settings like https://eprint.iacr.org/2019/131 or https://eprint.iacr.org/2020/1330.
Truncation is more expensive than the multiplication, so sfix-sfix multiplication is more expensive than sfix-sint or sint-sint. |
Thanks for the comprehensive answer! I have one last question: What is the reason for division to be so significantly slower than other operations? |
Division is much more intricate, which is also reflected in the fact that even CPUs usually take several clock cycles for it. You can look at Protocol 3.3 in the paper by Catrina and Saxena for more details on how division works. |
Hi Marcell
I am trying to understand the implementation of many operations in MP-SPDZ.
Is there a clear explanation to the behaviours? I tried to find answers in the code, but I still don't understand why the time diverges.
I would appreciate an explanation for the time difference, which algorithms were applied and/or code snippets from the implementation. Anything that would help me solve this problem really :)
All of the experiments were structed like this:
@for_range_opt(10000)
def _(i):
result = (sfix(4.0) < sfix(2.0)),
where the sfix(4.0) could have been exchanged with sint(4), < with == or * etc.
Thank you :)
The text was updated successfully, but these errors were encountered: