Skip to content

Commit

Permalink
Merge pull request #2538 from hcho3/remove_protobuf_dep
Browse files Browse the repository at this point in the history
[DISCUSS] Remove Protobuf dependency
  • Loading branch information
beckernick authored Jul 10, 2020
2 parents 5d6377b + 2fe319d commit 39e1bb2
Show file tree
Hide file tree
Showing 14 changed files with 8 additions and 63 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
- PR #2513: Fixing LGTM Analysis Issues
- PR #2099: Raise an error when float64 data is used with dask RF
- PR #2526: Removing PCA TSQR as a solver due to scalability issues
- PR #2538: Remove Protobuf dependency

## Bug Fixes
- PR #2369: Update RF code to fix set_params memory leak
Expand Down
1 change: 0 additions & 1 deletion ci/mg/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ conda install -c conda-forge -c rapidsai -c rapidsai-nightly -c nvidia \
"lapack" \
"cmake==3.14.3" \
"umap-learn" \
"protobuf>=3.4.1,<4.0.0" \
"nccl>=2.5" \
"dask>=2.12.0" \
"distributed>=2.12.0" \
Expand Down
1 change: 0 additions & 1 deletion conda/environments/cuml_dev_cuda10.0.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ dependencies:
- nccl>=2.5
- libcumlprims=0.15.0a200622
- statsmodels
- protobuf >=3.4.1,<4.0.0
- treelite=0.92
- doxygen
- sphinx
Expand Down
1 change: 0 additions & 1 deletion conda/environments/cuml_dev_cuda10.1.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ dependencies:
- nccl>=2.5
- libcumlprims=0.15.0a200622
- statsmodels
- protobuf >=3.4.1,<4.0.0
- treelite=0.92
- doxygen
- sphinx
Expand Down
1 change: 0 additions & 1 deletion conda/environments/cuml_dev_cuda10.2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ dependencies:
- nccl>=2.5
- libcumlprims=0.15.0a200622
- statsmodels
- protobuf >=3.4.1,<4.0.0
- treelite=0.92
- doxygen
- sphinx
Expand Down
1 change: 0 additions & 1 deletion conda/recipes/cuml/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ requirements:
- setuptools
- cython>=0.29,<0.30
- cmake>=3.14
- protobuf >=3.4.1,<4.0.0
- treelite=0.92
- cudf {{ minor_version }}
- libcuml={{ version }}
Expand Down
1 change: 0 additions & 1 deletion conda/recipes/libcuml/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ requirements:
- ucx-py {{ minor_version }}
- libcumlprims=0.15.0a200622
- lapack
- protobuf >=3.4.1,<4.0.0
- treelite=0.92
run:
- libcumlprims=0.15.0a200622
Expand Down
4 changes: 0 additions & 4 deletions cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -181,9 +181,6 @@ else()
message(STATUS "Manually setting BLAS to ${BLAS_LIBRARIES}")
endif()

set(Protobuf_USE_STATIC_LIBS ON)
find_package(Protobuf REQUIRED)

set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)

##############################################################################
Expand Down Expand Up @@ -316,7 +313,6 @@ set(CUML_PUBLIC_LINK_LIBRARIES
)

set(CUML_PRIVATE_LINK_LIBRARIES
${Protobuf_LIBRARIES}
faisslib
treelite::treelite
treelite::treelite_runtime
Expand Down
39 changes: 0 additions & 39 deletions cpp/cmake/treelite_protobuf.patch

This file was deleted.

6 changes: 3 additions & 3 deletions notebooks/forest_inference_demo.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
"metadata": {},
"source": [
"# Forest Inference Library (FIL)\n",
"The forest inference library is used to load saved forest models of xgboost, lightgbm or protobuf and perform inference on them. It can be used to perform both classification and regression. In this notebook, we'll begin by fitting a model with XGBoost and saving it. We'll then load the saved model into FIL and use it to infer on new data.\n",
"The forest inference library is used to load saved forest models of xgboost, lightgbm and perform inference on them. It can be used to perform both classification and regression. In this notebook, we'll begin by fitting a model with XGBoost and saving it. We'll then load the saved model into FIL and use it to infer on new data.\n",
"\n",
"FIL works in the same way with lightgbm and protobuf model as well.\n",
"FIL works in the same way with lightgbm model as well.\n",
"\n",
"The model accepts both numpy arrays and cuDF dataframes. In order to convert your dataset to cudf format please read the cudf documentation on https://docs.rapids.ai/api/cudf/stable. \n",
"\n",
Expand Down Expand Up @@ -225,7 +225,7 @@
" multiple rows per thread block\n",
" model_type : str\n",
" Format of saved treelite model to load.\n",
" Can be 'xgboost', 'lightgbm', or 'protobuf'"
" Can be 'xgboost', 'lightgbm'"
]
},
{
Expand Down
1 change: 0 additions & 1 deletion python/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ To build cuML's Python package, the following dependencies are required:
- cython >= 0.29, < 0.30
- numpy
- cmake >= 3.14
- protobuf >= 3.4.1, < 4.0.0
- cudf version matching the cuML version
- libcuml version matching the cuML version
- libcuml={{ version }}
Expand Down
2 changes: 1 addition & 1 deletion python/cuml/ensemble/randomforestclassifier.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,7 @@ class RandomForestClassifier(Base, ClassifierMixin):
def _get_serialized_model(self):
"""
Returns the self.treelite_serialized_model.
Cuml RF model gets converted to treelite protobuf bytes by:
Cuml RF model gets converted to treelite bytes by:
1. converting the cuml RF model to a treelite model. The treelite
models handle (pointer) is returned
2. The treelite model handle is converted to bytes.
Expand Down
2 changes: 1 addition & 1 deletion python/cuml/ensemble/randomforestregressor.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@ class RandomForestRegressor(Base, RegressorMixin):
def _get_serialized_model(self):
"""
Returns the self.treelite_serialized_model.
Cuml RF model gets converted to treelite protobuf bytes by:
Cuml RF model gets converted to treelite bytes by:
1. converting the cuml RF model to a treelite model. The treelite
models handle (pointer) is returned
2. The treelite model handle is converted to bytes.
Expand Down
10 changes: 2 additions & 8 deletions python/cuml/fil/fil.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ cdef class TreeliteModel():
Path to treelite model file to load
model_type : string
Type of model: 'xgboost', 'protobuf', or 'lightgbm'
Type of model: 'xgboost', or 'lightgbm'
"""
filename_bytes = filename.encode("UTF-8")
cdef ModelHandle handle
Expand All @@ -134,12 +134,6 @@ cdef class TreeliteModel():
if res < 0:
err = TreeliteGetLastError()
raise RuntimeError("Failed to load %s (%s)" % (filename, err))
elif model_type == "protobuf":
# XXX Not tested
res = TreeliteLoadProtobufModel(filename_bytes, &handle)
if res < 0:
err = TreeliteGetLastError()
raise RuntimeError("Failed to load %s (%s)" % (filename, err))
elif model_type == "lightgbm":
res = TreeliteLoadLightGBMModel(filename_bytes, &handle)
if res < 0:
Expand Down Expand Up @@ -620,7 +614,7 @@ class ForestInference(Base):
See documentation in FIL.load_from_treelite_model
model_type : string (default="xgboost")
Format of the saved treelite model to be load.
It can be 'xgboost', 'lightgbm', or 'protobuf'.
It can be 'xgboost', 'lightgbm'.
Returns
----------
Expand Down

0 comments on commit 39e1bb2

Please sign in to comment.