1 #ifndef DEFAULT_COST_MODEL_H
2 #define DEFAULT_COST_MODEL_H
11 class DefaultCostModel :
public CostModel {
13 Internal::Weights weights;
14 Runtime::Buffer<float> schedule_feat_queue, pipeline_feat_queue, costs, costs_per_stage;
15 Runtime::Buffer<double *> cost_ptrs;
16 std::vector<std::vector<double> *> cost_per_stage_ptrs;
17 int cursor, num_stages, num_cores;
20 const std::string weights_in_path, weights_out_path;
21 const bool randomize_weights;
23 Runtime::Buffer<float>
24 head1_filter_update, head1_bias_update,
25 head2_filter_update, head2_bias_update,
26 conv1_filter_update, conv1_bias_update;
29 Internal::Autoscheduler::Statistics &stats;
33 const std::string &weights_out_path,
34 bool randomize_weights,
36 : weights_in_path(weights_in_path),
37 weights_out_path(weights_out_path),
38 randomize_weights(randomize_weights),
45 const Internal::Autoscheduler::Anderson2021Params ¶ms)
override;
50 void enqueue(
const Internal::Autoscheduler::FunctionDAG &dag,
53 std::vector<double> *cost_per_stage_ptr)
override;
54 void enqueue(
int ns, Runtime::Buffer<float> *schedule_feats,
double *cost_ptr, std::vector<double> *cost_per_stage_ptr);
60 void reset()
override;
63 float backprop(
const Runtime::Buffer<const float> &true_runtimes,
float learning_rate);
71 const std::string &weights_in_dir =
"",
72 const std::string &weights_out_dir =
"",
73 bool randomize_weights =
false);
76 #endif // DEFAULT_COST_MODEL_H