You may imagine the cost model as a scoring function, which assigns a score to each schedule candidate in the space of all possible schedulings of a TensorIR PrimFunc, to assist the search algorithm to explore the space more efficiently and effectively.
First, letās consider a case where the scheduling space (or sometimes we say design space of schedules interchangably) is extremely small. In this case, the search algorithm could simply exhaustively enumerate every single point (every schedule) in the space, and there is no need to have a scoring function
Things get interesting then when the space gets larger, say for conv variants, the space could be even larger than 10^18, where exhaustive search becomes immediately infeasible. In this case, the search algorithm needs to be āsmart enoughā to find out the optimal point in the space.
Next, how will we make the search algorithm smart though? Imagine we hypothetically have an oracle that gives the accurate running time of each candidate in the design space, then by parallelizing the search algorithm, it becomes possible that it explores a significant portion of the space to find out the approximately optimal candidate.
Realistically, however, an oracle doesnāt exist for sure, so here comes our learned cost model. It gives a relative running time (or normalized throughput, to be more accurate) based on existing data obtained throughout the search.
You may also refer to the paper of our latest generation tuning system, MetaSchedule, for details about what the search space realistically looks like: [2205.13603] Tensor Program Optimization with Probabilistic Programs. The evolutionary search as an algorithm is also described in the paper, but I suppose itās not too different compared with ordinary evolutionary search.