MCPcopy
hub / github.com/FedML-AI/FedML / log_aggregation_status

Function log_aggregation_status

python/fedml/core/mlops/__init__.py:242–274  ·  view source on GitHub ↗
(status, run_id=None)

Source from the content-addressed store, hash-verified

240
241
242def log_aggregation_status(status, run_id=None):
243 if not mlops_enabled(MLOpsStore.mlops_args):
244 return
245
246 if run_id is not None:
247 MLOpsStore.mlops_args.run_id = run_id
248 MLOpsStore.mlops_run_id = run_id
249 set_realtime_params()
250
251 if not MLOpsStore.mlops_bind_result:
252 return
253
254 logging.info("log aggregation status {}".format(status))
255
256 setup_log_mqtt_mgr()
257 if mlops_parrot_enabled(MLOpsStore.mlops_args):
258 device_role = "simulator"
259 else:
260 device_role = "server"
261 if mlops_parrot_enabled(MLOpsStore.mlops_args):
262 MLOpsStore.mlops_metrics.broadcast_server_training_status(MLOpsStore.mlops_run_id, status, role=device_role)
263 sys_utils.save_simulator_process(ClientConstants.get_data_dir(),
264 ClientConstants.LOCAL_RUNNER_INFO_DIR_NAME, os.getpid(),
265 str(MLOpsStore.mlops_run_id),
266 run_status=status)
267
268 # Start log processor for current run
269 if status == ServerConstants.MSG_MLOPS_SERVER_STATUS_FINISHED or \
270 status == ServerConstants.MSG_MLOPS_SERVER_STATUS_FAILED:
271 MLOpsRuntimeLogDaemon.get_instance(MLOpsStore.mlops_args).stop_log_processor(MLOpsStore.mlops_run_id,
272 MLOpsStore.mlops_edge_id)
273 else:
274 MLOpsStore.mlops_metrics.report_server_training_status(MLOpsStore.mlops_run_id, status, role=device_role)
275
276
277def log_training_finished_status(run_id=None):

Callers 2

Calls 10

mlops_enabledFunction · 0.85
set_realtime_paramsFunction · 0.85
setup_log_mqtt_mgrFunction · 0.85
mlops_parrot_enabledFunction · 0.85
stop_log_processorMethod · 0.80
infoMethod · 0.45
get_data_dirMethod · 0.45
get_instanceMethod · 0.45

Tested by

no test coverage detected