-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Ansor][AutoTVM v2.0] Phase 1: The base class for cost models #6187
Conversation
9203263
to
e3eb8b3
Compare
e3eb8b3
to
5a49ec7
Compare
Will review Tuesday night |
* \param state_scores The predicted scores for all states | ||
* \param stage_scores The predicted scores for all stages in all stages | ||
*/ | ||
virtual void PredictStages(const SearchTask& task, const std::vector<State>& states, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we still need this part? Since out current search policy only apply cost model on a complete schedule.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is needed by crossover, and it should be useful for future developments IMO.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@merrymercy would that be better to also make this as a virtual function, or setup a flag or something to indicate if this cost model supports PredictStages
or not instead of just throwing an error?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, your suggestion seems to be better.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
* \param state_scores The predicted scores for all states | ||
* \param stage_scores The predicted scores for all stages in all stages | ||
*/ | ||
virtual void PredictStages(const SearchTask& task, const std::vector<State>& states, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@merrymercy would that be better to also make this as a virtual function, or setup a flag or something to indicate if this cost model supports PredictStages
or not instead of just throwing an error?
Disable test if user doesn't have llvm
…#6187) * add the base class for cost models * address comments * Update tests/python/unittest/test_auto_scheduler_cost_model.py Disable test if user doesn't have llvm Co-authored-by: Zhao Wu <[email protected]>
…#6187) * add the base class for cost models * address comments * Update tests/python/unittest/test_auto_scheduler_cost_model.py Disable test if user doesn't have llvm Co-authored-by: Zhao Wu <[email protected]>
…#6187) * add the base class for cost models * address comments * Update tests/python/unittest/test_auto_scheduler_cost_model.py Disable test if user doesn't have llvm Co-authored-by: Zhao Wu <[email protected]>
…#6187) * add the base class for cost models * address comments * Update tests/python/unittest/test_auto_scheduler_cost_model.py Disable test if user doesn't have llvm Co-authored-by: Zhao Wu <[email protected]>
…#6187) * add the base class for cost models * address comments * Update tests/python/unittest/test_auto_scheduler_cost_model.py Disable test if user doesn't have llvm Co-authored-by: Zhao Wu <[email protected]>
…#6187) * add the base class for cost models * address comments * Update tests/python/unittest/test_auto_scheduler_cost_model.py Disable test if user doesn't have llvm Co-authored-by: Zhao Wu <[email protected]>
For the full upstream plan, see Ansor RFC.
This PR adds the base class for cost models and a random cost model.
Because learning-based models typically use python packages (e.g., xgboost, pytorch, tensorflow), we prefer to implement them in python and use the c++ wrapper PythonBasedCostModel for calling them in c++.
The later PR will introduce a cost model based on manual features and xgboost.