securefederatedai / openfl

An Open Framework for Federated Learning.
https://openfl.readthedocs.io/en/latest/index.html
Apache License 2.0
734 stars 207 forks source link

Memory Leak Logs #1159

Closed payalcha closed 1 week ago

payalcha commented 1 week ago

Reviewed PR - https://github.com/securefederatedai/openfl/pull/1155 (Had to close as some unsigned commits were there)

Openfl component change Add memory leak logs for aggregator and collaborator, if log_memory_usage flag can be set for ubuntu.

Changes -

  1. aggregator.py - Function get_memory_usage added , which collects process as well as system log.
  2. collaborator.py - Function get_memory_usage added , which collects process as well as system log. Output - agg_mem_details.json - details of aggregator in json format _mem_details.json - details of aggregator in json format

Structure - { "round_number": 0, "metric_origin": "collaborator1", "process_memory": 1155.19, "virtual_memory": { }, "swap_memory": { } }

Test changes

  1. log_memory_usage flag is added in conftest.py and passed to test when set.
  2. Correction - federation_helper.py - _verify_completion_for_participant - added timeout on the basis of num_rounds.