Skip to content
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: XGBoost Cost Model #6270

Merged
merged 6 commits into from
Aug 19, 2020

Conversation

merrymercy
Copy link
Member

@merrymercy merrymercy commented Aug 13, 2020

For the full upstream plan, see Ansor RFC.

This PR adds a xgboost-based cost model.
It is similar to the existing xgboost model in autotvm but works on the more general feature representation introduced by #6190 .

RMSE is used as the loss function, but the general feature representation needs slight modification to the loss function.
To support the new loss function, this PR implements a custom xgboost loss function "pack-sum-RMSE".
It is called "pack-sum" because we combine several samples into a "pack" and sum up their predictions.

@merrymercy merrymercy requested a review from tqchen August 13, 2020 11:46
@merrymercy
Copy link
Member Author

Copy link
Contributor

@comaniac comaniac left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we make the XGBoost cost model as the default cost model?

python/tvm/auto_scheduler/auto_schedule.py Outdated Show resolved Hide resolved
python/tvm/auto_scheduler/cost_model/xgb_model.py Outdated Show resolved Hide resolved
python/tvm/auto_scheduler/cost_model/xgb_model.py Outdated Show resolved Hide resolved
python/tvm/auto_scheduler/cost_model/xgb_model.py Outdated Show resolved Hide resolved
python/tvm/auto_scheduler/cost_model/xgb_model.py Outdated Show resolved Hide resolved
python/tvm/auto_scheduler/cost_model/xgb_model.py Outdated Show resolved Hide resolved
gradient = x - y
hessian = np.ones_like(gradient)

if len(weight) == 0:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if len(weight) == 0:
if not weight:

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

weight is an np.ndarray. We can not use if not weight for an np.ndarray

python/tvm/auto_scheduler/cost_model/xgb_model.py Outdated Show resolved Hide resolved
python/tvm/auto_scheduler/cost_model/xgb_model.py Outdated Show resolved Hide resolved
@merrymercy
Copy link
Member Author

@comaniac @tqchen comments are addressed.

Copy link
Contributor

@comaniac comaniac left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks.

@merrymercy merrymercy merged commit e5b793f into apache:master Aug 19, 2020
@merrymercy merrymercy deleted the pr-xgb-model branch August 19, 2020 00:51
trevor-m pushed a commit to trevor-m/tvm that referenced this pull request Aug 26, 2020
* port xgb cost model

* add xgboost cost model

* fix lint

* address comments

* address comments

* Fix
trevor-m pushed a commit to trevor-m/tvm that referenced this pull request Aug 26, 2020
* port xgb cost model

* add xgboost cost model

* fix lint

* address comments

* address comments

* Fix
trevor-m pushed a commit to trevor-m/tvm that referenced this pull request Aug 26, 2020
* port xgb cost model

* add xgboost cost model

* fix lint

* address comments

* address comments

* Fix
trevor-m pushed a commit to trevor-m/tvm that referenced this pull request Sep 2, 2020
* port xgb cost model

* add xgboost cost model

* fix lint

* address comments

* address comments

* Fix
trevor-m pushed a commit to neo-ai/tvm that referenced this pull request Sep 3, 2020
* port xgb cost model

* add xgboost cost model

* fix lint

* address comments

* address comments

* Fix
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants