flwr-nightly 1.8.0.dev20240305__tar.gz → 1.8.0.dev20240306__tar.gz

Sign up to get free protection for your applications and to get access to all the features.
Files changed (197) hide show
  1. {flwr_nightly-1.8.0.dev20240305 → flwr_nightly-1.8.0.dev20240306}/PKG-INFO +4 -3
  2. {flwr_nightly-1.8.0.dev20240305 → flwr_nightly-1.8.0.dev20240306}/README.md +2 -2
  3. {flwr_nightly-1.8.0.dev20240305 → flwr_nightly-1.8.0.dev20240306}/pyproject.toml +3 -2
  4. {flwr_nightly-1.8.0.dev20240305 → flwr_nightly-1.8.0.dev20240306}/src/py/flwr/cli/app.py +2 -0
  5. flwr_nightly-1.8.0.dev20240306/src/py/flwr/cli/flower_toml.py +151 -0
  6. flwr_nightly-1.8.0.dev20240306/src/py/flwr/cli/run/__init__.py +21 -0
  7. flwr_nightly-1.8.0.dev20240306/src/py/flwr/cli/run/run.py +102 -0
  8. {flwr_nightly-1.8.0.dev20240305 → flwr_nightly-1.8.0.dev20240306}/src/py/flwr/client/grpc_client/connection.py +9 -14
  9. {flwr_nightly-1.8.0.dev20240305 → flwr_nightly-1.8.0.dev20240306}/src/py/flwr/client/message_handler/message_handler.py +5 -10
  10. {flwr_nightly-1.8.0.dev20240305 → flwr_nightly-1.8.0.dev20240306}/src/py/flwr/client/mod/centraldp_mods.py +5 -5
  11. {flwr_nightly-1.8.0.dev20240305 → flwr_nightly-1.8.0.dev20240306}/src/py/flwr/client/mod/secure_aggregation/secaggplus_mod.py +2 -2
  12. {flwr_nightly-1.8.0.dev20240305 → flwr_nightly-1.8.0.dev20240306}/src/py/flwr/common/__init__.py +2 -0
  13. {flwr_nightly-1.8.0.dev20240305 → flwr_nightly-1.8.0.dev20240306}/src/py/flwr/common/constant.py +11 -5
  14. {flwr_nightly-1.8.0.dev20240305 → flwr_nightly-1.8.0.dev20240306}/src/py/flwr/server/compat/driver_client_proxy.py +5 -11
  15. {flwr_nightly-1.8.0.dev20240305 → flwr_nightly-1.8.0.dev20240306}/src/py/flwr/server/workflow/default_workflows.py +4 -8
  16. {flwr_nightly-1.8.0.dev20240305 → flwr_nightly-1.8.0.dev20240306}/src/py/flwr/simulation/ray_transport/ray_client_proxy.py +5 -10
  17. {flwr_nightly-1.8.0.dev20240305 → flwr_nightly-1.8.0.dev20240306}/LICENSE +0 -0
  18. {flwr_nightly-1.8.0.dev20240305 → flwr_nightly-1.8.0.dev20240306}/src/py/flwr/__init__.py +0 -0
  19. {flwr_nightly-1.8.0.dev20240305 → flwr_nightly-1.8.0.dev20240306}/src/py/flwr/cli/__init__.py +0 -0
  20. {flwr_nightly-1.8.0.dev20240305 → flwr_nightly-1.8.0.dev20240306}/src/py/flwr/cli/example.py +0 -0
  21. {flwr_nightly-1.8.0.dev20240305 → flwr_nightly-1.8.0.dev20240306}/src/py/flwr/cli/new/__init__.py +0 -0
  22. {flwr_nightly-1.8.0.dev20240305 → flwr_nightly-1.8.0.dev20240306}/src/py/flwr/cli/new/new.py +0 -0
  23. {flwr_nightly-1.8.0.dev20240305 → flwr_nightly-1.8.0.dev20240306}/src/py/flwr/cli/new/templates/__init__.py +0 -0
  24. {flwr_nightly-1.8.0.dev20240305 → flwr_nightly-1.8.0.dev20240306}/src/py/flwr/cli/new/templates/app/README.md.tpl +0 -0
  25. {flwr_nightly-1.8.0.dev20240305 → flwr_nightly-1.8.0.dev20240306}/src/py/flwr/cli/new/templates/app/__init__.py +0 -0
  26. {flwr_nightly-1.8.0.dev20240305 → flwr_nightly-1.8.0.dev20240306}/src/py/flwr/cli/new/templates/app/code/__init__.py +0 -0
  27. {flwr_nightly-1.8.0.dev20240305 → flwr_nightly-1.8.0.dev20240306}/src/py/flwr/cli/new/templates/app/code/__init__.py.tpl +0 -0
  28. {flwr_nightly-1.8.0.dev20240305 → flwr_nightly-1.8.0.dev20240306}/src/py/flwr/cli/new/templates/app/code/client.numpy.py.tpl +0 -0
  29. {flwr_nightly-1.8.0.dev20240305 → flwr_nightly-1.8.0.dev20240306}/src/py/flwr/cli/new/templates/app/code/client.pytorch.py.tpl +0 -0
  30. {flwr_nightly-1.8.0.dev20240305 → flwr_nightly-1.8.0.dev20240306}/src/py/flwr/cli/new/templates/app/code/client.tensorflow.py.tpl +0 -0
  31. {flwr_nightly-1.8.0.dev20240305 → flwr_nightly-1.8.0.dev20240306}/src/py/flwr/cli/new/templates/app/code/server.numpy.py.tpl +0 -0
  32. {flwr_nightly-1.8.0.dev20240305 → flwr_nightly-1.8.0.dev20240306}/src/py/flwr/cli/new/templates/app/code/server.pytorch.py.tpl +0 -0
  33. {flwr_nightly-1.8.0.dev20240305 → flwr_nightly-1.8.0.dev20240306}/src/py/flwr/cli/new/templates/app/code/server.tensorflow.py.tpl +0 -0
  34. {flwr_nightly-1.8.0.dev20240305 → flwr_nightly-1.8.0.dev20240306}/src/py/flwr/cli/new/templates/app/flower.toml.tpl +0 -0
  35. {flwr_nightly-1.8.0.dev20240305 → flwr_nightly-1.8.0.dev20240306}/src/py/flwr/cli/new/templates/app/requirements.numpy.txt.tpl +0 -0
  36. {flwr_nightly-1.8.0.dev20240305 → flwr_nightly-1.8.0.dev20240306}/src/py/flwr/cli/new/templates/app/requirements.pytorch.txt.tpl +0 -0
  37. {flwr_nightly-1.8.0.dev20240305 → flwr_nightly-1.8.0.dev20240306}/src/py/flwr/cli/new/templates/app/requirements.tensorflow.txt.tpl +0 -0
  38. {flwr_nightly-1.8.0.dev20240305 → flwr_nightly-1.8.0.dev20240306}/src/py/flwr/cli/utils.py +0 -0
  39. {flwr_nightly-1.8.0.dev20240305 → flwr_nightly-1.8.0.dev20240306}/src/py/flwr/client/__init__.py +0 -0
  40. {flwr_nightly-1.8.0.dev20240305 → flwr_nightly-1.8.0.dev20240306}/src/py/flwr/client/app.py +0 -0
  41. {flwr_nightly-1.8.0.dev20240305 → flwr_nightly-1.8.0.dev20240306}/src/py/flwr/client/client.py +0 -0
  42. {flwr_nightly-1.8.0.dev20240305 → flwr_nightly-1.8.0.dev20240306}/src/py/flwr/client/client_app.py +0 -0
  43. {flwr_nightly-1.8.0.dev20240305 → flwr_nightly-1.8.0.dev20240306}/src/py/flwr/client/dpfedavg_numpy_client.py +0 -0
  44. {flwr_nightly-1.8.0.dev20240305 → flwr_nightly-1.8.0.dev20240306}/src/py/flwr/client/grpc_client/__init__.py +0 -0
  45. {flwr_nightly-1.8.0.dev20240305 → flwr_nightly-1.8.0.dev20240306}/src/py/flwr/client/grpc_rere_client/__init__.py +0 -0
  46. {flwr_nightly-1.8.0.dev20240305 → flwr_nightly-1.8.0.dev20240306}/src/py/flwr/client/grpc_rere_client/connection.py +0 -0
  47. {flwr_nightly-1.8.0.dev20240305 → flwr_nightly-1.8.0.dev20240306}/src/py/flwr/client/message_handler/__init__.py +0 -0
  48. {flwr_nightly-1.8.0.dev20240305 → flwr_nightly-1.8.0.dev20240306}/src/py/flwr/client/message_handler/task_handler.py +0 -0
  49. {flwr_nightly-1.8.0.dev20240305 → flwr_nightly-1.8.0.dev20240306}/src/py/flwr/client/mod/__init__.py +0 -0
  50. {flwr_nightly-1.8.0.dev20240305 → flwr_nightly-1.8.0.dev20240306}/src/py/flwr/client/mod/secure_aggregation/__init__.py +0 -0
  51. {flwr_nightly-1.8.0.dev20240305 → flwr_nightly-1.8.0.dev20240306}/src/py/flwr/client/mod/utils.py +0 -0
  52. {flwr_nightly-1.8.0.dev20240305 → flwr_nightly-1.8.0.dev20240306}/src/py/flwr/client/node_state.py +0 -0
  53. {flwr_nightly-1.8.0.dev20240305 → flwr_nightly-1.8.0.dev20240306}/src/py/flwr/client/node_state_tests.py +0 -0
  54. {flwr_nightly-1.8.0.dev20240305 → flwr_nightly-1.8.0.dev20240306}/src/py/flwr/client/numpy_client.py +0 -0
  55. {flwr_nightly-1.8.0.dev20240305 → flwr_nightly-1.8.0.dev20240306}/src/py/flwr/client/rest_client/__init__.py +0 -0
  56. {flwr_nightly-1.8.0.dev20240305 → flwr_nightly-1.8.0.dev20240306}/src/py/flwr/client/rest_client/connection.py +0 -0
  57. {flwr_nightly-1.8.0.dev20240305 → flwr_nightly-1.8.0.dev20240306}/src/py/flwr/client/typing.py +0 -0
  58. {flwr_nightly-1.8.0.dev20240305 → flwr_nightly-1.8.0.dev20240306}/src/py/flwr/common/address.py +0 -0
  59. {flwr_nightly-1.8.0.dev20240305 → flwr_nightly-1.8.0.dev20240306}/src/py/flwr/common/context.py +0 -0
  60. {flwr_nightly-1.8.0.dev20240305 → flwr_nightly-1.8.0.dev20240306}/src/py/flwr/common/date.py +0 -0
  61. {flwr_nightly-1.8.0.dev20240305 → flwr_nightly-1.8.0.dev20240306}/src/py/flwr/common/differential_privacy.py +0 -0
  62. {flwr_nightly-1.8.0.dev20240305 → flwr_nightly-1.8.0.dev20240306}/src/py/flwr/common/differential_privacy_constants.py +0 -0
  63. {flwr_nightly-1.8.0.dev20240305 → flwr_nightly-1.8.0.dev20240306}/src/py/flwr/common/dp.py +0 -0
  64. {flwr_nightly-1.8.0.dev20240305 → flwr_nightly-1.8.0.dev20240306}/src/py/flwr/common/exit_handlers.py +0 -0
  65. {flwr_nightly-1.8.0.dev20240305 → flwr_nightly-1.8.0.dev20240306}/src/py/flwr/common/grpc.py +0 -0
  66. {flwr_nightly-1.8.0.dev20240305 → flwr_nightly-1.8.0.dev20240306}/src/py/flwr/common/logger.py +0 -0
  67. {flwr_nightly-1.8.0.dev20240305 → flwr_nightly-1.8.0.dev20240306}/src/py/flwr/common/message.py +0 -0
  68. {flwr_nightly-1.8.0.dev20240305 → flwr_nightly-1.8.0.dev20240306}/src/py/flwr/common/parameter.py +0 -0
  69. {flwr_nightly-1.8.0.dev20240305 → flwr_nightly-1.8.0.dev20240306}/src/py/flwr/common/record/__init__.py +0 -0
  70. {flwr_nightly-1.8.0.dev20240305 → flwr_nightly-1.8.0.dev20240306}/src/py/flwr/common/record/configsrecord.py +0 -0
  71. {flwr_nightly-1.8.0.dev20240305 → flwr_nightly-1.8.0.dev20240306}/src/py/flwr/common/record/conversion_utils.py +0 -0
  72. {flwr_nightly-1.8.0.dev20240305 → flwr_nightly-1.8.0.dev20240306}/src/py/flwr/common/record/metricsrecord.py +0 -0
  73. {flwr_nightly-1.8.0.dev20240305 → flwr_nightly-1.8.0.dev20240306}/src/py/flwr/common/record/parametersrecord.py +0 -0
  74. {flwr_nightly-1.8.0.dev20240305 → flwr_nightly-1.8.0.dev20240306}/src/py/flwr/common/record/recordset.py +0 -0
  75. {flwr_nightly-1.8.0.dev20240305 → flwr_nightly-1.8.0.dev20240306}/src/py/flwr/common/record/typeddict.py +0 -0
  76. {flwr_nightly-1.8.0.dev20240305 → flwr_nightly-1.8.0.dev20240306}/src/py/flwr/common/recordset_compat.py +0 -0
  77. {flwr_nightly-1.8.0.dev20240305 → flwr_nightly-1.8.0.dev20240306}/src/py/flwr/common/retry_invoker.py +0 -0
  78. {flwr_nightly-1.8.0.dev20240305 → flwr_nightly-1.8.0.dev20240306}/src/py/flwr/common/secure_aggregation/__init__.py +0 -0
  79. {flwr_nightly-1.8.0.dev20240305 → flwr_nightly-1.8.0.dev20240306}/src/py/flwr/common/secure_aggregation/crypto/__init__.py +0 -0
  80. {flwr_nightly-1.8.0.dev20240305 → flwr_nightly-1.8.0.dev20240306}/src/py/flwr/common/secure_aggregation/crypto/shamir.py +0 -0
  81. {flwr_nightly-1.8.0.dev20240305 → flwr_nightly-1.8.0.dev20240306}/src/py/flwr/common/secure_aggregation/crypto/symmetric_encryption.py +0 -0
  82. {flwr_nightly-1.8.0.dev20240305 → flwr_nightly-1.8.0.dev20240306}/src/py/flwr/common/secure_aggregation/ndarrays_arithmetic.py +0 -0
  83. {flwr_nightly-1.8.0.dev20240305 → flwr_nightly-1.8.0.dev20240306}/src/py/flwr/common/secure_aggregation/quantization.py +0 -0
  84. {flwr_nightly-1.8.0.dev20240305 → flwr_nightly-1.8.0.dev20240306}/src/py/flwr/common/secure_aggregation/secaggplus_constants.py +0 -0
  85. {flwr_nightly-1.8.0.dev20240305 → flwr_nightly-1.8.0.dev20240306}/src/py/flwr/common/secure_aggregation/secaggplus_utils.py +0 -0
  86. {flwr_nightly-1.8.0.dev20240305 → flwr_nightly-1.8.0.dev20240306}/src/py/flwr/common/serde.py +0 -0
  87. {flwr_nightly-1.8.0.dev20240305 → flwr_nightly-1.8.0.dev20240306}/src/py/flwr/common/telemetry.py +0 -0
  88. {flwr_nightly-1.8.0.dev20240305 → flwr_nightly-1.8.0.dev20240306}/src/py/flwr/common/typing.py +0 -0
  89. {flwr_nightly-1.8.0.dev20240305 → flwr_nightly-1.8.0.dev20240306}/src/py/flwr/common/version.py +0 -0
  90. {flwr_nightly-1.8.0.dev20240305 → flwr_nightly-1.8.0.dev20240306}/src/py/flwr/proto/__init__.py +0 -0
  91. {flwr_nightly-1.8.0.dev20240305 → flwr_nightly-1.8.0.dev20240306}/src/py/flwr/proto/driver_pb2.py +0 -0
  92. {flwr_nightly-1.8.0.dev20240305 → flwr_nightly-1.8.0.dev20240306}/src/py/flwr/proto/driver_pb2.pyi +0 -0
  93. {flwr_nightly-1.8.0.dev20240305 → flwr_nightly-1.8.0.dev20240306}/src/py/flwr/proto/driver_pb2_grpc.py +0 -0
  94. {flwr_nightly-1.8.0.dev20240305 → flwr_nightly-1.8.0.dev20240306}/src/py/flwr/proto/driver_pb2_grpc.pyi +0 -0
  95. {flwr_nightly-1.8.0.dev20240305 → flwr_nightly-1.8.0.dev20240306}/src/py/flwr/proto/error_pb2.py +0 -0
  96. {flwr_nightly-1.8.0.dev20240305 → flwr_nightly-1.8.0.dev20240306}/src/py/flwr/proto/error_pb2.pyi +0 -0
  97. {flwr_nightly-1.8.0.dev20240305 → flwr_nightly-1.8.0.dev20240306}/src/py/flwr/proto/error_pb2_grpc.py +0 -0
  98. {flwr_nightly-1.8.0.dev20240305 → flwr_nightly-1.8.0.dev20240306}/src/py/flwr/proto/error_pb2_grpc.pyi +0 -0
  99. {flwr_nightly-1.8.0.dev20240305 → flwr_nightly-1.8.0.dev20240306}/src/py/flwr/proto/fleet_pb2.py +0 -0
  100. {flwr_nightly-1.8.0.dev20240305 → flwr_nightly-1.8.0.dev20240306}/src/py/flwr/proto/fleet_pb2.pyi +0 -0
  101. {flwr_nightly-1.8.0.dev20240305 → flwr_nightly-1.8.0.dev20240306}/src/py/flwr/proto/fleet_pb2_grpc.py +0 -0
  102. {flwr_nightly-1.8.0.dev20240305 → flwr_nightly-1.8.0.dev20240306}/src/py/flwr/proto/fleet_pb2_grpc.pyi +0 -0
  103. {flwr_nightly-1.8.0.dev20240305 → flwr_nightly-1.8.0.dev20240306}/src/py/flwr/proto/node_pb2.py +0 -0
  104. {flwr_nightly-1.8.0.dev20240305 → flwr_nightly-1.8.0.dev20240306}/src/py/flwr/proto/node_pb2.pyi +0 -0
  105. {flwr_nightly-1.8.0.dev20240305 → flwr_nightly-1.8.0.dev20240306}/src/py/flwr/proto/node_pb2_grpc.py +0 -0
  106. {flwr_nightly-1.8.0.dev20240305 → flwr_nightly-1.8.0.dev20240306}/src/py/flwr/proto/node_pb2_grpc.pyi +0 -0
  107. {flwr_nightly-1.8.0.dev20240305 → flwr_nightly-1.8.0.dev20240306}/src/py/flwr/proto/recordset_pb2.py +0 -0
  108. {flwr_nightly-1.8.0.dev20240305 → flwr_nightly-1.8.0.dev20240306}/src/py/flwr/proto/recordset_pb2.pyi +0 -0
  109. {flwr_nightly-1.8.0.dev20240305 → flwr_nightly-1.8.0.dev20240306}/src/py/flwr/proto/recordset_pb2_grpc.py +0 -0
  110. {flwr_nightly-1.8.0.dev20240305 → flwr_nightly-1.8.0.dev20240306}/src/py/flwr/proto/recordset_pb2_grpc.pyi +0 -0
  111. {flwr_nightly-1.8.0.dev20240305 → flwr_nightly-1.8.0.dev20240306}/src/py/flwr/proto/task_pb2.py +0 -0
  112. {flwr_nightly-1.8.0.dev20240305 → flwr_nightly-1.8.0.dev20240306}/src/py/flwr/proto/task_pb2.pyi +0 -0
  113. {flwr_nightly-1.8.0.dev20240305 → flwr_nightly-1.8.0.dev20240306}/src/py/flwr/proto/task_pb2_grpc.py +0 -0
  114. {flwr_nightly-1.8.0.dev20240305 → flwr_nightly-1.8.0.dev20240306}/src/py/flwr/proto/task_pb2_grpc.pyi +0 -0
  115. {flwr_nightly-1.8.0.dev20240305 → flwr_nightly-1.8.0.dev20240306}/src/py/flwr/proto/transport_pb2.py +0 -0
  116. {flwr_nightly-1.8.0.dev20240305 → flwr_nightly-1.8.0.dev20240306}/src/py/flwr/proto/transport_pb2.pyi +0 -0
  117. {flwr_nightly-1.8.0.dev20240305 → flwr_nightly-1.8.0.dev20240306}/src/py/flwr/proto/transport_pb2_grpc.py +0 -0
  118. {flwr_nightly-1.8.0.dev20240305 → flwr_nightly-1.8.0.dev20240306}/src/py/flwr/proto/transport_pb2_grpc.pyi +0 -0
  119. {flwr_nightly-1.8.0.dev20240305 → flwr_nightly-1.8.0.dev20240306}/src/py/flwr/py.typed +0 -0
  120. {flwr_nightly-1.8.0.dev20240305 → flwr_nightly-1.8.0.dev20240306}/src/py/flwr/server/__init__.py +0 -0
  121. {flwr_nightly-1.8.0.dev20240305 → flwr_nightly-1.8.0.dev20240306}/src/py/flwr/server/app.py +0 -0
  122. {flwr_nightly-1.8.0.dev20240305 → flwr_nightly-1.8.0.dev20240306}/src/py/flwr/server/client_manager.py +0 -0
  123. {flwr_nightly-1.8.0.dev20240305 → flwr_nightly-1.8.0.dev20240306}/src/py/flwr/server/client_proxy.py +0 -0
  124. {flwr_nightly-1.8.0.dev20240305 → flwr_nightly-1.8.0.dev20240306}/src/py/flwr/server/compat/__init__.py +0 -0
  125. {flwr_nightly-1.8.0.dev20240305 → flwr_nightly-1.8.0.dev20240306}/src/py/flwr/server/compat/app.py +0 -0
  126. {flwr_nightly-1.8.0.dev20240305 → flwr_nightly-1.8.0.dev20240306}/src/py/flwr/server/compat/app_utils.py +0 -0
  127. {flwr_nightly-1.8.0.dev20240305 → flwr_nightly-1.8.0.dev20240306}/src/py/flwr/server/compat/legacy_context.py +0 -0
  128. {flwr_nightly-1.8.0.dev20240305 → flwr_nightly-1.8.0.dev20240306}/src/py/flwr/server/criterion.py +0 -0
  129. {flwr_nightly-1.8.0.dev20240305 → flwr_nightly-1.8.0.dev20240306}/src/py/flwr/server/driver/__init__.py +0 -0
  130. {flwr_nightly-1.8.0.dev20240305 → flwr_nightly-1.8.0.dev20240306}/src/py/flwr/server/driver/driver.py +0 -0
  131. {flwr_nightly-1.8.0.dev20240305 → flwr_nightly-1.8.0.dev20240306}/src/py/flwr/server/driver/grpc_driver.py +0 -0
  132. {flwr_nightly-1.8.0.dev20240305 → flwr_nightly-1.8.0.dev20240306}/src/py/flwr/server/history.py +0 -0
  133. {flwr_nightly-1.8.0.dev20240305 → flwr_nightly-1.8.0.dev20240306}/src/py/flwr/server/run_serverapp.py +0 -0
  134. {flwr_nightly-1.8.0.dev20240305 → flwr_nightly-1.8.0.dev20240306}/src/py/flwr/server/server.py +0 -0
  135. {flwr_nightly-1.8.0.dev20240305 → flwr_nightly-1.8.0.dev20240306}/src/py/flwr/server/server_app.py +0 -0
  136. {flwr_nightly-1.8.0.dev20240305 → flwr_nightly-1.8.0.dev20240306}/src/py/flwr/server/server_config.py +0 -0
  137. {flwr_nightly-1.8.0.dev20240305 → flwr_nightly-1.8.0.dev20240306}/src/py/flwr/server/strategy/__init__.py +0 -0
  138. {flwr_nightly-1.8.0.dev20240305 → flwr_nightly-1.8.0.dev20240306}/src/py/flwr/server/strategy/aggregate.py +0 -0
  139. {flwr_nightly-1.8.0.dev20240305 → flwr_nightly-1.8.0.dev20240306}/src/py/flwr/server/strategy/bulyan.py +0 -0
  140. {flwr_nightly-1.8.0.dev20240305 → flwr_nightly-1.8.0.dev20240306}/src/py/flwr/server/strategy/dp_adaptive_clipping.py +0 -0
  141. {flwr_nightly-1.8.0.dev20240305 → flwr_nightly-1.8.0.dev20240306}/src/py/flwr/server/strategy/dp_fixed_clipping.py +0 -0
  142. {flwr_nightly-1.8.0.dev20240305 → flwr_nightly-1.8.0.dev20240306}/src/py/flwr/server/strategy/dpfedavg_adaptive.py +0 -0
  143. {flwr_nightly-1.8.0.dev20240305 → flwr_nightly-1.8.0.dev20240306}/src/py/flwr/server/strategy/dpfedavg_fixed.py +0 -0
  144. {flwr_nightly-1.8.0.dev20240305 → flwr_nightly-1.8.0.dev20240306}/src/py/flwr/server/strategy/fault_tolerant_fedavg.py +0 -0
  145. {flwr_nightly-1.8.0.dev20240305 → flwr_nightly-1.8.0.dev20240306}/src/py/flwr/server/strategy/fedadagrad.py +0 -0
  146. {flwr_nightly-1.8.0.dev20240305 → flwr_nightly-1.8.0.dev20240306}/src/py/flwr/server/strategy/fedadam.py +0 -0
  147. {flwr_nightly-1.8.0.dev20240305 → flwr_nightly-1.8.0.dev20240306}/src/py/flwr/server/strategy/fedavg.py +0 -0
  148. {flwr_nightly-1.8.0.dev20240305 → flwr_nightly-1.8.0.dev20240306}/src/py/flwr/server/strategy/fedavg_android.py +0 -0
  149. {flwr_nightly-1.8.0.dev20240305 → flwr_nightly-1.8.0.dev20240306}/src/py/flwr/server/strategy/fedavgm.py +0 -0
  150. {flwr_nightly-1.8.0.dev20240305 → flwr_nightly-1.8.0.dev20240306}/src/py/flwr/server/strategy/fedmedian.py +0 -0
  151. {flwr_nightly-1.8.0.dev20240305 → flwr_nightly-1.8.0.dev20240306}/src/py/flwr/server/strategy/fedopt.py +0 -0
  152. {flwr_nightly-1.8.0.dev20240305 → flwr_nightly-1.8.0.dev20240306}/src/py/flwr/server/strategy/fedprox.py +0 -0
  153. {flwr_nightly-1.8.0.dev20240305 → flwr_nightly-1.8.0.dev20240306}/src/py/flwr/server/strategy/fedtrimmedavg.py +0 -0
  154. {flwr_nightly-1.8.0.dev20240305 → flwr_nightly-1.8.0.dev20240306}/src/py/flwr/server/strategy/fedxgb_bagging.py +0 -0
  155. {flwr_nightly-1.8.0.dev20240305 → flwr_nightly-1.8.0.dev20240306}/src/py/flwr/server/strategy/fedxgb_cyclic.py +0 -0
  156. {flwr_nightly-1.8.0.dev20240305 → flwr_nightly-1.8.0.dev20240306}/src/py/flwr/server/strategy/fedxgb_nn_avg.py +0 -0
  157. {flwr_nightly-1.8.0.dev20240305 → flwr_nightly-1.8.0.dev20240306}/src/py/flwr/server/strategy/fedyogi.py +0 -0
  158. {flwr_nightly-1.8.0.dev20240305 → flwr_nightly-1.8.0.dev20240306}/src/py/flwr/server/strategy/krum.py +0 -0
  159. {flwr_nightly-1.8.0.dev20240305 → flwr_nightly-1.8.0.dev20240306}/src/py/flwr/server/strategy/qfedavg.py +0 -0
  160. {flwr_nightly-1.8.0.dev20240305 → flwr_nightly-1.8.0.dev20240306}/src/py/flwr/server/strategy/strategy.py +0 -0
  161. {flwr_nightly-1.8.0.dev20240305 → flwr_nightly-1.8.0.dev20240306}/src/py/flwr/server/superlink/__init__.py +0 -0
  162. {flwr_nightly-1.8.0.dev20240305 → flwr_nightly-1.8.0.dev20240306}/src/py/flwr/server/superlink/driver/__init__.py +0 -0
  163. {flwr_nightly-1.8.0.dev20240305 → flwr_nightly-1.8.0.dev20240306}/src/py/flwr/server/superlink/driver/driver_grpc.py +0 -0
  164. {flwr_nightly-1.8.0.dev20240305 → flwr_nightly-1.8.0.dev20240306}/src/py/flwr/server/superlink/driver/driver_servicer.py +0 -0
  165. {flwr_nightly-1.8.0.dev20240305 → flwr_nightly-1.8.0.dev20240306}/src/py/flwr/server/superlink/fleet/__init__.py +0 -0
  166. {flwr_nightly-1.8.0.dev20240305 → flwr_nightly-1.8.0.dev20240306}/src/py/flwr/server/superlink/fleet/grpc_bidi/__init__.py +0 -0
  167. {flwr_nightly-1.8.0.dev20240305 → flwr_nightly-1.8.0.dev20240306}/src/py/flwr/server/superlink/fleet/grpc_bidi/flower_service_servicer.py +0 -0
  168. {flwr_nightly-1.8.0.dev20240305 → flwr_nightly-1.8.0.dev20240306}/src/py/flwr/server/superlink/fleet/grpc_bidi/grpc_bridge.py +0 -0
  169. {flwr_nightly-1.8.0.dev20240305 → flwr_nightly-1.8.0.dev20240306}/src/py/flwr/server/superlink/fleet/grpc_bidi/grpc_client_proxy.py +0 -0
  170. {flwr_nightly-1.8.0.dev20240305 → flwr_nightly-1.8.0.dev20240306}/src/py/flwr/server/superlink/fleet/grpc_bidi/grpc_server.py +0 -0
  171. {flwr_nightly-1.8.0.dev20240305 → flwr_nightly-1.8.0.dev20240306}/src/py/flwr/server/superlink/fleet/grpc_rere/__init__.py +0 -0
  172. {flwr_nightly-1.8.0.dev20240305 → flwr_nightly-1.8.0.dev20240306}/src/py/flwr/server/superlink/fleet/grpc_rere/fleet_servicer.py +0 -0
  173. {flwr_nightly-1.8.0.dev20240305 → flwr_nightly-1.8.0.dev20240306}/src/py/flwr/server/superlink/fleet/message_handler/__init__.py +0 -0
  174. {flwr_nightly-1.8.0.dev20240305 → flwr_nightly-1.8.0.dev20240306}/src/py/flwr/server/superlink/fleet/message_handler/message_handler.py +0 -0
  175. {flwr_nightly-1.8.0.dev20240305 → flwr_nightly-1.8.0.dev20240306}/src/py/flwr/server/superlink/fleet/rest_rere/__init__.py +0 -0
  176. {flwr_nightly-1.8.0.dev20240305 → flwr_nightly-1.8.0.dev20240306}/src/py/flwr/server/superlink/fleet/rest_rere/rest_api.py +0 -0
  177. {flwr_nightly-1.8.0.dev20240305 → flwr_nightly-1.8.0.dev20240306}/src/py/flwr/server/superlink/fleet/vce/__init__.py +0 -0
  178. {flwr_nightly-1.8.0.dev20240305 → flwr_nightly-1.8.0.dev20240306}/src/py/flwr/server/superlink/fleet/vce/backend/__init__.py +0 -0
  179. {flwr_nightly-1.8.0.dev20240305 → flwr_nightly-1.8.0.dev20240306}/src/py/flwr/server/superlink/fleet/vce/backend/backend.py +0 -0
  180. {flwr_nightly-1.8.0.dev20240305 → flwr_nightly-1.8.0.dev20240306}/src/py/flwr/server/superlink/fleet/vce/backend/raybackend.py +0 -0
  181. {flwr_nightly-1.8.0.dev20240305 → flwr_nightly-1.8.0.dev20240306}/src/py/flwr/server/superlink/fleet/vce/vce_api.py +0 -0
  182. {flwr_nightly-1.8.0.dev20240305 → flwr_nightly-1.8.0.dev20240306}/src/py/flwr/server/superlink/state/__init__.py +0 -0
  183. {flwr_nightly-1.8.0.dev20240305 → flwr_nightly-1.8.0.dev20240306}/src/py/flwr/server/superlink/state/in_memory_state.py +0 -0
  184. {flwr_nightly-1.8.0.dev20240305 → flwr_nightly-1.8.0.dev20240306}/src/py/flwr/server/superlink/state/sqlite_state.py +0 -0
  185. {flwr_nightly-1.8.0.dev20240305 → flwr_nightly-1.8.0.dev20240306}/src/py/flwr/server/superlink/state/state.py +0 -0
  186. {flwr_nightly-1.8.0.dev20240305 → flwr_nightly-1.8.0.dev20240306}/src/py/flwr/server/superlink/state/state_factory.py +0 -0
  187. {flwr_nightly-1.8.0.dev20240305 → flwr_nightly-1.8.0.dev20240306}/src/py/flwr/server/typing.py +0 -0
  188. {flwr_nightly-1.8.0.dev20240305 → flwr_nightly-1.8.0.dev20240306}/src/py/flwr/server/utils/__init__.py +0 -0
  189. {flwr_nightly-1.8.0.dev20240305 → flwr_nightly-1.8.0.dev20240306}/src/py/flwr/server/utils/tensorboard.py +0 -0
  190. {flwr_nightly-1.8.0.dev20240305 → flwr_nightly-1.8.0.dev20240306}/src/py/flwr/server/utils/validator.py +0 -0
  191. {flwr_nightly-1.8.0.dev20240305 → flwr_nightly-1.8.0.dev20240306}/src/py/flwr/server/workflow/__init__.py +0 -0
  192. {flwr_nightly-1.8.0.dev20240305 → flwr_nightly-1.8.0.dev20240306}/src/py/flwr/simulation/__init__.py +0 -0
  193. {flwr_nightly-1.8.0.dev20240305 → flwr_nightly-1.8.0.dev20240306}/src/py/flwr/simulation/app.py +0 -0
  194. {flwr_nightly-1.8.0.dev20240305 → flwr_nightly-1.8.0.dev20240306}/src/py/flwr/simulation/ray_transport/__init__.py +0 -0
  195. {flwr_nightly-1.8.0.dev20240305 → flwr_nightly-1.8.0.dev20240306}/src/py/flwr/simulation/ray_transport/ray_actor.py +0 -0
  196. {flwr_nightly-1.8.0.dev20240305 → flwr_nightly-1.8.0.dev20240306}/src/py/flwr/simulation/ray_transport/utils.py +0 -0
  197. {flwr_nightly-1.8.0.dev20240305 → flwr_nightly-1.8.0.dev20240306}/src/py/flwr/simulation/run_simulation.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: flwr-nightly
3
- Version: 1.8.0.dev20240305
3
+ Version: 1.8.0.dev20240306
4
4
  Summary: Flower: A Friendly Federated Learning Framework
5
5
  Home-page: https://flower.ai
6
6
  License: Apache-2.0
@@ -42,6 +42,7 @@ Requires-Dist: pydantic (<2.0.0) ; extra == "simulation"
42
42
  Requires-Dist: ray (==2.6.3) ; extra == "simulation"
43
43
  Requires-Dist: requests (>=2.31.0,<3.0.0) ; extra == "rest"
44
44
  Requires-Dist: starlette (>=0.31.0,<0.32.0) ; extra == "rest"
45
+ Requires-Dist: tomli (>=2.0.1,<3.0.0)
45
46
  Requires-Dist: typer[all] (>=0.9.0,<0.10.0)
46
47
  Requires-Dist: uvicorn[standard] (>=0.23.0,<0.24.0) ; extra == "rest"
47
48
  Project-URL: Documentation, https://flower.ai
@@ -182,7 +183,6 @@ Quickstart examples:
182
183
  - [Quickstart (JAX)](https://github.com/adap/flower/tree/main/examples/quickstart-jax)
183
184
  - [Quickstart (MONAI)](https://github.com/adap/flower/tree/main/examples/quickstart-monai)
184
185
  - [Quickstart (scikit-learn)](https://github.com/adap/flower/tree/main/examples/sklearn-logreg-mnist)
185
- - [Quickstart (XGBoost)](https://github.com/adap/flower/tree/main/examples/xgboost-quickstart)
186
186
  - [Quickstart (Android [TFLite])](https://github.com/adap/flower/tree/main/examples/android)
187
187
  - [Quickstart (iOS [CoreML])](https://github.com/adap/flower/tree/main/examples/ios)
188
188
  - [Quickstart (MLX)](https://github.com/adap/flower/tree/main/examples/quickstart-mlx)
@@ -194,7 +194,8 @@ Other [examples](https://github.com/adap/flower/tree/main/examples):
194
194
  - [PyTorch: From Centralized to Federated](https://github.com/adap/flower/tree/main/examples/pytorch-from-centralized-to-federated)
195
195
  - [Vertical FL](https://github.com/adap/flower/tree/main/examples/vertical-fl)
196
196
  - [Federated Finetuning of OpenAI's Whisper](https://github.com/adap/flower/tree/main/examples/whisper-federated-finetuning)
197
- - [Comprehensive XGBoost](https://github.com/adap/flower/tree/main/examples/xgboost-comprehensive)
197
+ - [Federated Finetuning of Large Language Model](https://github.com/adap/flower/tree/main/examples/fedllm-finetune)
198
+ - [Federated Finetuning of a Vision Transformer](https://github.com/adap/flower/tree/main/examples/vit-finetune)
198
199
  - [Advanced Flower with TensorFlow/Keras](https://github.com/adap/flower/tree/main/examples/advanced-tensorflow)
199
200
  - [Advanced Flower with PyTorch](https://github.com/adap/flower/tree/main/examples/advanced-pytorch)
200
201
  - Single-Machine Simulation of Federated Learning Systems ([PyTorch](https://github.com/adap/flower/tree/main/examples/simulation-pytorch)) ([Tensorflow](https://github.com/adap/flower/tree/main/examples/simulation-tensorflow))
@@ -132,7 +132,6 @@ Quickstart examples:
132
132
  - [Quickstart (JAX)](https://github.com/adap/flower/tree/main/examples/quickstart-jax)
133
133
  - [Quickstart (MONAI)](https://github.com/adap/flower/tree/main/examples/quickstart-monai)
134
134
  - [Quickstart (scikit-learn)](https://github.com/adap/flower/tree/main/examples/sklearn-logreg-mnist)
135
- - [Quickstart (XGBoost)](https://github.com/adap/flower/tree/main/examples/xgboost-quickstart)
136
135
  - [Quickstart (Android [TFLite])](https://github.com/adap/flower/tree/main/examples/android)
137
136
  - [Quickstart (iOS [CoreML])](https://github.com/adap/flower/tree/main/examples/ios)
138
137
  - [Quickstart (MLX)](https://github.com/adap/flower/tree/main/examples/quickstart-mlx)
@@ -144,7 +143,8 @@ Other [examples](https://github.com/adap/flower/tree/main/examples):
144
143
  - [PyTorch: From Centralized to Federated](https://github.com/adap/flower/tree/main/examples/pytorch-from-centralized-to-federated)
145
144
  - [Vertical FL](https://github.com/adap/flower/tree/main/examples/vertical-fl)
146
145
  - [Federated Finetuning of OpenAI's Whisper](https://github.com/adap/flower/tree/main/examples/whisper-federated-finetuning)
147
- - [Comprehensive XGBoost](https://github.com/adap/flower/tree/main/examples/xgboost-comprehensive)
146
+ - [Federated Finetuning of Large Language Model](https://github.com/adap/flower/tree/main/examples/fedllm-finetune)
147
+ - [Federated Finetuning of a Vision Transformer](https://github.com/adap/flower/tree/main/examples/vit-finetune)
148
148
  - [Advanced Flower with TensorFlow/Keras](https://github.com/adap/flower/tree/main/examples/advanced-tensorflow)
149
149
  - [Advanced Flower with PyTorch](https://github.com/adap/flower/tree/main/examples/advanced-pytorch)
150
150
  - Single-Machine Simulation of Federated Learning Systems ([PyTorch](https://github.com/adap/flower/tree/main/examples/simulation-pytorch)) ([Tensorflow](https://github.com/adap/flower/tree/main/examples/simulation-tensorflow))
@@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api"
4
4
 
5
5
  [tool.poetry]
6
6
  name = "flwr-nightly"
7
- version = "1.8.0-dev20240305"
7
+ version = "1.8.0-dev20240306"
8
8
  description = "Flower: A Friendly Federated Learning Framework"
9
9
  license = "Apache-2.0"
10
10
  authors = ["The Flower Authors <hello@flower.ai>"]
@@ -70,7 +70,8 @@ cryptography = "^42.0.4"
70
70
  pycryptodome = "^3.18.0"
71
71
  iterators = "^0.0.2"
72
72
  typer = { version = "^0.9.0", extras=["all"] }
73
- # Optional dependencies (VCE)
73
+ tomli = "^2.0.1"
74
+ # Optional dependencies (Simulation Engine)
74
75
  ray = { version = "==2.6.3", optional = true }
75
76
  pydantic = { version = "<2.0.0", optional = true }
76
77
  # Optional dependencies (REST transport layer)
@@ -18,6 +18,7 @@ import typer
18
18
 
19
19
  from .example import example
20
20
  from .new import new
21
+ from .run import run
21
22
 
22
23
  app = typer.Typer(
23
24
  help=typer.style(
@@ -30,6 +31,7 @@ app = typer.Typer(
30
31
 
31
32
  app.command()(new)
32
33
  app.command()(example)
34
+ app.command()(run)
33
35
 
34
36
  if __name__ == "__main__":
35
37
  app()
@@ -0,0 +1,151 @@
1
+ # Copyright 2024 Flower Labs GmbH. All Rights Reserved.
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+ # ==============================================================================
15
+ """Utility to validate the `flower.toml` file."""
16
+
17
+ import importlib
18
+ import os
19
+ from typing import Any, Dict, List, Optional, Tuple
20
+
21
+ import tomli
22
+
23
+
24
+ def load_flower_toml(path: Optional[str] = None) -> Optional[Dict[str, Any]]:
25
+ """Load flower.toml and return as dict."""
26
+ if path is None:
27
+ cur_dir = os.getcwd()
28
+ toml_path = os.path.join(cur_dir, "flower.toml")
29
+ else:
30
+ toml_path = path
31
+
32
+ if not os.path.isfile(toml_path):
33
+ return None
34
+
35
+ with open(toml_path, encoding="utf-8") as toml_file:
36
+ data = tomli.loads(toml_file.read())
37
+ return data
38
+
39
+
40
+ def validate_flower_toml_fields(
41
+ config: Dict[str, Any]
42
+ ) -> Tuple[bool, List[str], List[str]]:
43
+ """Validate flower.toml fields."""
44
+ errors = []
45
+ warnings = []
46
+
47
+ if "project" not in config:
48
+ errors.append("Missing [project] section")
49
+ else:
50
+ if "name" not in config["project"]:
51
+ errors.append('Property "name" missing in [project]')
52
+ if "version" not in config["project"]:
53
+ errors.append('Property "version" missing in [project]')
54
+ if "description" not in config["project"]:
55
+ warnings.append('Recommended property "description" missing in [project]')
56
+ if "license" not in config["project"]:
57
+ warnings.append('Recommended property "license" missing in [project]')
58
+ if "authors" not in config["project"]:
59
+ warnings.append('Recommended property "authors" missing in [project]')
60
+
61
+ if "flower" not in config:
62
+ errors.append("Missing [flower] section")
63
+ elif "components" not in config["flower"]:
64
+ errors.append("Missing [flower.components] section")
65
+ else:
66
+ if "serverapp" not in config["flower"]["components"]:
67
+ errors.append('Property "serverapp" missing in [flower.components]')
68
+ if "clientapp" not in config["flower"]["components"]:
69
+ errors.append('Property "clientapp" missing in [flower.components]')
70
+
71
+ return len(errors) == 0, errors, warnings
72
+
73
+
74
+ def validate_object_reference(ref: str) -> Tuple[bool, Optional[str]]:
75
+ """Validate object reference.
76
+
77
+ Returns
78
+ -------
79
+ Tuple[bool, Optional[str]]
80
+ A boolean indicating whether an object reference is valid and
81
+ the reason why it might not be.
82
+ """
83
+ module_str, _, attributes_str = ref.partition(":")
84
+ if not module_str:
85
+ return (
86
+ False,
87
+ f"Missing module in {ref}",
88
+ )
89
+ if not attributes_str:
90
+ return (
91
+ False,
92
+ f"Missing attribute in {ref}",
93
+ )
94
+
95
+ # Load module
96
+ try:
97
+ module = importlib.import_module(module_str)
98
+ except ModuleNotFoundError:
99
+ return False, f"Unable to load module {module_str}"
100
+
101
+ # Recursively load attribute
102
+ attribute = module
103
+ try:
104
+ for attribute_str in attributes_str.split("."):
105
+ attribute = getattr(attribute, attribute_str)
106
+ except AttributeError:
107
+ return (
108
+ False,
109
+ f"Unable to load attribute {attributes_str} from module {module_str}",
110
+ )
111
+
112
+ return (True, None)
113
+
114
+
115
+ def validate_flower_toml(config: Dict[str, Any]) -> Tuple[bool, List[str], List[str]]:
116
+ """Validate flower.toml."""
117
+ is_valid, errors, warnings = validate_flower_toml_fields(config)
118
+
119
+ if not is_valid:
120
+ return False, errors, warnings
121
+
122
+ # Validate serverapp
123
+ is_valid, reason = validate_object_reference(
124
+ config["flower"]["components"]["serverapp"]
125
+ )
126
+ if not is_valid and isinstance(reason, str):
127
+ return False, [reason], []
128
+
129
+ # Validate clientapp
130
+ is_valid, reason = validate_object_reference(
131
+ config["flower"]["components"]["clientapp"]
132
+ )
133
+
134
+ if not is_valid and isinstance(reason, str):
135
+ return False, [reason], []
136
+
137
+ return True, [], []
138
+
139
+
140
+ def apply_defaults(
141
+ config: Dict[str, Any],
142
+ defaults: Dict[str, Any],
143
+ ) -> Dict[str, Any]:
144
+ """Apply defaults to config."""
145
+ for key in defaults:
146
+ if key in config:
147
+ if isinstance(config[key], dict) and isinstance(defaults[key], dict):
148
+ apply_defaults(config[key], defaults[key])
149
+ else:
150
+ config[key] = defaults[key]
151
+ return config
@@ -0,0 +1,21 @@
1
+ # Copyright 2024 Flower Labs GmbH. All Rights Reserved.
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+ # ==============================================================================
15
+ """Flower command line interface `run` command."""
16
+
17
+ from .run import run as run
18
+
19
+ __all__ = [
20
+ "run",
21
+ ]
@@ -0,0 +1,102 @@
1
+ # Copyright 2024 Flower Labs GmbH. All Rights Reserved.
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+ # ==============================================================================
15
+ """Flower command line interface `run` command."""
16
+
17
+ import sys
18
+
19
+ import typer
20
+
21
+ from flwr.cli.flower_toml import apply_defaults, load_flower_toml, validate_flower_toml
22
+ from flwr.simulation.run_simulation import _run_simulation
23
+
24
+
25
+ def run() -> None:
26
+ """Run Flower project."""
27
+ print(
28
+ typer.style("Loading project configuration... ", fg=typer.colors.BLUE),
29
+ end="",
30
+ )
31
+ config = load_flower_toml()
32
+ if not config:
33
+ print(
34
+ typer.style(
35
+ "Project configuration could not be loaded. "
36
+ "flower.toml does not exist.",
37
+ fg=typer.colors.RED,
38
+ bold=True,
39
+ )
40
+ )
41
+ sys.exit()
42
+ print(typer.style("Success", fg=typer.colors.GREEN))
43
+
44
+ print(
45
+ typer.style("Validating project configuration... ", fg=typer.colors.BLUE),
46
+ end="",
47
+ )
48
+ is_valid, errors, warnings = validate_flower_toml(config)
49
+ if warnings:
50
+ print(
51
+ typer.style(
52
+ "Project configuration is missing the following "
53
+ "recommended properties:\n"
54
+ + "\n".join([f"- {line}" for line in warnings]),
55
+ fg=typer.colors.RED,
56
+ bold=True,
57
+ )
58
+ )
59
+
60
+ if not is_valid:
61
+ print(
62
+ typer.style(
63
+ "Project configuration could not be loaded.\nflower.toml is invalid:\n"
64
+ + "\n".join([f"- {line}" for line in errors]),
65
+ fg=typer.colors.RED,
66
+ bold=True,
67
+ )
68
+ )
69
+ sys.exit()
70
+ print(typer.style("Success", fg=typer.colors.GREEN))
71
+
72
+ # Apply defaults
73
+ defaults = {
74
+ "flower": {
75
+ "engine": {"name": "simulation", "simulation": {"super-node": {"num": 100}}}
76
+ }
77
+ }
78
+ config = apply_defaults(config, defaults)
79
+
80
+ server_app_ref = config["flower"]["components"]["serverapp"]
81
+ client_app_ref = config["flower"]["components"]["clientapp"]
82
+ engine = config["flower"]["engine"]["name"]
83
+
84
+ if engine == "simulation":
85
+ num_supernodes = config["flower"]["engine"]["simulation"]["super-node"]["num"]
86
+
87
+ print(
88
+ typer.style("Starting run... ", fg=typer.colors.BLUE),
89
+ )
90
+ _run_simulation(
91
+ server_app_attr=server_app_ref,
92
+ client_app_attr=client_app_ref,
93
+ num_supernodes=num_supernodes,
94
+ )
95
+ else:
96
+ print(
97
+ typer.style(
98
+ f"Engine '{engine}' is not yet supported in `flwr run`",
99
+ fg=typer.colors.RED,
100
+ bold=True,
101
+ )
102
+ )
@@ -31,12 +31,7 @@ from flwr.common import (
31
31
  )
32
32
  from flwr.common import recordset_compat as compat
33
33
  from flwr.common import serde
34
- from flwr.common.constant import (
35
- MESSAGE_TYPE_EVALUATE,
36
- MESSAGE_TYPE_FIT,
37
- MESSAGE_TYPE_GET_PARAMETERS,
38
- MESSAGE_TYPE_GET_PROPERTIES,
39
- )
34
+ from flwr.common.constant import MessageType, MessageTypeLegacy
40
35
  from flwr.common.grpc import create_channel
41
36
  from flwr.common.logger import log
42
37
  from flwr.common.retry_invoker import RetryInvoker
@@ -148,22 +143,22 @@ def grpc_connection( # pylint: disable=R0915
148
143
  recordset = compat.getpropertiesins_to_recordset(
149
144
  serde.get_properties_ins_from_proto(proto.get_properties_ins)
150
145
  )
151
- message_type = MESSAGE_TYPE_GET_PROPERTIES
146
+ message_type = MessageTypeLegacy.GET_PROPERTIES
152
147
  elif field == "get_parameters_ins":
153
148
  recordset = compat.getparametersins_to_recordset(
154
149
  serde.get_parameters_ins_from_proto(proto.get_parameters_ins)
155
150
  )
156
- message_type = MESSAGE_TYPE_GET_PARAMETERS
151
+ message_type = MessageTypeLegacy.GET_PARAMETERS
157
152
  elif field == "fit_ins":
158
153
  recordset = compat.fitins_to_recordset(
159
154
  serde.fit_ins_from_proto(proto.fit_ins), False
160
155
  )
161
- message_type = MESSAGE_TYPE_FIT
156
+ message_type = MessageType.TRAIN
162
157
  elif field == "evaluate_ins":
163
158
  recordset = compat.evaluateins_to_recordset(
164
159
  serde.evaluate_ins_from_proto(proto.evaluate_ins), False
165
160
  )
166
- message_type = MESSAGE_TYPE_EVALUATE
161
+ message_type = MessageType.EVALUATE
167
162
  elif field == "reconnect_ins":
168
163
  recordset = RecordSet()
169
164
  recordset.configs_records["config"] = ConfigsRecord(
@@ -197,20 +192,20 @@ def grpc_connection( # pylint: disable=R0915
197
192
  message_type = message.metadata.message_type
198
193
 
199
194
  # RecordSet --> *Res --> *Res proto -> ClientMessage proto
200
- if message_type == MESSAGE_TYPE_GET_PROPERTIES:
195
+ if message_type == MessageTypeLegacy.GET_PROPERTIES:
201
196
  getpropres = compat.recordset_to_getpropertiesres(recordset)
202
197
  msg_proto = ClientMessage(
203
198
  get_properties_res=serde.get_properties_res_to_proto(getpropres)
204
199
  )
205
- elif message_type == MESSAGE_TYPE_GET_PARAMETERS:
200
+ elif message_type == MessageTypeLegacy.GET_PARAMETERS:
206
201
  getparamres = compat.recordset_to_getparametersres(recordset, False)
207
202
  msg_proto = ClientMessage(
208
203
  get_parameters_res=serde.get_parameters_res_to_proto(getparamres)
209
204
  )
210
- elif message_type == MESSAGE_TYPE_FIT:
205
+ elif message_type == MessageType.TRAIN:
211
206
  fitres = compat.recordset_to_fitres(recordset, False)
212
207
  msg_proto = ClientMessage(fit_res=serde.fit_res_to_proto(fitres))
213
- elif message_type == MESSAGE_TYPE_EVALUATE:
208
+ elif message_type == MessageType.EVALUATE:
214
209
  evalres = compat.recordset_to_evaluateres(recordset)
215
210
  msg_proto = ClientMessage(evaluate_res=serde.evaluate_res_to_proto(evalres))
216
211
  elif message_type == "reconnect":
@@ -27,12 +27,7 @@ from flwr.client.client import (
27
27
  from flwr.client.numpy_client import NumPyClient
28
28
  from flwr.client.typing import ClientFn
29
29
  from flwr.common import ConfigsRecord, Context, Message, Metadata, RecordSet, log
30
- from flwr.common.constant import (
31
- MESSAGE_TYPE_EVALUATE,
32
- MESSAGE_TYPE_FIT,
33
- MESSAGE_TYPE_GET_PARAMETERS,
34
- MESSAGE_TYPE_GET_PROPERTIES,
35
- )
30
+ from flwr.common.constant import MessageType, MessageTypeLegacy
36
31
  from flwr.common.recordset_compat import (
37
32
  evaluateres_to_recordset,
38
33
  fitres_to_recordset,
@@ -115,14 +110,14 @@ def handle_legacy_message_from_msgtype(
115
110
  message_type = message.metadata.message_type
116
111
 
117
112
  # Handle GetPropertiesIns
118
- if message_type == MESSAGE_TYPE_GET_PROPERTIES:
113
+ if message_type == MessageTypeLegacy.GET_PROPERTIES:
119
114
  get_properties_res = maybe_call_get_properties(
120
115
  client=client,
121
116
  get_properties_ins=recordset_to_getpropertiesins(message.content),
122
117
  )
123
118
  out_recordset = getpropertiesres_to_recordset(get_properties_res)
124
119
  # Handle GetParametersIns
125
- elif message_type == MESSAGE_TYPE_GET_PARAMETERS:
120
+ elif message_type == MessageTypeLegacy.GET_PARAMETERS:
126
121
  get_parameters_res = maybe_call_get_parameters(
127
122
  client=client,
128
123
  get_parameters_ins=recordset_to_getparametersins(message.content),
@@ -131,14 +126,14 @@ def handle_legacy_message_from_msgtype(
131
126
  get_parameters_res, keep_input=False
132
127
  )
133
128
  # Handle FitIns
134
- elif message_type == MESSAGE_TYPE_FIT:
129
+ elif message_type == MessageType.TRAIN:
135
130
  fit_res = maybe_call_fit(
136
131
  client=client,
137
132
  fit_ins=recordset_to_fitins(message.content, keep_input=True),
138
133
  )
139
134
  out_recordset = fitres_to_recordset(fit_res, keep_input=False)
140
135
  # Handle EvaluateIns
141
- elif message_type == MESSAGE_TYPE_EVALUATE:
136
+ elif message_type == MessageType.EVALUATE:
142
137
  evaluate_res = maybe_call_evaluate(
143
138
  client=client,
144
139
  evaluate_ins=recordset_to_evaluateins(message.content, keep_input=True),
@@ -18,7 +18,7 @@
18
18
  from flwr.client.typing import ClientAppCallable
19
19
  from flwr.common import ndarrays_to_parameters, parameters_to_ndarrays
20
20
  from flwr.common import recordset_compat as compat
21
- from flwr.common.constant import MESSAGE_TYPE_FIT
21
+ from flwr.common.constant import MessageType
22
22
  from flwr.common.context import Context
23
23
  from flwr.common.differential_privacy import (
24
24
  compute_adaptive_clip_model_update,
@@ -40,7 +40,7 @@ def fixedclipping_mod(
40
40
 
41
41
  This mod clips the client model updates before sending them to the server.
42
42
 
43
- It operates on messages with type MESSAGE_TYPE_FIT.
43
+ It operates on messages with type MessageType.TRAIN.
44
44
 
45
45
  Notes
46
46
  -----
@@ -48,7 +48,7 @@ def fixedclipping_mod(
48
48
 
49
49
  Typically, fixedclipping_mod should be the last to operate on params.
50
50
  """
51
- if msg.metadata.message_type != MESSAGE_TYPE_FIT:
51
+ if msg.metadata.message_type != MessageType.TRAIN:
52
52
  return call_next(msg, ctxt)
53
53
  fit_ins = compat.recordset_to_fitins(msg.content, keep_input=True)
54
54
  if KEY_CLIPPING_NORM not in fit_ins.config:
@@ -93,7 +93,7 @@ def adaptiveclipping_mod(
93
93
 
94
94
  It also sends KEY_NORM_BIT to the server for computing the new clipping value.
95
95
 
96
- It operates on messages with type MESSAGE_TYPE_FIT.
96
+ It operates on messages with type MessageType.TRAIN.
97
97
 
98
98
  Notes
99
99
  -----
@@ -101,7 +101,7 @@ def adaptiveclipping_mod(
101
101
 
102
102
  Typically, adaptiveclipping_mod should be the last to operate on params.
103
103
  """
104
- if msg.metadata.message_type != MESSAGE_TYPE_FIT:
104
+ if msg.metadata.message_type != MessageType.TRAIN:
105
105
  return call_next(msg, ctxt)
106
106
 
107
107
  fit_ins = compat.recordset_to_fitins(msg.content, keep_input=True)
@@ -30,7 +30,7 @@ from flwr.common import (
30
30
  parameters_to_ndarrays,
31
31
  )
32
32
  from flwr.common import recordset_compat as compat
33
- from flwr.common.constant import MESSAGE_TYPE_FIT
33
+ from flwr.common.constant import MessageType
34
34
  from flwr.common.logger import log
35
35
  from flwr.common.secure_aggregation.crypto.shamir import create_shares
36
36
  from flwr.common.secure_aggregation.crypto.symmetric_encryption import (
@@ -150,7 +150,7 @@ def secaggplus_mod(
150
150
  ) -> Message:
151
151
  """Handle incoming message and return results, following the SecAgg+ protocol."""
152
152
  # Ignore non-fit messages
153
- if msg.metadata.message_type != MESSAGE_TYPE_FIT:
153
+ if msg.metadata.message_type != MessageType.TRAIN:
154
154
  return call_next(msg, ctxt)
155
155
 
156
156
  # Retrieve local state
@@ -16,6 +16,7 @@
16
16
 
17
17
 
18
18
  from .constant import MessageType as MessageType
19
+ from .constant import MessageTypeLegacy as MessageTypeLegacy
19
20
  from .context import Context as Context
20
21
  from .date import now as now
21
22
  from .grpc import GRPC_MAX_MESSAGE_LENGTH
@@ -85,6 +86,7 @@ __all__ = [
85
86
  "log",
86
87
  "Message",
87
88
  "MessageType",
89
+ "MessageTypeLegacy",
88
90
  "Metadata",
89
91
  "Metrics",
90
92
  "MetricsAggregationFn",
@@ -36,11 +36,6 @@ TRANSPORT_TYPES = [
36
36
  TRANSPORT_TYPE_VCE,
37
37
  ]
38
38
 
39
- MESSAGE_TYPE_GET_PROPERTIES = "get_properties"
40
- MESSAGE_TYPE_GET_PARAMETERS = "get_parameters"
41
- MESSAGE_TYPE_FIT = "fit"
42
- MESSAGE_TYPE_EVALUATE = "evaluate"
43
-
44
39
 
45
40
  class MessageType:
46
41
  """Message type."""
@@ -53,6 +48,17 @@ class MessageType:
53
48
  raise TypeError(f"{cls.__name__} cannot be instantiated.")
54
49
 
55
50
 
51
+ class MessageTypeLegacy:
52
+ """Legacy message type."""
53
+
54
+ GET_PROPERTIES = "get_properties"
55
+ GET_PARAMETERS = "get_parameters"
56
+
57
+ def __new__(cls) -> MessageTypeLegacy:
58
+ """Prevent instantiation."""
59
+ raise TypeError(f"{cls.__name__} cannot be instantiated.")
60
+
61
+
56
62
  class SType:
57
63
  """Serialisation type."""
58
64
 
@@ -19,15 +19,9 @@ import time
19
19
  from typing import List, Optional
20
20
 
21
21
  from flwr import common
22
- from flwr.common import RecordSet
22
+ from flwr.common import MessageType, MessageTypeLegacy, RecordSet
23
23
  from flwr.common import recordset_compat as compat
24
24
  from flwr.common import serde
25
- from flwr.common.constant import (
26
- MESSAGE_TYPE_EVALUATE,
27
- MESSAGE_TYPE_FIT,
28
- MESSAGE_TYPE_GET_PARAMETERS,
29
- MESSAGE_TYPE_GET_PROPERTIES,
30
- )
31
25
  from flwr.proto import driver_pb2, node_pb2, task_pb2 # pylint: disable=E0611
32
26
  from flwr.server.client_proxy import ClientProxy
33
27
 
@@ -57,7 +51,7 @@ class DriverClientProxy(ClientProxy):
57
51
  out_recordset = compat.getpropertiesins_to_recordset(ins)
58
52
  # Fetch response
59
53
  in_recordset = self._send_receive_recordset(
60
- out_recordset, MESSAGE_TYPE_GET_PROPERTIES, timeout, group_id
54
+ out_recordset, MessageTypeLegacy.GET_PROPERTIES, timeout, group_id
61
55
  )
62
56
  # RecordSet to Res
63
57
  return compat.recordset_to_getpropertiesres(in_recordset)
@@ -73,7 +67,7 @@ class DriverClientProxy(ClientProxy):
73
67
  out_recordset = compat.getparametersins_to_recordset(ins)
74
68
  # Fetch response
75
69
  in_recordset = self._send_receive_recordset(
76
- out_recordset, MESSAGE_TYPE_GET_PARAMETERS, timeout, group_id
70
+ out_recordset, MessageTypeLegacy.GET_PARAMETERS, timeout, group_id
77
71
  )
78
72
  # RecordSet to Res
79
73
  return compat.recordset_to_getparametersres(in_recordset, False)
@@ -86,7 +80,7 @@ class DriverClientProxy(ClientProxy):
86
80
  out_recordset = compat.fitins_to_recordset(ins, keep_input=True)
87
81
  # Fetch response
88
82
  in_recordset = self._send_receive_recordset(
89
- out_recordset, MESSAGE_TYPE_FIT, timeout, group_id
83
+ out_recordset, MessageType.TRAIN, timeout, group_id
90
84
  )
91
85
  # RecordSet to Res
92
86
  return compat.recordset_to_fitres(in_recordset, keep_input=False)
@@ -99,7 +93,7 @@ class DriverClientProxy(ClientProxy):
99
93
  out_recordset = compat.evaluateins_to_recordset(ins, keep_input=True)
100
94
  # Fetch response
101
95
  in_recordset = self._send_receive_recordset(
102
- out_recordset, MESSAGE_TYPE_EVALUATE, timeout, group_id
96
+ out_recordset, MessageType.EVALUATE, timeout, group_id
103
97
  )
104
98
  # RecordSet to Res
105
99
  return compat.recordset_to_evaluateres(in_recordset)