Skip to content

Commit

Permalink
Add garbage collection at the end of each round in cyclic controller
Browse files Browse the repository at this point in the history
  • Loading branch information
IsaacYangSLA committed Aug 2, 2023
1 parent 54c0ca1 commit 51b4b35
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion nvflare/app_common/workflows/cyclic_ctl.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

import gc
import random

from nvflare.apis.client import Client
Expand Down Expand Up @@ -205,7 +206,8 @@ def control_flow(self, abort_signal: Signal, fl_ctx: FLContext):
# Call the self._engine to persist the snapshot of all the FLComponents
self._engine.persist_components(fl_ctx, completed=False)

self.log_info(fl_ctx, "Ending current round={}.".format(self._current_round))
self.log_debug(fl_ctx, "Ending current round={}.".format(self._current_round))
gc.collect()

self.log_debug(fl_ctx, "Cyclic ended.")
except Exception as e:
Expand Down

0 comments on commit 51b4b35

Please sign in to comment.