Class Enumerator
java.lang.Object
org.apache.sysds.resource.enumeration.Enumerator
- Direct Known Subclasses:
GridBasedEnumerator,InterestBasedEnumerator,PruneBasedEnumerator
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic enumstatic enum -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final doubleTime/Monetary delta for considering optimal solutions as fractionstatic final intA reasonable upper bound for the possible number of executors is required to set limits for the search space and to avoid evaluating cluster configurations that most probably would have too high distribution overheadstatic final int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionestimateRangeExecutors(int driverCores, long executorMemory, int executorCores) Estimates the minimum and maximum number of executors based on given VM instance characteristics, the enumeration strategy and the user-defined configurationsabstract booleanevaluateSingleNodeExecution(long driverMemory, int cores) doubleMeant to be used for testing purposesMeant to be used for testing purposesMeant to be used for testing purposesMeant to be used for testing purposesMeant to be used for testing purposesdoubleMeant to be used for testing purposesdoubleMeant to be used for testing purposesMeant to be used for testing purposesMeant to be used for testing purposesRetrieving the estimated optimal configurations after processing.abstract voidCalled once to enumerate the search space for VM instances for driver or executor nodes.voidCalled once after preprocessing to fill the pool with optimal solutions by parsing the enumerated search space.static voidsetCostsWeightFactor(double newFactor) static voidsetCpuQuota(int newQuotaValue) voidsetDriverSpace(EnumerationUtils.InstanceSearchSpace inputSpace) Meant to be used for testing purposesvoidsetExecutorSpace(EnumerationUtils.InstanceSearchSpace inputSpace) Meant to be used for testing purposesstatic voidsetMinPrice(double maxPrice) static voidsetMinTime(double maxTime) voidupdateOptimalSolution(double newTimeEstimate, double newMonetaryEstimate, EnumerationUtils.ConfigurationPoint newPoint) Invokes the estimation of the time and monetary cost based on the compiled program and the given cluster configurations.
-
Field Details
-
DEFAULT_MIN_EXECUTORS
public static final int DEFAULT_MIN_EXECUTORS- See Also:
-
DEFAULT_MAX_EXECUTORS
public static final int DEFAULT_MAX_EXECUTORSA reasonable upper bound for the possible number of executors is required to set limits for the search space and to avoid evaluating cluster configurations that most probably would have too high distribution overhead- See Also:
-
COST_DELTA_FRACTION
public static final double COST_DELTA_FRACTIONTime/Monetary delta for considering optimal solutions as fraction- See Also:
-
-
Constructor Details
-
Enumerator
-
-
Method Details
-
setCostsWeightFactor
public static void setCostsWeightFactor(double newFactor) -
setMinTime
public static void setMinTime(double maxTime) -
setMinPrice
public static void setMinPrice(double maxPrice) -
setCpuQuota
public static void setCpuQuota(int newQuotaValue) -
preprocessing
public abstract void preprocessing()Called once to enumerate the search space for VM instances for driver or executor nodes. These instances are being represented as -
processing
public void processing()Called once after preprocessing to fill the pool with optimal solutions by parsing the enumerated search space. Within its execution the number of potential executor nodes is being estimated (enumerated) dynamically for each parsed executor instance. -
postprocessing
Retrieving the estimated optimal configurations after processing.- Returns:
- optimal cluster configuration and corresponding costs
-
evaluateSingleNodeExecution
public abstract boolean evaluateSingleNodeExecution(long driverMemory, int cores) -
estimateRangeExecutors
public abstract ArrayList<Integer> estimateRangeExecutors(int driverCores, long executorMemory, int executorCores) Estimates the minimum and maximum number of executors based on given VM instance characteristics, the enumeration strategy and the user-defined configurations- Parameters:
driverCores- CPU cores for the currently evaluated driver nodeexecutorMemory- memory of currently evaluated executor nodeexecutorCores- CPU cores of currently evaluated executor node- Returns:
- - [min, max]
-
updateOptimalSolution
public void updateOptimalSolution(double newTimeEstimate, double newMonetaryEstimate, EnumerationUtils.ConfigurationPoint newPoint) Invokes the estimation of the time and monetary cost based on the compiled program and the given cluster configurations. Following the optimization strategy, the given current optimal solution and the new cost estimation, it decides if the given cluster configuration can be potential optimal solution having lower cost or such a cost that is negligibly higher than the current lowest one.- Parameters:
newTimeEstimate- estimated time cost for the given configurationsnewMonetaryEstimate- estimated monetary cost for the given configurationsnewPoint- new cluster configuration for estimation
-
getInstances
Meant to be used for testing purposes- Returns:
- the available instances for enumeration
-
getDriverSpace
Meant to be used for testing purposes- Returns:
- the object representing the driver search space
-
setDriverSpace
Meant to be used for testing purposes- Parameters:
inputSpace- the object representing the driver search space
-
getExecutorSpace
Meant to be used for testing purposes- Returns:
- the object representing the executor search space
-
setExecutorSpace
Meant to be used for testing purposes- Parameters:
inputSpace- the object representing the executor search space
-
getEnumStrategy
Meant to be used for testing purposes- Returns:
- applied enumeration strategy
-
getOptStrategy
Meant to be used for testing purposes- Returns:
- applied optimization strategy
-
getCostsWeightFactor
public double getCostsWeightFactor()Meant to be used for testing purposes- Returns:
- configured weight factor optimization function 'costs'
-
getMaxTime
public double getMaxTime()Meant to be used for testing purposes- Returns:
- configured max time for consideration (seconds)
-
getMaxPrice
public double getMaxPrice()Meant to be used for testing purposes- Returns:
- configured max price for consideration (dollars)
-
getOptimalSolution
Meant to be used for testing purposes- Returns:
- current optimal solution
-