Skip to content

Commit

Permalink
Merge pull request #503 from FedML-AI/test/v0.7.0
Browse files Browse the repository at this point in the history
Test/v0.7.0
  • Loading branch information
chaoyanghe authored Aug 29, 2022
2 parents f765e78 + 34c8d20 commit 0895ee1
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
5 changes: 3 additions & 2 deletions doc/en/cross-silo/examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@

- [mqtt_s3_fedavg_mnist_lr_example](./examples/mqtt_s3_fedavg_mnist_lr_example.md): an example to illustrate running horizontal federated learning in data silos (hospitals, banks, etc.)

- [mqtt_s3_fedavg_mnist_lr_example](./examples/mqtt_s3_fedavg_attack_mnist_lr_example.md): an example to illustrate running attackers on horizontal federated learning
- [mqtt_s3_fedavg_attack_mnist_lr_example](./examples/mqtt_s3_fedavg_attack_mnist_lr_example.md): an example to illustrate running attackers on horizontal federated learning

- [mqtt_s3_fedavg_mnist_lr_example](./examples/mqtt_s3_fedavg_defense_mnist_lr_example.md): an example to illustrate running defense methods on horizontal federated learning
- [mqtt_s3_fedavg_defense_mnist_lr_example](./examples/mqtt_s3_fedavg_defense_mnist_lr_example.md): an example to illustrate running defense methods on horizontal federated learning

## Hierarchical Federated Learning

Expand All @@ -15,3 +15,4 @@ As shown in the figure below, here `hierarchical` implies that each FL Client (d

<img src="./../_static/image/cross-silo-hi.png" alt="parrot" style="width:100%;"/>


2 changes: 2 additions & 0 deletions doc/en/feature/fedml_feature_overview.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Overview

15 changes: 6 additions & 9 deletions python/fedml/cli/edge_deployment/client_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -789,15 +789,6 @@ def send_agent_active_msg(self):
def on_agent_mqtt_connected(self, mqtt_client_object):
# The MQTT message topic format is as follows: <sender>/<receiver>/<action>

# Init the mlops metrics object
if self.mlops_metrics is None:
self.mlops_metrics = MLOpsMetrics()
self.mlops_metrics.set_messenger(self.mqtt_mgr)
self.mlops_metrics.report_client_training_status(self.edge_id, ClientConstants.MSG_MLOPS_CLIENT_STATUS_IDLE)
MLOpsStatus.get_instance().set_client_agent_status(
self.edge_id, ClientConstants.MSG_MLOPS_CLIENT_STATUS_IDLE
)

# Setup MQTT message listener for starting training
topic_start_train = "flserver_agent/" + str(self.edge_id) + "/start_train"
self.mqtt_mgr.add_message_listener(topic_start_train, self.callback_start_train)
Expand Down Expand Up @@ -872,6 +863,12 @@ def setup_agent_mqtt_connection(self, service_config):
self.mqtt_mgr.add_disconnected_listener(self.on_agent_mqtt_disconnected)
self.mqtt_mgr.connect()

self.setup_client_mqtt_mgr()
self.wait_client_mqtt_connected()
self.mlops_metrics.report_client_training_status(self.edge_id,
ClientConstants.MSG_MLOPS_CLIENT_STATUS_IDLE)
self.release_client_mqtt_mgr()

def start_agent_mqtt_loop(self):
# Start MQTT message loop
try:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def send_message(self, topic, message, wait_for_publish=True):
MLOpsProfilerEvent.log_to_wandb({"Comm/send_delay_mqtt": time.time() - mqtt_send_start_time})

def send_message_json(self, topic, message, wait_for_publish=True):
ret_info = self._client.publish(topic, payload=message, qos=2)
ret_info = self._client.publish(topic, payload=message)
if wait_for_publish:
try:
ret_info.wait_for_publish(1)
Expand Down

0 comments on commit 0895ee1

Please sign in to comment.