FATE icon indicating copy to clipboard operation
FATE copied to clipboard

what does party id means and works?

Open holder-fo opened this issue 3 years ago • 13 comments

hi, i am new to FATE, and got confused in setting party id when test official demo. here are some problems i bumped into:

  1. what is the meaning that same party id in guest, host and arbiter same time?
  2. is it workable when setting multi guests and how it work if so?
  3. is there any chance/tutorial that multi guests and multi hosts work in FATE now or plan in future?

sorry for much bother, hope to reply as soon as possible.

holder-fo avatar Jun 14 '22 03:06 holder-fo

Party ID is an identification of the party. Now FATE support multi hosts, but not support multi-guest.

dylan-fan avatar Jun 14 '22 03:06 dylan-fan

thank you for your prompt reply! could you elaborate a little bit about same party id in guest, host and arbiter same time? why AN id could be a guest, host and arbiter same time? shoud them be total different id, intuitively?

holder-fo avatar Jun 14 '22 07:06 holder-fo

@dylan-fan @holder-fo I got the same confusion, I was planning to setup multiple parties as done in the SecureBoost paper, with one active party among them. But I did got confused about how to do it as the set_roles method only accept a fixed number of parameters.

liyakun avatar Jun 14 '22 08:06 liyakun

@dylan-fan @holder-fo the example given in https://programtalk.com/vs4/python/FederatedAI/FATE/examples/pipeline/homo_nn/_common_component.py/ helped me to understand, maybe it was wrote by FATE team.

liyakun avatar Jun 14 '22 11:06 liyakun

@liyakun thanks for the good example with multi hosts, but still not clarify what does the same id being guest, host and arbiter same time do for? like what is the difference between {"guest": 9999, "hosts": [10000, 10001], "arbiter": 10002} and {"guest": 9999, "hosts": [10000, 9999], "arbiter": 10002}. and how {"guest": 9999, "hosts": 9999, "arbiter": 9999} doing federation with all same id being all identity? is that right an id represents a participator? or i get it wrong that id has other meaning related with participator?

holder-fo avatar Jun 14 '22 12:06 holder-fo

@holder-fo you are welcome. The following is just one example showing my guess, I think they just logically belongs to guest and host group, if you don't have any party id conflict in the same group, then it should be fine. The example that I show here is one part of my experiments to repeat the work in the SecureBoost paper.

NUM_CLIENTS=6
guest_party_id = 9999
host_party_ids = [guest_party_id+idx for idx in range(1, NUM_CLIENTS)]
parties = [('guest', guest_party_id), *[('host', host_party_id) for host_party_id in host_party_ids]]

# define training pipeline
fl_train_pipeline = PipeLine().set_initiator(role='guest', party_id=guest_party_id).set_roles(guest=guest_party_id, host=host_party_ids)

# define data reader
reader_0 = Reader(name="reader_0")
for idx, (role, party_id) in enumerate(parties):
    reader_0.get_party_instance(role=role, party_id=party_id).component_param(
        table={"name": f'training_{idx}', "namespace": 'vertical_training'}
    )

@dylan-fan feel free to correct me if I understood the intention of the design wrongly.

liyakun avatar Jun 14 '22 12:06 liyakun

@liyakun thanks for your kind reply. by saying

" if you don't have any party id conflict in the same group, then it should be fine"

do you mean there shoud not be AN SAME ID in guest party and host party? if so, in the dsl_conf_v2_setting_guide.md 5.3 Multi-host configuration, there has an example like this:

"role": {
   "guest": [
     10000
   ],
   "host": [
     10000, 10001, 10002
   ],
   "arbiter": [
     10000
   ]
}

that is why i got confused? besides, an id being guest/host and arbiter same time, shoud it be knowing more than it shoud be when do federation? hope you can help me a little bit.

holder-fo avatar Jun 15 '22 01:06 holder-fo

@holder-fo welcome. What I meant is that there should not be same id in the same group. In the example that you gave, there are duplicated ids, however, they are within different groups (different roles).

liyakun avatar Jun 15 '22 08:06 liyakun

@liyakun as that you said above, so there could be a same id being different roles. but i got confused how an id being guest and host same time comnunicate with each other when doing federation. in my understanding, guest (one id) should communicate with other roles (other ids) like for gradients, but if there is an id being guest and host same time, would it be that an id communicate with itself? if i got this wrong, how the communication do, specaillay same id being different roles? hope anyone can help me understand this!

holder-fo avatar Jun 16 '22 01:06 holder-fo

@liyakun as that you said above, so there could be a same id being different roles. but i got confused how an id being guest and host same time comnunicate with each other when doing federation. in my understanding, guest (one id) should communicate with other roles (other ids) like for gradients, but if there is an id being guest and host same time, would it be that an id communicate with itself? if i got this wrong, how the communication do, specaillay same id being different roles? hope anyone can help me understand this!

Though i dont really know the implemetation of communication, i can ensure that if a party appears in both guest and host, it plays different roles at the same time indeed. just like what you said communicate with itself

SennriSyunnga avatar Jun 16 '22 02:06 SennriSyunnga

@SennriSyunnga thanks for you explanation, that clarifies a lot for me. if an id can play different roles, there still couple questions trouble me:

  1. would this id learn too much and causes privacy concerns from other ids?
  2. what this id being different roles do when communicating with itself? hope anyone knows the implementation or in the development team may help me out!

holder-fo avatar Jun 16 '22 03:06 holder-fo

@SennriSyunnga thanks for you explanation, that clarifies a lot for me. if an id can play different roles, there still couple questions trouble me:

  1. would this id learn too much and causes privacy concerns from other ids?
  2. what this id being different roles do when communicating with itself? hope anyone knows the implementation or in the development team may help me out!

To the first question, yes, if a party play as an arbiter, and there are only two parties associated with the job, the party who plays as arbiter may get part of secret by combining all infomation that it got. To prevent this situation, many algorithmns do some efforts. So in the most time, this things wouldn't happend. And in the dsl v2, it requires that an arbiter party should not be a guest at the same time in the consideration of privacy security. What's more, when there are more parties involved, arbiter party would lost its 'chance'. Apparently, more infomation leads to higher risk of leakage. It depends mostly on the algorithmn implementation. As far as i know, homo onehot module can't protect your privacy……

SennriSyunnga avatar Jun 17 '22 01:06 SennriSyunnga

@SennriSyunnga thanks for the clarification. now all i wish to know is that: what and how this id do when it being guest and host same time? and in this condition what is the difference between considering privacy protection or not? hope anyone can point it out or guide what i should learn it from!

holder-fo avatar Jun 17 '22 06:06 holder-fo