Skip to content
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

Wrong Compare result for FSS #320

Open
yeungbo opened this issue Jan 12, 2022 · 0 comments
Open

Wrong Compare result for FSS #320

yeungbo opened this issue Jan 12, 2022 · 0 comments

Comments

@yeungbo
Copy link

yeungbo commented Jan 12, 2022

Description

When I using a tensor with big number for compare with 0, it return wrong result from FSS protocal.

How to Reproduce

  1. test code:
import torch

from sympc.session import Session
from sympc.session import SessionManager

from sympc.tensor import MPCTensor

sy.load("sympc")
sy.logger.add(sink="./example.log") 
alice = sy.VirtualMachine(name="alice")
bob = sy.VirtualMachine(name="bob")

alice_client = alice.get_client()
bob_client = bob.get_client()
session = Session(parties=[alice_client, bob_client])
SessionManager.setup_mpc(session)

xx = MPCTensor(secret=torch.tensor([ 8.3800e+06, -4.3851e+07,  9.5642e+07, -3.9772e+07,  4.2322e+07,
          3.7577e+07, -1.6031e+07, -1.7107e+07, -4.2336e+07, -2.4824e+07]),session=session)

zz = xx >= 0
zz.reconstruct()




## Expected Behavior
It should return:
tensor([1., 0., 1., 0., 1., 1., 0., 0., 0., 0.])

However, it return the error result:
tensor([1., 0., 1., 1., 0., 1., 1., 0., 1., 1.])

System Information

  • OS: [Ubuntu 18.04.4 LTS]
  • Language Version: [Python 3.7.11]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant