Search in sources :

Example 6 with RepMat

use of org.apache.sysml.lops.RepMat in project incubator-systemml by apache.

the class QuaternaryOp method constructLeftFactorMRLop.

private Lop constructLeftFactorMRLop(Hop U, Hop V, boolean cacheU, double m1Size) {
    Lop lU = null;
    if (cacheU) {
        // partitioning of U for read through distributed cache
        boolean needPartU = !U.dimsKnown() || U.getDim1() * U.getDim2() > DistributedCacheInput.PARTITION_SIZE;
        lU = U.constructLops();
        if (needPartU) {
            // requires partitioning
            lU = new DataPartition(lU, DataType.MATRIX, ValueType.DOUBLE, (m1Size > OptimizerUtils.getLocalMemBudget()) ? ExecType.MR : ExecType.CP, PDataPartitionFormat.ROW_BLOCK_WISE_N);
            lU.getOutputParameters().setDimensions(U.getDim1(), U.getDim2(), getRowsInBlock(), getColsInBlock(), U.getNnz());
            setLineNumbers(lU);
        }
    } else {
        // replication of U for shuffle to target block
        // ncol of t(V) -> nrow of V determines num replicates
        Lop offset = createOffsetLop(V, false);
        lU = new RepMat(U.constructLops(), offset, true, V.getDataType(), V.getValueType());
        lU.getOutputParameters().setDimensions(U.getDim1(), U.getDim2(), U.getRowsInBlock(), U.getColsInBlock(), U.getNnz());
        setLineNumbers(lU);
        Group grpU = new Group(lU, Group.OperationTypes.Sort, DataType.MATRIX, ValueType.DOUBLE);
        grpU.getOutputParameters().setDimensions(U.getDim1(), U.getDim2(), U.getRowsInBlock(), U.getColsInBlock(), -1);
        setLineNumbers(grpU);
        lU = grpU;
    }
    return lU;
}
Also used : Group(org.apache.sysml.lops.Group) RepMat(org.apache.sysml.lops.RepMat) Lop(org.apache.sysml.lops.Lop) DataPartition(org.apache.sysml.lops.DataPartition)

Aggregations

Group (org.apache.sysml.lops.Group)6 Lop (org.apache.sysml.lops.Lop)6 RepMat (org.apache.sysml.lops.RepMat)6 DataPartition (org.apache.sysml.lops.DataPartition)5 ExecType (org.apache.sysml.lops.LopProperties.ExecType)3 MultiThreadedHop (org.apache.sysml.hops.Hop.MultiThreadedHop)2 Aggregate (org.apache.sysml.lops.Aggregate)2 GroupedAggregate (org.apache.sysml.lops.GroupedAggregate)2 HashMap (java.util.HashMap)1 AppendR (org.apache.sysml.lops.AppendR)1 Binary (org.apache.sysml.lops.Binary)1 BinaryM (org.apache.sysml.lops.BinaryM)1 BinaryScalar (org.apache.sysml.lops.BinaryScalar)1 BinaryUAggChain (org.apache.sysml.lops.BinaryUAggChain)1 CombineBinary (org.apache.sysml.lops.CombineBinary)1 OperationTypes (org.apache.sysml.lops.CombineBinary.OperationTypes)1 CombineUnary (org.apache.sysml.lops.CombineUnary)1 ConvolutionTransform (org.apache.sysml.lops.ConvolutionTransform)1 Data (org.apache.sysml.lops.Data)1 GroupedAggregateM (org.apache.sysml.lops.GroupedAggregateM)1