Search in sources :

Example 56 with ExecType

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

the class DataGenOp method optFindExecType.

@Override
protected ExecType optFindExecType() throws HopsException {
    checkAndSetForcedPlatform();
    ExecType REMOTE = OptimizerUtils.isSparkExecutionMode() ? ExecType.SPARK : ExecType.MR;
    if (_etypeForced != null)
        _etype = _etypeForced;
    else {
        if (OptimizerUtils.isMemoryBasedOptLevel()) {
            _etype = findExecTypeByMemEstimate();
        } else if (this.areDimsBelowThreshold() || this.isVector())
            _etype = ExecType.CP;
        else
            _etype = REMOTE;
        //check for valid CP dimensions and matrix size
        checkAndSetInvalidCPDimsAndSize();
    }
    //mark for recompile (forever)
    if (ConfigurationManager.isDynamicRecompilation() && !dimsKnown(true) && _etype == REMOTE)
        setRequiresRecompile();
    //similarly, sample is currently not supported in MR either
    if (_op == DataGenMethod.SINIT)
        _etype = ExecType.CP;
    //workaround until sample supported in MR
    if (_op == DataGenMethod.SAMPLE && _etype == ExecType.MR)
        _etype = ExecType.CP;
    return _etype;
}
Also used : ExecType(org.apache.sysml.lops.LopProperties.ExecType)

Example 57 with ExecType

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

the class IndexingOp method optFindExecType.

@Override
protected ExecType optFindExecType() throws HopsException {
    checkAndSetForcedPlatform();
    ExecType REMOTE = OptimizerUtils.isSparkExecutionMode() ? ExecType.SPARK : ExecType.MR;
    if (_etypeForced != null) {
        _etype = _etypeForced;
    } else {
        if (OptimizerUtils.isMemoryBasedOptLevel()) {
            _etype = findExecTypeByMemEstimate();
        } else if (getInput().get(0).areDimsBelowThreshold()) {
            _etype = ExecType.CP;
        } else {
            _etype = REMOTE;
        }
        //check for valid CP dimensions and matrix size
        checkAndSetInvalidCPDimsAndSize();
    }
    //mark for recompile (forever)
    if (ConfigurationManager.isDynamicRecompilation() && !dimsKnown(true) && _etype == REMOTE)
        setRequiresRecompile();
    return _etype;
}
Also used : ExecType(org.apache.sysml.lops.LopProperties.ExecType)

Example 58 with ExecType

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

the class DataGen method getCPInstruction_SInit.

private String getCPInstruction_SInit(String output) throws LopsException {
    if (method != DataGenMethod.SINIT)
        throw new LopsException("Invalid instruction generation for data generation method " + method);
    //prepare instruction parameters
    Lop iLop = _inputParams.get(DataExpression.RAND_ROWS.toString());
    String rowsString = iLop.prepScalarLabel();
    iLop = _inputParams.get(DataExpression.RAND_COLS.toString());
    String colsString = iLop.prepScalarLabel();
    String rowsInBlockString = String.valueOf(this.getOutputParameters().getRowsInBlock());
    String colsInBlockString = String.valueOf(this.getOutputParameters().getColsInBlock());
    iLop = _inputParams.get(DataExpression.RAND_MIN.toString());
    String minString = iLop.getOutputParameters().getLabel();
    if (iLop.isVariable())
        throw new LopsException(this.printErrorLocation() + "Parameter " + DataExpression.RAND_MIN + " must be a literal for a Rand operation.");
    //generate instruction		
    StringBuilder sb = new StringBuilder();
    ExecType et = getExecType();
    sb.append(et);
    sb.append(Lop.OPERAND_DELIMITOR);
    sb.append(SINIT_OPCODE);
    sb.append(OPERAND_DELIMITOR);
    sb.append(rowsString);
    sb.append(OPERAND_DELIMITOR);
    sb.append(colsString);
    sb.append(OPERAND_DELIMITOR);
    sb.append(rowsInBlockString);
    sb.append(OPERAND_DELIMITOR);
    sb.append(colsInBlockString);
    sb.append(OPERAND_DELIMITOR);
    sb.append(minString);
    sb.append(OPERAND_DELIMITOR);
    sb.append(this.prepOutputOperand(output));
    return sb.toString();
}
Also used : ExecType(org.apache.sysml.lops.LopProperties.ExecType)

Aggregations

ExecType (org.apache.sysml.lops.LopProperties.ExecType)58 Lop (org.apache.sysml.lops.Lop)24 MultiThreadedHop (org.apache.sysml.hops.Hop.MultiThreadedHop)13 Group (org.apache.sysml.lops.Group)12 Aggregate (org.apache.sysml.lops.Aggregate)10 LopsException (org.apache.sysml.lops.LopsException)8 DataPartition (org.apache.sysml.lops.DataPartition)6 SortKeys (org.apache.sysml.lops.SortKeys)6 UnaryCP (org.apache.sysml.lops.UnaryCP)6 CombineUnary (org.apache.sysml.lops.CombineUnary)5 PickByCount (org.apache.sysml.lops.PickByCount)5 ArrayList (java.util.ArrayList)4 CombineBinary (org.apache.sysml.lops.CombineBinary)4 HashMap (java.util.HashMap)3 Data (org.apache.sysml.lops.Data)3 PartialAggregate (org.apache.sysml.lops.PartialAggregate)3 SparkAggType (org.apache.sysml.hops.AggBinaryOp.SparkAggType)2 DataOp (org.apache.sysml.hops.DataOp)2 Hop (org.apache.sysml.hops.Hop)2 OperationTypes (org.apache.sysml.lops.Aggregate.OperationTypes)2