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

[Hotfix] Fix FIL gtest #5755

Merged
merged 1 commit into from
Feb 7, 2024
Merged
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
11 changes: 6 additions & 5 deletions cpp/test/sg/fil_test.cu
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2019-2023, NVIDIA CORPORATION.
* Copyright (c) 2019-2024, 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 @@ -787,6 +787,7 @@ class TreeliteFilTest : public BaseFilTest<real_t> {
case fil::leaf_algo_t::GROVE_PER_CLASS_FEW_CLASSES:
case fil::leaf_algo_t::GROVE_PER_CLASS_MANY_CLASSES: break;
}
builder->EndNode();
} else {
int left = root + 2 * (node - root) + 1;
int right = root + 2 * (node - root) + 2;
Expand All @@ -806,8 +807,6 @@ class TreeliteFilTest : public BaseFilTest<real_t> {
}
}
}
node_to_treelite(builder, root, left);
node_to_treelite(builder, root, right);
// TODO(levsnv): remove workaround once confirmed to work with empty category lists in
// Treelite
if (!right_categories.empty() && dense_node.is_categorical()) {
Expand All @@ -818,8 +817,10 @@ class TreeliteFilTest : public BaseFilTest<real_t> {
adjust_threshold_to_treelite(&threshold, &left, &right, &default_left, this->ps.op);
builder->NumericalTest(dense_node.fid(), threshold, default_left, this->ps.op, left, right);
}
builder->EndNode();
node_to_treelite(builder, root, left);
node_to_treelite(builder, root, right);
}
builder->EndNode();
}

void init_forest_impl(fil::forest_t<real_t>* pforest, fil::storage_type_t storage_type)
Expand Down Expand Up @@ -875,7 +876,7 @@ class TreeliteFilTest : public BaseFilTest<real_t> {
postprocessor_name = "sigmoid";
}
} else if (this->ps.leaf_algo != fil::leaf_algo_t::FLOAT_UNARY_BINARY) {
postprocessor_name = "softmax";
postprocessor_name = "identity_multiclass";
this->ps.output = fil::output_t(this->ps.output | fil::output_t::SOFTMAX);
} else if (this->ps.leaf_algo == GROVE_PER_CLASS) {
postprocessor_name = "identity_multiclass";
Expand Down
Loading