Skip to content

Commit 942a3a2

Browse files
ywcb00mboehm7
authored andcommitted
[SYSTEMDS-3185] Docs and cleanup multi-tenant federated learning
Closes #1627.
1 parent ea86d4b commit 942a3a2

4 files changed

Lines changed: 58 additions & 5 deletions

File tree

docs/api/python/sources/guide/federated.rst.txt

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,3 +99,29 @@ The print should look like
9999
that you have:
100100

101101
a csv file, mtd file, and SystemDS Environment is set correctly.
102+
103+
Multi-tenant Federated Learning
104+
-------------------------------
105+
106+
SystemDS supports Multi-tenant Federated Learning, meaning that multiple
107+
coordinators learn on shared federated workers. From another perspective,
108+
the federated worker allows multiple coordinators to perform model training
109+
simultaneously using the data from the respective federated site. This
110+
approach enables the worker to operate in a server-like mode, providing
111+
multiple tenants with the ability to learn on the federated data at the same
112+
time. Tenant isolation ensures that tenant-specific intermediate results are
113+
only accessible by the respective tenant.
114+
115+
Limitations
116+
~~~~~~~~~~~
117+
118+
Since the coordinators are differentiated by their IP address in combination
119+
with their process ID, the worker is not able to isolate coordinators which
120+
share the same IP address and the same process ID. This occurs, for example,
121+
when two coordinators are running behind a proxy (same IP address), where
122+
both coordinators coincidentally have the same process ID.
123+
124+
A second limitation is showing up in networks using the Dynamic Host Protocol
125+
(DHCP). Since the federated worker identifies the coordinator based on the
126+
IP address, the worker does not re-identify the coordinator when its IP address
127+
has changed, i.e., when DHCP renews its IP address.

src/main/java/org/apache/sysds/runtime/controlprogram/LocalVariableMap.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919

2020
package org.apache.sysds.runtime.controlprogram;
2121

22-
import java.util.concurrent.ConcurrentHashMap;
2322
import java.util.HashMap;
2423
import java.util.HashSet;
2524
import java.util.Map;
@@ -45,19 +44,19 @@ public class LocalVariableMap implements Cloneable
4544
private static final IDSequence _seq = new IDSequence();
4645

4746
//variable map data and id
48-
private final ConcurrentHashMap<String, Data> localMap;
47+
private final HashMap<String, Data> localMap;
4948
private final long localID;
5049

5150
//optional set of registered outputs
5251
private HashSet<String> outputs = null;
5352

5453
public LocalVariableMap() {
55-
localMap = new ConcurrentHashMap<>();
54+
localMap = new HashMap<>();
5655
localID = _seq.getNextID();
5756
}
5857

5958
public LocalVariableMap(LocalVariableMap vars) {
60-
localMap = new ConcurrentHashMap<>(vars.localMap);
59+
localMap = new HashMap<>(vars.localMap);
6160
localID = _seq.getNextID();
6261
}
6362

src/main/python/docs/source/guide/federated.rst

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,3 +99,29 @@ The print should look like
9999
that you have:
100100

101101
a csv file, mtd file, and SystemDS Environment is set correctly.
102+
103+
Multi-tenant Federated Learning
104+
-------------------------------
105+
106+
SystemDS supports Multi-tenant Federated Learning, meaning that multiple
107+
coordinators learn on shared federated workers. From another perspective,
108+
the federated worker allows multiple coordinators to perform model training
109+
simultaneously using the data from the respective federated site. This
110+
approach enables the worker to operate in a server-like mode, providing
111+
multiple tenants with the ability to learn on the federated data at the same
112+
time. Tenant isolation ensures that tenant-specific intermediate results are
113+
only accessible by the respective tenant.
114+
115+
Limitations
116+
~~~~~~~~~~~
117+
118+
Since the coordinators are differentiated by their IP address in combination
119+
with their process ID, the worker is not able to isolate coordinators which
120+
share the same IP address and the same process ID. This occurs, for example,
121+
when two coordinators are running behind a proxy (same IP address), where
122+
both coordinators coincidentally have the same process ID.
123+
124+
A second limitation is showing up in networks using the Dynamic Host Protocol
125+
(DHCP). Since the federated worker identifies the coordinator based on the
126+
IP address, the worker does not re-identify the coordinator when its IP address
127+
has changed, i.e., when DHCP renews its IP address.

src/test/java/org/apache/sysds/test/functions/federated/multitenant/FederatedReuseSlicesTest.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,9 +247,11 @@ private boolean checkForReuses(OpType opType, String outputLog, ExecMode execMod
247247
boolean retVal = false;
248248
int multiplier = 1;
249249
int numInst = -1;
250+
int resSerial = 0; // serialized responses written to lineage cache
250251
switch(opType) {
251252
case EW_MULT:
252253
numInst = 1;
254+
resSerial = 1;
253255
break;
254256
case RM_EMPTY:
255257
numInst = 1;
@@ -262,7 +264,7 @@ private boolean checkForReuses(OpType opType, String outputLog, ExecMode execMod
262264
if(coordIX <= 1) {
263265
retVal = outputLog.contains(LINCACHE_MULTILVL + "0/");
264266
retVal &= outputLog.contains(LINCACHE_WRITES + Integer.toString(
265-
(((coordIX == 0) ? 1 : 0) + numInst) // read + instructions
267+
(((coordIX == 0) ? 1 : 0) + numInst + resSerial) // read + instructions + serialization
266268
* workerProcesses.size()) + "/");
267269
}
268270
else {

0 commit comments

Comments
 (0)