flwr-nightly 1.11.0.dev20240806__py3-none-any.whl → 1.11.0.dev20240808__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of flwr-nightly might be problematic. Click here for more details.

flwr/common/typing.py CHANGED
@@ -199,3 +199,11 @@ class Run:
199
199
  fab_id: str
200
200
  fab_version: str
201
201
  override_config: UserConfig
202
+
203
+
204
+ @dataclass
205
+ class Fab:
206
+ """Fab file representation."""
207
+
208
+ hash_str: str
209
+ content: bytes
flwr/proto/fab_pb2.py CHANGED
@@ -14,7 +14,7 @@ _sym_db = _symbol_database.Default()
14
14
 
15
15
 
16
16
 
17
- DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x14\x66lwr/proto/fab.proto\x12\nflwr.proto\"$\n\x03\x46\x61\x62\x12\x0c\n\x04hash\x18\x01 \x01(\t\x12\x0f\n\x07\x63ontent\x18\x02 \x01(\x0c\"\x1d\n\rGetFabRequest\x12\x0c\n\x04hash\x18\x01 \x01(\t\".\n\x0eGetFabResponse\x12\x1c\n\x03\x66\x61\x62\x18\x01 \x01(\x0b\x32\x0f.flwr.proto.Fabb\x06proto3')
17
+ DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x14\x66lwr/proto/fab.proto\x12\nflwr.proto\"(\n\x03\x46\x61\x62\x12\x10\n\x08hash_str\x18\x01 \x01(\t\x12\x0f\n\x07\x63ontent\x18\x02 \x01(\x0c\"!\n\rGetFabRequest\x12\x10\n\x08hash_str\x18\x01 \x01(\t\".\n\x0eGetFabResponse\x12\x1c\n\x03\x66\x61\x62\x18\x01 \x01(\x0b\x32\x0f.flwr.proto.Fabb\x06proto3')
18
18
 
19
19
  _globals = globals()
20
20
  _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
@@ -22,9 +22,9 @@ _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'flwr.proto.fab_pb2', _globa
22
22
  if _descriptor._USE_C_DESCRIPTORS == False:
23
23
  DESCRIPTOR._options = None
24
24
  _globals['_FAB']._serialized_start=36
25
- _globals['_FAB']._serialized_end=72
26
- _globals['_GETFABREQUEST']._serialized_start=74
27
- _globals['_GETFABREQUEST']._serialized_end=103
28
- _globals['_GETFABRESPONSE']._serialized_start=105
29
- _globals['_GETFABRESPONSE']._serialized_end=151
25
+ _globals['_FAB']._serialized_end=76
26
+ _globals['_GETFABREQUEST']._serialized_start=78
27
+ _globals['_GETFABREQUEST']._serialized_end=111
28
+ _globals['_GETFABRESPONSE']._serialized_start=113
29
+ _globals['_GETFABRESPONSE']._serialized_end=159
30
30
  # @@protoc_insertion_point(module_scope)
flwr/proto/fab_pb2.pyi CHANGED
@@ -12,9 +12,9 @@ DESCRIPTOR: google.protobuf.descriptor.FileDescriptor
12
12
 
13
13
  class Fab(google.protobuf.message.Message):
14
14
  DESCRIPTOR: google.protobuf.descriptor.Descriptor
15
- HASH_FIELD_NUMBER: builtins.int
15
+ HASH_STR_FIELD_NUMBER: builtins.int
16
16
  CONTENT_FIELD_NUMBER: builtins.int
17
- hash: typing.Text
17
+ hash_str: typing.Text
18
18
  """This field is the hash of the data field. It is used to identify the data.
19
19
  The hash is calculated using the SHA-256 algorithm and is represented as a
20
20
  hex string (sha256hex).
@@ -25,21 +25,21 @@ class Fab(google.protobuf.message.Message):
25
25
 
26
26
  def __init__(self,
27
27
  *,
28
- hash: typing.Text = ...,
28
+ hash_str: typing.Text = ...,
29
29
  content: builtins.bytes = ...,
30
30
  ) -> None: ...
31
- def ClearField(self, field_name: typing_extensions.Literal["content",b"content","hash",b"hash"]) -> None: ...
31
+ def ClearField(self, field_name: typing_extensions.Literal["content",b"content","hash_str",b"hash_str"]) -> None: ...
32
32
  global___Fab = Fab
33
33
 
34
34
  class GetFabRequest(google.protobuf.message.Message):
35
35
  DESCRIPTOR: google.protobuf.descriptor.Descriptor
36
- HASH_FIELD_NUMBER: builtins.int
37
- hash: typing.Text
36
+ HASH_STR_FIELD_NUMBER: builtins.int
37
+ hash_str: typing.Text
38
38
  def __init__(self,
39
39
  *,
40
- hash: typing.Text = ...,
40
+ hash_str: typing.Text = ...,
41
41
  ) -> None: ...
42
- def ClearField(self, field_name: typing_extensions.Literal["hash",b"hash"]) -> None: ...
42
+ def ClearField(self, field_name: typing_extensions.Literal["hash_str",b"hash_str"]) -> None: ...
43
43
  global___GetFabRequest = GetFabRequest
44
44
 
45
45
  class GetFabResponse(google.protobuf.message.Message):
@@ -29,7 +29,7 @@ BackendConfig = Dict[str, Dict[str, ConfigsRecordValues]]
29
29
  class Backend(ABC):
30
30
  """Abstract base class for a Simulation Engine Backend."""
31
31
 
32
- def __init__(self, backend_config: BackendConfig, work_dir: str) -> None:
32
+ def __init__(self, backend_config: BackendConfig) -> None:
33
33
  """Construct a backend."""
34
34
 
35
35
  @abstractmethod
@@ -14,9 +14,8 @@
14
14
  # ==============================================================================
15
15
  """Ray backend for the Fleet API using the Simulation Engine."""
16
16
 
17
- import pathlib
18
17
  from logging import DEBUG, ERROR
19
- from typing import Callable, Dict, List, Tuple, Union
18
+ from typing import Callable, Dict, Tuple, Union
20
19
 
21
20
  import ray
22
21
 
@@ -33,7 +32,6 @@ from .backend import Backend, BackendConfig
33
32
 
34
33
  ClientResourcesDict = Dict[str, Union[int, float]]
35
34
  ActorArgsDict = Dict[str, Union[int, float, Callable[[], None]]]
36
- RunTimeEnvDict = Dict[str, Union[str, List[str]]]
37
35
 
38
36
 
39
37
  class RayBackend(Backend):
@@ -42,18 +40,14 @@ class RayBackend(Backend):
42
40
  def __init__(
43
41
  self,
44
42
  backend_config: BackendConfig,
45
- work_dir: str,
46
43
  ) -> None:
47
44
  """Prepare RayBackend by initialising Ray and creating the ActorPool."""
48
45
  log(DEBUG, "Initialising: %s", self.__class__.__name__)
49
46
  log(DEBUG, "Backend config: %s", backend_config)
50
47
 
51
- if not pathlib.Path(work_dir).exists():
52
- raise ValueError(f"Specified work_dir {work_dir} does not exist.")
53
-
54
48
  # Initialise ray
55
49
  self.init_args_key = "init_args"
56
- self.init_ray(backend_config, work_dir)
50
+ self.init_ray(backend_config)
57
51
 
58
52
  # Validate client resources
59
53
  self.client_resources_key = "client_resources"
@@ -68,23 +62,6 @@ class RayBackend(Backend):
68
62
  actor_kwargs=actor_kwargs,
69
63
  )
70
64
 
71
- def _configure_runtime_env(self, work_dir: str) -> RunTimeEnvDict:
72
- """Return list of files/subdirectories to exclude relative to work_dir.
73
-
74
- Without this, Ray will push everything to the Ray Cluster.
75
- """
76
- runtime_env: RunTimeEnvDict = {"working_dir": work_dir}
77
-
78
- excludes = []
79
- path = pathlib.Path(work_dir)
80
- for p in path.rglob("*"):
81
- # Exclude files need to be relative to the working_dir
82
- if p.is_file() and not str(p).endswith(".py"):
83
- excludes.append(str(p.relative_to(path)))
84
- runtime_env["excludes"] = excludes
85
-
86
- return runtime_env
87
-
88
65
  def _validate_client_resources(self, config: BackendConfig) -> ClientResourcesDict:
89
66
  client_resources_config = config.get(self.client_resources_key)
90
67
  client_resources: ClientResourcesDict = {}
@@ -123,26 +100,18 @@ class RayBackend(Backend):
123
100
  actor_args["on_actor_init_fn"] = enable_tf_gpu_growth
124
101
  return actor_args
125
102
 
126
- def init_ray(self, backend_config: BackendConfig, work_dir: str) -> None:
103
+ def init_ray(self, backend_config: BackendConfig) -> None:
127
104
  """Intialises Ray if not already initialised."""
128
105
  if not ray.is_initialized():
129
- # Init ray and append working dir if needed
130
- runtime_env = (
131
- self._configure_runtime_env(work_dir=work_dir) if work_dir else None
132
- )
133
-
134
106
  ray_init_args: Dict[
135
107
  str,
136
- Union[ConfigsRecordValues, RunTimeEnvDict],
108
+ ConfigsRecordValues,
137
109
  ] = {}
138
110
 
139
111
  if backend_config.get(self.init_args_key):
140
112
  for k, v in backend_config[self.init_args_key].items():
141
113
  ray_init_args[k] = v
142
114
 
143
- if runtime_env is not None:
144
- ray_init_args["runtime_env"] = runtime_env
145
-
146
115
  ray.init(**ray_init_args)
147
116
 
148
117
  @property
@@ -339,7 +339,7 @@ def start_vce(
339
339
 
340
340
  def backend_fn() -> Backend:
341
341
  """Instantiate a Backend."""
342
- return backend_type(backend_config, work_dir=app_dir)
342
+ return backend_type(backend_config)
343
343
 
344
344
  # Load ClientApp if needed
345
345
  def _load() -> ClientApp:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: flwr-nightly
3
- Version: 1.11.0.dev20240806
3
+ Version: 1.11.0.dev20240808
4
4
  Summary: Flower: A Friendly Federated Learning Framework
5
5
  Home-page: https://flower.ai
6
6
  License: Apache-2.0
@@ -120,7 +120,7 @@ flwr/common/secure_aggregation/secaggplus_constants.py,sha256=9MF-oQh62uD7rt9VeN
120
120
  flwr/common/secure_aggregation/secaggplus_utils.py,sha256=3VssKgYF7HQIkSpROnEUoYWVt47p12PE_Rj4nYqqg04,3221
121
121
  flwr/common/serde.py,sha256=0lXwbnILK16r1uFeV62pKJGxN78pArfOxo1AxAtGs6Q,23679
122
122
  flwr/common/telemetry.py,sha256=nSjJHDitPhzB2qUl6LeSMT9Zld5lIk9uW98RpxQwiZw,8366
123
- flwr/common/typing.py,sha256=tnpUbcAVFA-ic3yjoxwlQ-jjLPVUYN0B4ftUQzBVUY0,4633
123
+ flwr/common/typing.py,sha256=ISp8UF94dtqml7ElaR6NeGCqcZX3xeab7KWMdjQEqcU,4730
124
124
  flwr/common/version.py,sha256=W1ntylR04xkCP6zeSet6sRtBn7P1cje2lOqBJgYBjJY,1349
125
125
  flwr/proto/__init__.py,sha256=hbY7JYakwZwCkYgCNlmHdc8rtvfoJbAZLalMdc--CGc,683
126
126
  flwr/proto/common_pb2.py,sha256=uzSmq0FJdC-MriN9UGPFs7QVIFTKJmX5lyLnzcyZ5WE,2405
@@ -139,8 +139,8 @@ flwr/proto/exec_pb2.py,sha256=7b1JUZgt04lBxdXpnd3WOOwmY2egUausm4G1wbmXFPs,3120
139
139
  flwr/proto/exec_pb2.pyi,sha256=R9xCAUxkLvuXcvQfhNGZ5Qy8qiUCdjN-gp3Iy5BmkNo,4110
140
140
  flwr/proto/exec_pb2_grpc.py,sha256=faAN19XEMP8GTKrcIU6jvlWkN44n2KiUsZh_OG0sYcg,4072
141
141
  flwr/proto/exec_pb2_grpc.pyi,sha256=VrFhT1Um3Nb8UC2YqnR9GIiM-Yyx0FqaxVOWljh-G_w,1208
142
- flwr/proto/fab_pb2.py,sha256=k1L3z4L3pJGRIUmgt609xUe-UAtSKFwT0C7wXnb12IY,1427
143
- flwr/proto/fab_pb2.pyi,sha256=G2eHjgIAeVAf4TchXg3XPdeUk-h5-OMJnAv7CLyxdGs,1930
142
+ flwr/proto/fab_pb2.py,sha256=ztC3HnD5e-bYpp7lxrlxkdc30haAlBHswTnt4X5G1eg,1432
143
+ flwr/proto/fab_pb2.pyi,sha256=wQXdQkcij6CrkmclIT5tU9SkOSZHTqm3PxWJWu4-CPI,1970
144
144
  flwr/proto/fab_pb2_grpc.py,sha256=1oboBPFxaTEXt9Aw7EAj8gXHDCNMhZD2VXqocC9l_gk,159
145
145
  flwr/proto/fab_pb2_grpc.pyi,sha256=ff2TSiLVnG6IVQcTGzb2DIH3XRSoAvAo_RMcvbMFyc0,76
146
146
  flwr/proto/fleet_pb2.py,sha256=euBC2M_LfQSwiSK9kFi18OvoV1gnQT4cC9lAMCCiOGY,4729
@@ -237,9 +237,9 @@ flwr/server/superlink/fleet/rest_rere/__init__.py,sha256=5jbYbAn75sGv-gBwOPDySE0
237
237
  flwr/server/superlink/fleet/rest_rere/rest_api.py,sha256=yoSU-6nCJF9ASHGNpSY69nZbUhPGXkMIKYDgybKQX3c,7672
238
238
  flwr/server/superlink/fleet/vce/__init__.py,sha256=36MHKiefnJeyjwMQzVUK4m06Ojon3WDcwZGQsAcyVhQ,783
239
239
  flwr/server/superlink/fleet/vce/backend/__init__.py,sha256=psQjI1DQHOM5uWVXM27l_wPHjfEkMUTP-_8-lEFH1JA,1466
240
- flwr/server/superlink/fleet/vce/backend/backend.py,sha256=iG3KSIY7DzNfcxmuLfTs7VdQJnqPCvvn5DFkTWKG5lI,2227
241
- flwr/server/superlink/fleet/vce/backend/raybackend.py,sha256=SnjZ1WOcrfMZNgiDdTHcFeXJqrY7UHx8kvO62mqU9S4,7489
242
- flwr/server/superlink/fleet/vce/vce_api.py,sha256=jTAUX472qRIZefSL64rwLkhRe01PX_YwhFpWoLwk6Tc,12770
240
+ flwr/server/superlink/fleet/vce/backend/backend.py,sha256=KL0eHScWr_YfP2eY3VP8_OOMgZwnRNW7qpu5J-ISpXI,2212
241
+ flwr/server/superlink/fleet/vce/backend/raybackend.py,sha256=6-CjUTv1cFnAb53cZzEYCuVLrVu60tPczTo8meqeqbk,6289
242
+ flwr/server/superlink/fleet/vce/vce_api.py,sha256=4vBqC0nCMWwxU1TMiWzA8Q-hwQkVAPGsuhbjhAr1D68,12752
243
243
  flwr/server/superlink/state/__init__.py,sha256=Gj2OTFLXvA-mAjBvwuKDM3rDrVaQPcIoybSa2uskMTE,1003
244
244
  flwr/server/superlink/state/in_memory_state.py,sha256=LnKlnXe9JjVHb5_XOo6eD1RQhlCvJVKgz_CkXrMz8DY,13069
245
245
  flwr/server/superlink/state/sqlite_state.py,sha256=LdLnHtF8C-1L1IAglfZPqIuKa782Qo7qAYzTXMdMYGM,29052
@@ -270,8 +270,8 @@ flwr/superexec/exec_grpc.py,sha256=PhqGoZEpTMxSQmUSV8Wgtzb1Za_pHJ-adZqo5RYnDyE,1
270
270
  flwr/superexec/exec_servicer.py,sha256=fxQAKfgmQRSnYq5anjryfGeRbsZrNFEkuiNcTZhRwiE,2320
271
271
  flwr/superexec/executor.py,sha256=k_adivto6R2U82DADOHNvdtobehBYreRek1gOEBIQnQ,2318
272
272
  flwr/superexec/simulation.py,sha256=lfdClQYSAIMHe43aJ0Pk-kBw_xoV09LsIMfHo2eo-Ck,6775
273
- flwr_nightly-1.11.0.dev20240806.dist-info/LICENSE,sha256=z8d0m5b2O9McPEK1xHG_dWgUBT6EfBDz6wA0F7xSPTA,11358
274
- flwr_nightly-1.11.0.dev20240806.dist-info/METADATA,sha256=qS7p71EK_N9Uvxpp5E3CQzsmSywUzXBjyCeaC-VKKpQ,15672
275
- flwr_nightly-1.11.0.dev20240806.dist-info/WHEEL,sha256=FMvqSimYX_P7y0a7UY-_Mc83r5zkBZsCYPm7Lr0Bsq4,88
276
- flwr_nightly-1.11.0.dev20240806.dist-info/entry_points.txt,sha256=7qBQcA-bDGDxnJmLd9FYqglFQubjCNqyg9M8a-lukps,336
277
- flwr_nightly-1.11.0.dev20240806.dist-info/RECORD,,
273
+ flwr_nightly-1.11.0.dev20240808.dist-info/LICENSE,sha256=z8d0m5b2O9McPEK1xHG_dWgUBT6EfBDz6wA0F7xSPTA,11358
274
+ flwr_nightly-1.11.0.dev20240808.dist-info/METADATA,sha256=zEgan9rkbxuqkDqsv1v-MUhLc8m3e9JwpWPYnmYhxeY,15672
275
+ flwr_nightly-1.11.0.dev20240808.dist-info/WHEEL,sha256=FMvqSimYX_P7y0a7UY-_Mc83r5zkBZsCYPm7Lr0Bsq4,88
276
+ flwr_nightly-1.11.0.dev20240808.dist-info/entry_points.txt,sha256=7qBQcA-bDGDxnJmLd9FYqglFQubjCNqyg9M8a-lukps,336
277
+ flwr_nightly-1.11.0.dev20240808.dist-info/RECORD,,