kev-inn commented on code in PR #1628:
URL: https://github.com/apache/systemds/pull/1628#discussion_r891282601


##########
src/main/java/org/apache/sysds/runtime/instructions/cp/CovarianceCPInstruction.java:
##########
@@ -82,4 +85,28 @@ public void processInstruction(ExecutionContext ec)
                double val = covobj.getRequiredResult(_optr);
                ec.setScalarOutput(output_name, new DoubleObject(val));
        }
+
+       @Override
+       protected FEDInstruction tryReplaceWithFederated(ExecutionContext ec) {
+               /* NOTE: the requirement before was:
+               if( (instruction.input1.isMatrix() && 
ec.getMatrixObject(instruction.input1).isFederatedExcept(FTypes.FType.BROADCAST))
+                               || (instruction.input2.isMatrix() && 
ec.getMatrixObject(instruction.input2).isFederatedExcept(FTypes.FType.BROADCAST)))
 {
+                       if(instruction.getOpcode().equals(...) )
+                               ...
+                       else if("cov".equals(instruction.getOpcode()) && 
(ec.getMatrixObject(instruction.input1).isFederated(
+                                       FTypes.FType.ROW) ||
+                                       
ec.getMatrixObject(instruction.input2).isFederated(FTypes.FType.ROW)))
+                               ...
+                       else
+                               ...
+               
+               This allowed `input1(Broadcast & Row) & input2(!Broadcast & 
...)`, I am not sure if that is intentional.
+                */
+               if((input1.isMatrix() && 
ec.getMatrixObject(input1).isFederated(FTypes.FType.ROW) &&
+                       
ec.getMatrixObject(input1).isFederatedExcept(FTypes.FType.BROADCAST)) ||
+                       (input2.isMatrix() && 
ec.getMatrixObject(input2).isFederated(FTypes.FType.ROW) &&
+                               
ec.getMatrixObject(input2).isFederatedExcept(FTypes.FType.BROADCAST)))

Review Comment:
   I am not sure about this, no testcase covers this I think.



-- 
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