From 98b1561db1ed6778ba5849cc52c6378fd02f42be Mon Sep 17 00:00:00 2001
From: Rishi Sharma <rishi.sharma@epfl.ch>
Date: Tue, 8 Mar 2022 09:07:27 +0100
Subject: [PATCH] Reduce data saved

---
 src/decentralizepy/sharing/PartialModel.py       | 4 ++--
 src/decentralizepy/training/ChangeAccumulator.py | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/decentralizepy/sharing/PartialModel.py b/src/decentralizepy/sharing/PartialModel.py
index 107e20d..529f673 100644
--- a/src/decentralizepy/sharing/PartialModel.py
+++ b/src/decentralizepy/sharing/PartialModel.py
@@ -70,8 +70,8 @@ class PartialModel(Sharing):
         self.total_meta = 0
 
         # Only save for 2 procs: Save space
-        if rank == 0 or rank == 1:
-            self.save_shared = True
+        if self.save_shared and not (rank == 0 or rank == 1):
+            self.save_shared = False
 
         if self.save_shared:
             self.folder_path = os.path.join(
diff --git a/src/decentralizepy/training/ChangeAccumulator.py b/src/decentralizepy/training/ChangeAccumulator.py
index 257b4ac..6ee5dc7 100644
--- a/src/decentralizepy/training/ChangeAccumulator.py
+++ b/src/decentralizepy/training/ChangeAccumulator.py
@@ -73,7 +73,7 @@ class ChangeAccumulator(Training):
             batch_size,
             shuffle,
         )
-        self.save_accumulated = conditional_value(save_accumulated, "", True)
+        self.save_accumulated = conditional_value(save_accumulated, "", False)
         self.communication_round = 0
         if self.save_accumulated:
             self.model_change_path = os.path.join(
-- 
GitLab