Skip to content

Commit

Permalink
Put memory under flag
Browse files Browse the repository at this point in the history
Signed-off-by: Chaurasiya, Payal <[email protected]>
  • Loading branch information
payalcha committed Nov 20, 2024
1 parent 411f5d0 commit 624253a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
9 changes: 6 additions & 3 deletions openfl/component/aggregator/aggregator.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ def __init__(
)
self._end_of_round_check_done = [False] * rounds_to_train
self.stragglers = []
self.log_memory_usage = log_memory_usage
self.log_memory_usage = log_memory_usage # Flag can be enabled to get memory usage details for ubuntu system
self.memory_details = []
self.rounds_to_train = rounds_to_train

Expand Down Expand Up @@ -1019,8 +1019,11 @@ def _end_of_round_check(self):
all_tasks = self.assigner.get_all_tasks_for_round(self.round_number)
for task_name in all_tasks:
self._compute_validation_related_task_metrics(task_name)
memory_detail = self.get_memory_usage(self.round_number, "aggregator")
self.memory_details.append(memory_detail)

if self.log_memory_usage:
# This is the place to check the memory usage of the aggregator
memory_detail = self.get_memory_usage(self.round_number, "aggregator")
self.memory_details.append(memory_detail)

# Once all of the task results have been processed
self._end_of_round_check_done[self.round_number] = True
Expand Down
2 changes: 1 addition & 1 deletion openfl/component/collaborator/collaborator.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ def __init__(
self.delta_updates = delta_updates

self.client = client
self.log_memory_usage = log_memory_usage
self.log_memory_usage = log_memory_usage # Flag can be enabled to get memory usage details for ubuntu system
self.task_config = task_config

self.logger = getLogger(__name__)
Expand Down

0 comments on commit 624253a

Please sign in to comment.