I want to test how the different auto schedulers work. I know there are 3 different auto schedulers: "Mullapudi2016" (the default auto scheduler), "Adams2019", and "Li2018". "Adams2019" is located in apps/autoscheduler (https://github.com/halide/Halide) and "Li2018" is located in gradient_autoscheduler. But how can I use one on a concrete pipeline (e.g. harris)? I tried to add a new map in Pipeline.cpp, like the following:
std::map<std::string, AutoSchedulerFn> &Pipeline::get_autoscheduler_map() {
static std::map<std::string, AutoSchedulerFn> autoschedulers = {
{ "Mullapudi2016", auto_schedule_Mullapudi2016 },
{ "Admas2019", auto_schedule_Adams2019 }
};
return autoschedulers;
}
The definition of "auto_schedule_Adams2019" is similar to the "auto_schedule_Mullapudi2016", but just changes "generate_schedules" to "generate_schedule", which is already defined in "apps/autoscheduler/AutoSchedule.cpp"
void Pipeline::auto_schedule_Mullapudi2016(Pipeline pipeline, const Target &target,
const MachineParams &arch_params, AutoSchedulerResults *outputs) {
AutoSchedulerResults results;
results.target = target;
results.machine_params_string = arch_params.to_string();
user_assert(target.arch == Target::X86 || target.arch == Target::ARM ||
target.arch == Target::POWERPC || target.arch == Target::MIPS)
<< "The Mullapudi2016 autoscheduler is currently supported only on these architectures." << (int)target.arch;
results.scheduler_name = "Mullapudi2016";
results.schedule_source = generate_schedules(pipeline.contents->outputs, target, arch_params);
// this autoscheduler has no featurization
*outputs = results;
}
void Pipeline::auto_schedule_Adams2019(Pipeline pipeline, const Target &target,
const MachineParams &arch_params, AutoSchedulerResults *outputs) {
AutoSchedulerResults results;
results.target = target;
results.machine_params_string = arch_params.to_string();
user_assert(target.arch == Target::X86 || target.arch == Target::ARM ||
target.arch == Target::POWERPC || target.arch == Target::MIPS)
<< "The Mullapudi2016 autoscheduler is currently supported only on these architectures." << (int)target.arch;
results.scheduler_name = "Adams2019";
results.schedule_source = generate_schedule(pipeline.contents->outputs, target, arch_params);
// this autoscheduler has no featurization
*outputs = results;
}
Ideally, when I call auto_schedule in harris, I just need to give a scheduler name. But how can I connect the project "harris" with the auto scheduler "Adams2019" in "apps/autoscheduler"? I think that I need "auto_schedule.dll", which is compiled by the auto_schedule.
But unfortunately I don't know how to connect it to my project. Does someone have the same problem, or does someone know how to use the different auto schedulers?