Skip to content

Commit 9605843

Browse files
committed
Coerce LightGBM models to float32
1 parent 5a363b3 commit 9605843

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

src/cpu_forest_model.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,10 @@ struct ForestModel<rapids::HostMemory> {
5454
try {
5555
result = filex::import_from_treelite_model(
5656
*tl_model_->base_tl_model(), filex::preferred_tree_layout,
57-
filex::index_type{}, std::nullopt,
58-
raft_proto::device_type::cpu);
57+
filex::index_type{}, false, raft_proto::device_type::cpu);
58+
// TODO(hcho3): Throw a warning when coercing a double-precision
59+
// floats to single-precision
60+
// TODO(hcho3): Support inferencing with double-precision floats
5961
rapids::log_info(__FILE__, __LINE__)
6062
<< "Loaded model to new FIL format";
6163
}

src/gpu_forest_model.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,10 @@ struct ForestModel<rapids::DeviceMemory> {
7373
try {
7474
result = filex::import_from_treelite_model(
7575
*tl_model_->base_tl_model(), filex::preferred_tree_layout,
76-
filex::index_type{}, std::nullopt,
77-
raft_proto::device_type::gpu);
76+
filex::index_type{}, false, raft_proto::device_type::gpu);
77+
// TODO(hcho3): Throw a warning when coercing a double-precision
78+
// floats to single-precision
79+
// TODO(hcho3): Support inferencing with double-precision floats
7880
rapids::log_info(__FILE__, __LINE__)
7981
<< "Loaded model to new FIL format";
8082
}

0 commit comments

Comments
 (0)