-
A minimum reproducible codeimport secretflow as sf
import pandas as pd
sf.init(['alice', 'bob'], num_cpus=8, log_to_driver=False)
alice, bob = sf.PYU('alice'), sf.PYU('bob')
alice_val = alice(lambda: 1)()
bob_val = bob(lambda: 2)()
bob_owned_alice_val = alice_val.to(bob)
bob(lambda x, y: x + y)(bob_owned_alice_val, bob_val) # nothing wrong with this line
bob(lambda x, y: x + y)(alice_val, bob_val) # this line causes raising AssertionError, nothing wrong
alice_val.device.party = 'bob'
bob(lambda x, y: x + y)(alice_val, bob_val) # this line causes nothing, but is this same as sf.to ? I know assigning |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hi @Krout0n , it's really a good question.
For the moment, I think the answer is positive, the behavior is the same as But the it is |
Beta Was this translation helpful? Give feedback.
Hi @Krout0n , it's really a good question.
For the moment, I think the answer is positive, the behavior is the same as
alice_val.to
since the underline distributed engine will fetch the content ofalice_val
to bob automatically (lazy and silently).But the it is
not a right to do this
, we should useval.to
to handle this semantic, since the fetching implementation may be changed in the future, but theto
semantic will be stable.