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

Remap BATCH_TREE_REORG to TREE_REORG in FIL #6161

Open
wants to merge 7 commits into
base: branch-25.02
Choose a base branch
from
Open
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
10 changes: 9 additions & 1 deletion cpp/src/fil/fil.cu
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2019-2024, NVIDIA CORPORATION.
* Copyright (c) 2019-2025, NVIDIA CORPORATION.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -391,6 +391,14 @@ struct dense_forest<dense_node<real_t>> : forest<real_t> {
{
this->init_common(h, cat_sets, vector_leaf, params);
if (this->algo_ == algo_t::NAIVE) this->algo_ = algo_t::BATCH_TREE_REORG;
/* The following line is added to disable BATCH_TREE_REORG mode. Currently
* there is a bug in the implementation of this mode which causes a batch
* of trees to be marked as complete before every tree has reached a leaf
* node. At best, this results in a crash due to a bad memory access, but
* it can also silently impact the final output of the model. No issue has
* been logged for this workaround because we will be migrating to the new
* FIL codebase which is not impacted by this bug. */
if (this->algo_ == algo_t::BATCH_TREE_REORG) { this->algo_ = algo_t::TREE_REORG; }

int num_nodes = forest_num_nodes(this->num_trees_, this->depth_);
nodes_.resize(num_nodes, h.get_stream());
Expand Down
4 changes: 2 additions & 2 deletions python/cuml/cuml/benchmark/bench_helper_funcs.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2019-2024, NVIDIA CORPORATION.
# Copyright (c) 2019-2025, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -142,7 +142,7 @@ def _build_fil_classifier(m, data, args, tmpdir):
num_rounds = args["num_rounds"]
n_feature = data[0].shape[1]
train_size = data[0].shape[0]
model_name = f"xgb_{max_depth}_{num_rounds}_{n_feature}_{train_size}.model"
model_name = f"xgb_{max_depth}_{num_rounds}_{n_feature}_{train_size}.ubj"
model_path = os.path.join(tmpdir, model_name)
bst = xgb.train(params, dtrain, num_rounds)
bst.save_model(model_path)
Expand Down
Loading