flo-l commented on a change in pull request #1525:
URL: https://github.com/apache/systemds/pull/1525#discussion_r793799317



##########
File path: 
src/main/java/org/apache/sysds/runtime/controlprogram/paramserv/FederatedPSControlThread.java
##########
@@ -160,21 +161,45 @@ public void setup(double weightingFactor) {
                        PROG_END);
 
                // write program and meta data to worker
-               Future<FederatedResponse> udfResponse = 
_featuresData.executeFederatedOperation(
-                       new FederatedRequest(RequestType.EXEC_UDF, 
_featuresData.getVarID(),
-                               new SetupFederatedWorker(_batchSize, dataSize, 
_possibleBatchesPerLocalEpoch,
-                                       programSerialized, 
_inst.getNamespace(), _inst.getFunctionName(),
-                                       _ps.getAggInst().getFunctionName(), 
_ec.getListObject("hyperparams"),
-                                       _modelVarID, _nbatches, _modelAvg)));
+               Future<FederatedResponse> udfResponse;
+               //_use_homomorphic_encryption = false;
+               if (_use_homomorphic_encryption) {
+                       // TODO: generate a here
+                       byte[] a = ((HEParamServer)_ps).generateA();
+                       // generate pk[i] on each client and return it
+                       udfResponse = _featuresData.executeFederatedOperation(
+                                       new 
FederatedRequest(RequestType.EXEC_UDF, _featuresData.getVarID(),
+                                                       new 
SetupHEFederatedWorker(_batchSize, dataSize, _possibleBatchesPerLocalEpoch,
+                                                                       
programSerialized, _inst.getNamespace(), _inst.getFunctionName(),
+                                                                       
_ps.getAggInst().getFunctionName(), _ec.getListObject("hyperparams"),
+                                                                       
_modelVarID, _nbatches, a)));
+               } else {
+                       udfResponse = _featuresData.executeFederatedOperation(
+                                       new 
FederatedRequest(RequestType.EXEC_UDF, _featuresData.getVarID(),
+                                                       new 
SetupFederatedWorker(_batchSize, dataSize, _possibleBatchesPerLocalEpoch,
+                                                                       
programSerialized, _inst.getNamespace(), _inst.getFunctionName(),
+                                                                       
_ps.getAggInst().getFunctionName(), _ec.getListObject("hyperparams"),
+                                                                       
_modelVarID, _nbatches, _modelAvg)));
+               }

Review comment:
       nice catch and excellent idea! fixed in 90018118a.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to