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

[Bug] xgboost version conflict #12009

Closed
Sunny-Island opened this issue Jul 5, 2022 · 8 comments
Closed

[Bug] xgboost version conflict #12009

Sunny-Island opened this issue Jul 5, 2022 · 8 comments
Assignees
Labels
tune:auto_scheduler src/auto_scheduler, python/tvm/auto_scheduler type: bug

Comments

@Sunny-Island
Copy link
Contributor

Sunny-Island commented Jul 5, 2022

There are some changes in xgboost callbacks since xgboost 1.6.0. Some class and fucntion have been removed: dmlc/xgboost#7280
TVM still uses xgboost old callback function which has been deprecated since xgboost 1.3.0, which require 1.1.0< xgboost < 1.6.0. This should be decleared in install doc and setup.py. If users install latest xgboost, they will get an error: #11409

I can help upgrade callback function in xgboost cost model, or fix version conflict in doc and setup script. I wish to discuss with community members.

@junrushao
Copy link
Member

CC: @zxybazh

@zxybazh
Copy link
Member

zxybazh commented Jul 8, 2022

Thanks for reporting this issue, I can confirm the old style callback function is currently used in TVM AutoScheduler and MetaSchedule. Users could see warnings about that if they are using a xgboost version later than 1.3.0. There are several steps to take:

Given XGBoost has completely deprecated the old style callback function, I think it's necessary to migrate to new callback function and have tests on that. It would be great if you could help send PRs to update documentation, tutorials & code library. On our side, we'll prioritize the upgrade and keep trace of the progress here.

@zxybazh zxybazh self-assigned this Jul 8, 2022
@Sunny-Island
Copy link
Contributor Author

Thanks for your reply. I'll be appreciated if I can contribute to TVM. You really give me a detailed steps.
And I will work on TVM in the next few days, so Hi everyone in TVM community!

@Sunny-Island
Copy link
Contributor Author

The first PR related to task 1: Publish an XGBoost version notice in doc & set up tutorial.
#12050
@zxybazh

@zxybazh
Copy link
Member

zxybazh commented Jul 11, 2022

Thanks for submitting the first PR! I just sent a couple comments, let me know if you have any questions!

@Sunny-Island
Copy link
Contributor Author

Thanks for submitting the first PR! I just sent a couple comments, let me know if you have any questions!

I am working on upgrading the callback function in AutoScheduler XGBoost Cost Model. I noticed some codes are related with crossfold(cv), but I'm not clear when will the crossfold function be called? When the env.cvfolds will become true?
In latest xgboost code, it seems that crossfold is a dependent function. And deprecated train method will set cvfold=None.
https://github.com/dmlc/xgboost/blob/e7decb9775dae440fd829fd37d1f56c5bcedb138/python-package/xgboost/training.py#L74

Ignore this reply if you are not familiar with this part.

def callback(env):
    """internal function"""
    if not state:
        init(env)

    bst = env.model
    i = env.iteration
    cvfolds = env.cvfolds

    res_dict = {}

    if i % skip_every == 1:
        return

    ##### evaluation #####
    if cvfolds is not None:
        for feval in fevals:
            tmp = aggcv([f.eval(i, feval) for f in cvfolds])
            for k, mean, std in tmp:
                res_dict[k] = [mean, std]
    else:
        for feval in fevals:
            bst_eval = bst.eval_set(evals, i, feval)
            res = [x.split(":") for x in bst_eval.split()]
            for kv in res[1:]:
                res_dict[kv[0]] = [float(kv[1])]

@shingjan
Copy link
Contributor

@Sunny-Island It looks like cvfolds is default to None when using the deprecated callback function in xgboost here.

@Sunny-Island
Copy link
Contributor Author

#12144 The second PR.

@areusch areusch added the needs-triage PRs or issues that need to be investigated by maintainers to find the right assignees to address it label Oct 19, 2022
@driazati driazati added tune:auto_scheduler src/auto_scheduler, python/tvm/auto_scheduler and removed needs-triage PRs or issues that need to be investigated by maintainers to find the right assignees to address it labels Nov 16, 2022
@zxybazh zxybazh closed this as completed Sep 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tune:auto_scheduler src/auto_scheduler, python/tvm/auto_scheduler type: bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants