Search in sources :

Example 6 with AppendM

use of org.apache.sysml.lops.AppendM in project systemml by apache.

the class Dag method computeFootprintInMapper.

/**
 * Computes the memory footprint required to execute <code>node</code> in the mapper.
 * It is used only for those nodes that use inputs from distributed cache. The returned
 * value is utilized in limiting the number of instructions piggybacked onto a single GMR mapper.
 *
 * @param node low-level operator
 * @return memory footprint
 */
private static double computeFootprintInMapper(Lop node) {
    // Memory limits must be checked only for nodes that use distributed cache
    if (!node.usesDistributedCache())
        // default behavior
        return 0.0;
    OutputParameters in1dims = node.getInputs().get(0).getOutputParameters();
    OutputParameters in2dims = node.getInputs().get(1).getOutputParameters();
    double footprint = 0;
    if (node instanceof MapMult) {
        int dcInputIndex = node.distributedCacheInputIndex()[0];
        footprint = AggBinaryOp.getMapmmMemEstimate(in1dims.getNumRows(), in1dims.getNumCols(), in1dims.getRowsInBlock(), in1dims.getColsInBlock(), in1dims.getNnz(), in2dims.getNumRows(), in2dims.getNumCols(), in2dims.getRowsInBlock(), in2dims.getColsInBlock(), in2dims.getNnz(), dcInputIndex, false);
    } else if (node instanceof PMMJ) {
        int dcInputIndex = node.distributedCacheInputIndex()[0];
        footprint = AggBinaryOp.getMapmmMemEstimate(in1dims.getNumRows(), 1, in1dims.getRowsInBlock(), in1dims.getColsInBlock(), in1dims.getNnz(), in2dims.getNumRows(), in2dims.getNumCols(), in2dims.getRowsInBlock(), in2dims.getColsInBlock(), in2dims.getNnz(), dcInputIndex, true);
    } else if (node instanceof AppendM) {
        footprint = BinaryOp.footprintInMapper(in1dims.getNumRows(), in1dims.getNumCols(), in2dims.getNumRows(), in2dims.getNumCols(), in1dims.getRowsInBlock(), in1dims.getColsInBlock());
    } else if (node instanceof BinaryM) {
        footprint = BinaryOp.footprintInMapper(in1dims.getNumRows(), in1dims.getNumCols(), in2dims.getNumRows(), in2dims.getNumCols(), in1dims.getRowsInBlock(), in1dims.getColsInBlock());
    } else {
        // default behavior
        return 0.0;
    }
    return footprint;
}
Also used : OutputParameters(org.apache.sysml.lops.OutputParameters) MapMult(org.apache.sysml.lops.MapMult) BinaryM(org.apache.sysml.lops.BinaryM) AppendM(org.apache.sysml.lops.AppendM) PMMJ(org.apache.sysml.lops.PMMJ)

Aggregations

AppendM (org.apache.sysml.lops.AppendM)6 AppendG (org.apache.sysml.lops.AppendG)4 AppendR (org.apache.sysml.lops.AppendR)4 Lop (org.apache.sysml.lops.Lop)4 Aggregate (org.apache.sysml.lops.Aggregate)2 AppendGAlignedSP (org.apache.sysml.lops.AppendGAlignedSP)2 BinaryM (org.apache.sysml.lops.BinaryM)2 DataPartition (org.apache.sysml.lops.DataPartition)2 Group (org.apache.sysml.lops.Group)2 ExecType (org.apache.sysml.lops.LopProperties.ExecType)2 MapMult (org.apache.sysml.lops.MapMult)2 OutputParameters (org.apache.sysml.lops.OutputParameters)2 PMMJ (org.apache.sysml.lops.PMMJ)2 PartialAggregate (org.apache.sysml.lops.PartialAggregate)2