In the paper “Learning to Optimize Tensor Programs”, the submodular function defined as:
But why in model_based_tuner.py, the first parameter of submodular_pick is 0 * scores? Does it mean the submodular function only has the second item?
I’m a little confused about that … @merrymercy Could you help me? thanks!
Here is the code:
apache/incubator-tvm/blob/master/python/tvm/autotvm/tuner/model_based_tuner.py
# if we have enough new training samples
if len(self.xs) >= self.plan_size * (self.train_ct + 1) \
and self.flops_max > 1e-6:
self.cost_model.fit(self.xs, self.ys, self.plan_size)
if self.diversity_filter_ratio:
candidate = self.model_optimizer.find_maximums(
self.cost_model, self.plan_size * self.diversity_filter_ratio, self.visited)
scores = self.cost_model.predict(candidate)
knobs = [point2knob(x, self.dims) for x in candidate]
pick_index = submodular_pick(0 * scores, knobs, self.plan_size, knob_weight=1)
maximums = np.array(candidate)[pick_index]
else:
maximums = self.model_optimizer.find_maximums(
self.cost_model, self.plan_size, self.visited)