Xiao-zhen-Liu commented on code in PR #3550:
URL: https://github.com/apache/texera/pull/3550#discussion_r2286867811
##########
core/amber/src/main/scala/edu/uci/ics/amber/engine/architecture/scheduling/CostBasedScheduleGenerator.scala:
##########
@@ -601,16 +589,31 @@ class CostBasedScheduleGenerator(
}
/**
- * The cost function used by the search. Takes a region plan, generates one
or more (to be done in the future)
- * schedules based on the region plan, and calculates the cost of the
schedule(s) using Cost Estimator. Uses the cost
- * of the best schedule (currently only considers one schedule) as the cost
of the region plan.
+ * Takes a region DAG, generates one or more (to be done in the future)
schedules based on the region DAG, allocates
+ * resources to each region in the region DAG, and calculates the cost of
the schedule(s) using Cost Estimator. Uses
+ * the cost of the best schedule (currently only considers one schedule) as
the cost of the region DAG.
*
* @return A cost determined by the cost estimator.
*/
- private def evaluate(regionPlan: RegionPlan): Double = {
+ private def allocateResourcesAndEvaluateCost(
+ regionDAG: DirectedAcyclicGraph[Region, RegionLink]
Review Comment:
`regionDAG` is a jgrapht DAG and is used internally by the search process
and needs to be updated here so that the final search result includes the
resourceConfig.
`regionPlan` is a wrapper class we created for representing regionDAG as the
result of the search process and is currently only used as the input for
generating a schedule.
##########
core/amber/src/main/scala/edu/uci/ics/amber/engine/architecture/scheduling/CostEstimator.scala:
##########
@@ -36,7 +39,15 @@ import scala.util.{Failure, Success, Try}
* A cost estimator should estimate a cost of running a region under the
given resource constraints as units.
*/
trait CostEstimator {
- def estimate(region: Region, resourceUnits: Int): Double
+
+ /**
+ * Uses the given resource units to allocate resources to the region, and
determine a cost based on the allocation.
+ *
+ * Note currently the ResourceAllocator is not cost-based and thus we use a
cost model that does not rely on the
+ * allocator, i.e., the cost estimation process is external to the
ResourceAllocator.
+ * @return An updated region with allocated resources and an estimated cost
of this region.
Review Comment:
Done
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]