tf-encrypted / moose

Secure distributed dataflow framework for encrypted machine learning and data processing
Apache License 2.0
57 stars 15 forks source link

PyMoose: cleanup `LocalMooseRuntime` API #1093

Closed mortendahl closed 2 years ago

mortendahl commented 2 years ago

Through-out PyMoose, support and rewrite this:

storage_rep = {
  "alice": {},
  "carole": {},
  "bob": {"x_arg": x_arg},
}

runtime_rep = LocalMooseRuntime(storage_mapping=storage_rep)
_ = runtime_rep.evaluate_computation(
  computation=comp_rep,
  role_assignment={"alice": "alice", "bob": "bob", "carole": "carole"},
  arguments={"x_uri": "x_arg"},
)

to this:

# only partially specified
storage_rep = {
  "bob": {"x_arg": x_arg},
}

runtime_rep = LocalMooseRuntime(storage_mapping=storage_rep)
_ = runtime_rep.evaluate_computation(
  computation=comp_rep,
  role_assignment={"alice": "alice", "bob": "bob", "carole": "carole"},
  arguments={"x_uri": "x_arg"},
)

and potentially allow a partial role assignment as well, eg empty in the example above.

jvmncs commented 2 years ago

once we've moved role_assignment to the constructor (#1094), this will be much easier :+1: