Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/model_loader/detail/xgboost_json/delegated_handler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -518,6 +518,8 @@ bool GBTreeModelHandler::StartArray() {
return (push_key_handler<RegTreeArrayHandler, std::vector<ParsedRegTreeParams>>(
"trees", reg_tree_params, *output.builder)
|| push_key_handler<ArrayHandler<int>, std::vector<int>>("tree_info", output.tree_info)
|| push_key_handler<ArrayHandler<float>, std::vector<float>>(
"weight_drop", output.weight_drop)
|| push_key_handler<IgnoreHandler>("iteration_indptr"));
}

Expand Down Expand Up @@ -546,7 +548,7 @@ bool GBTreeModelHandler::EndObject() {
}

bool GBTreeModelHandler::is_recognized_key(std::string const& key) {
return key == "trees" || key == "tree_info" || key == "gbtree_model_param"
return key == "trees" || key == "tree_info" || key == "gbtree_model_param" || key == "weight_drop"
|| key == "iteration_indptr" || key == "cats";
}

Expand Down Expand Up @@ -710,7 +712,7 @@ bool GradientBoosterHandler::StartArray() {
}

bool GradientBoosterHandler::EndObject() {
if (name == "dart" && !weight_drop.empty()) {

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

XGBoost 3.3 no longer specifies a separate "dart" booster type for DART.

if (!weight_drop.empty()) {
TREELITE_CHECK_EQ(output.size_leaf_vector, 1)
<< "Dart with vector-leaf output is not yet supported";
output.weight_drop = weight_drop;
Expand Down
1 change: 0 additions & 1 deletion tests/python/test_xgboost_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,6 @@ def test_xgb_nonlinear_objective(
num_boost_round=integers(min_value=5, max_value=20),
)
@settings(**standard_settings())
@pytest.mark.xfail(reason="https://github.com/dmlc/treelite/issues/668")
def test_xgb_dart(dataset, model_format, num_boost_round):
# pylint: disable=too-many-locals
"""Test XGBoost DART model with dummy data"""
Expand Down
Loading