You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@systemds.apache.org by GitBox <gi...@apache.org> on 2022/04/01 18:13:39 UTC

[GitHub] [systemds] phaniarnab commented on a change in pull request #1574: [SYSTEMDS-3185] Federated Broadcast Slices Lineage

phaniarnab commented on a change in pull request #1574:
URL: https://github.com/apache/systemds/pull/1574#discussion_r840817391



##########
File path: src/main/java/org/apache/sysds/runtime/controlprogram/federated/FederationMap.java
##########
@@ -226,11 +228,27 @@ public FederatedRequest broadcast(ScalarObject scalar) {
 		// multi-threaded block slicing and federation request creation
 		FederatedRequest[] ret = new FederatedRequest[ix.length];
 		Arrays.setAll(ret,
-			i -> new FederatedRequest(RequestType.PUT_VAR, lineageTrace, id,
-				cb.slice(ix[i][0], ix[i][1], ix[i][2], ix[i][3], isFrame ? new FrameBlock() : new MatrixBlock())));
+			i -> sliceBroadcastBlock(ix[i], id, cb, lineageItem, isFrame));
 		return ret;
 	}
 
+	private FederatedRequest sliceBroadcastBlock(int[] ix, long id, CacheBlock cb, LineageItem objLi, boolean isFrame) {
+		LineageItem li = null;
+		if(objLi != null) {
+			final String scalarCPOSuffix = InstructionUtils.concatOperands(
+				DataType.SCALAR.name(), ValueType.INT64.name(), String.valueOf(true));
+			// manually create a lineage item for indexing to complete the lineage trace for slicing
+			li = new LineageItem(RightIndex.OPCODE, new LineageItem[]{objLi,
+				new LineageItem(InstructionUtils.concatOperandParts(String.valueOf(ix[0] + 1), scalarCPOSuffix)),
+				new LineageItem(InstructionUtils.concatOperandParts(String.valueOf(ix[1] + 1), scalarCPOSuffix)),
+				new LineageItem(InstructionUtils.concatOperandParts(String.valueOf(ix[2] + 1), scalarCPOSuffix)),
+				new LineageItem(InstructionUtils.concatOperandParts(String.valueOf(ix[3] + 1), scalarCPOSuffix))});

Review comment:
       Please follow how we create lineage items in ParameterizedBuiltinCPInstruction. You simply need to create a CPOperand for each input and pass those to the getLineage function.




-- 
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: dev-unsubscribe@systemds.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org