MP-SPDZ icon indicating copy to clipboard operation
MP-SPDZ copied to clipboard

Online rounds problems of floatingpoint.PreOpL

Open Fannxy opened this issue 2 months ago • 1 comments

Hi keller,

I am testing the following program:

program.use_trunc_pr = True 
program.use_split(3)

sfix.set_precision(48, 96)
x = sfix(0.5)

pre_muls = floatingpoint.PreOpL(lambda a,b,_: a * b, [x] * 6)

And i am expecting about log(6) = 3 rounds of communications using replicated-ring-party.x protocol since one sfixed multiplication introduces 1 round.

However, the execution log shows that a total of 28 online rounds are executed (the logs are in the following),

Truncation error probability 2^-40
Trying to run 144-bit computation
Setup took 0.0501789 seconds.
Compiler: compile.py -R 144 round_test
	80 dabits of replicated Z2^144 left
Detailed costs:
            24 integer multiplication rounds
          1288 integer multiplications
             7 integer openings
Spent 0.00164426 seconds (0.02331 MB, 27 rounds) on the online phase and 0.000577374 seconds (0.0196 MB, 7 rounds) on the preprocessing/offline phase.
Spent 3.8585e-05 seconds on correlated randomness generation.
Communication details:
Passing around 0.023326 MB in 28 rounds, taking 0.00129644 seconds
Receiving directly 0.019584 MB in 3 rounds, taking 0.000177826 seconds
Sending directly 0.019584 MB in 3 rounds, taking 0.000122232 seconds
CPU time = 0.00314868
The following benchmarks are including preprocessing (offline phase).
Time = 0.00292828 seconds 
Data sent = 0.04291 MB in ~34 rounds (party 0 only)
Global data sent = 0.12873 MB (all parties)
Actual preprocessing cost of program:
  Type int
          1008           Bits
Command line: ./replicated-ring-party.x -p 0 round_test -v
Success

I am wondering about the actual online rounds?

My compiling command is :

python compile.py -R 144 round_test.mpc

and the execution command is:

./replicated-ring-party.x -p 0 round_test -v (for three parties).

Is there problems with the log or my command or code?

Thank you so much for all your help!

Fannxy avatar Oct 19 '25 03:10 Fannxy

This is because the 144-bit domain is too small for communication-less truncation. You should be able to achieve a lower number of rounds with -R 192.

mkskeller avatar Oct 29 '25 03:10 mkskeller