Skip to content

Commit

Permalink
Upgrade Treelite to 2.2.1 (#4484)
Browse files Browse the repository at this point in the history
The 2.2.0 version of Treelite incorporates the following major improvements:

* dmlc/treelite#314
* dmlc/treelite#322, dmlc/treelite#327
* dmlc/treelite#325
* dmlc/treelite#332
* dmlc/treelite#330
* dmlc/treelite#333
* dmlc/treelite#334
* dmlc/treelite#304
* dmlc/treelite#335

In particular, dmlc/treelite#332, dmlc/treelite#330, dmlc/treelite#333 are required for #4447.

Requires rapidsai/integration#412.

EDIT. Using 2.2.1 patch release, to incorporate a hotfix (dmlc/treelite#340).

Authors:
  - Philip Hyunsu Cho (https://github.com/hcho3)

Approvers:
  - AJ Schmidt (https://github.com/ajschmidt8)
  - Dante Gama Dessavre (https://github.com/dantegd)

URL: #4484
  • Loading branch information
hcho3 authored Jan 25, 2022
1 parent b9e5537 commit 465e699
Show file tree
Hide file tree
Showing 9 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion ci/gpu/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ gpuci_mamba_retry install -c conda-forge -c rapidsai -c rapidsai-nightly -c nvid
"shap>=0.37,<=0.39"

# https://docs.rapids.ai/maintainers/depmgmt/
# gpuci_mamba_retry remove --force rapids-build-env rapids-notebook-env
# gpuci_conda_retry remove --force rapids-build-env rapids-notebook-env
# gpuci_mamba_retry install -y "your-pkg=1.0.0"

gpuci_logger "Install contextvars if needed"
Expand Down
2 changes: 1 addition & 1 deletion conda/environments/cuml_dev_cuda11.0.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ dependencies:
- faiss-proc=*=cuda
- umap-learn
- scikit-learn=0.24
- treelite=2.1.0
- treelite=2.2.1
- statsmodels
- seaborn
- hdbscan
Expand Down
2 changes: 1 addition & 1 deletion conda/environments/cuml_dev_cuda11.2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ dependencies:
- faiss-proc=*=cuda
- umap-learn
- scikit-learn=0.24
- treelite=2.1.0
- treelite=2.2.1
- statsmodels
- seaborn
- hdbscan
Expand Down
2 changes: 1 addition & 1 deletion conda/environments/cuml_dev_cuda11.4.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ dependencies:
- faiss-proc=*=cuda
- umap-learn
- scikit-learn=0.24
- treelite=2.1.0
- treelite=2.2.1
- statsmodels
- seaborn
- hdbscan
Expand Down
2 changes: 1 addition & 1 deletion conda/environments/cuml_dev_cuda11.5.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ dependencies:
- faiss-proc=*=cuda
- umap-learn
- scikit-learn=0.24
- treelite=2.1.0
- treelite=2.2.1
- statsmodels
- seaborn
- hdbscan
Expand Down
4 changes: 2 additions & 2 deletions conda/recipes/cuml/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ requirements:
- setuptools
- cython>=0.29,<0.30
- cmake>=3.20.1
- treelite=2.1.0
- treelite=2.2.1
- cudf {{ minor_version }}
- libcuml={{ version }}
- libcumlprims {{ minor_version }}
Expand All @@ -45,7 +45,7 @@ requirements:
- libcuml={{ version }}
- libcumlprims {{ minor_version }}
- cupy>=7.8.0,<11.0.0a0
- treelite=2.1.0
- treelite=2.2.1
- nccl>=2.9.9
- ucx-py {{ ucx_py_version }}
- ucx-proc=*=gpu
Expand Down
6 changes: 3 additions & 3 deletions conda/recipes/libcuml/meta.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2018-2021, NVIDIA CORPORATION.
# Copyright (c) 2018-2022, NVIDIA CORPORATION.

# Usage:
# conda build . -c conda-forge -c nvidia -c rapidsai -c pytorch
Expand Down Expand Up @@ -43,7 +43,7 @@ requirements:
- ucx-proc=*=gpu
- libcumlprims {{ minor_version }}
- lapack
- treelite=2.1.0
- treelite=2.2.1
- faiss-proc=*=cuda
- gtest=1.10.0
- gmock
Expand All @@ -55,7 +55,7 @@ requirements:
- ucx-py {{ ucx_py_version }}
- ucx-proc=*=gpu
- {{ pin_compatible('cudatoolkit', max_pin='x', min_pin='x') }}
- treelite=2.1.0
- treelite=2.2.1
- faiss-proc=*=cuda
- libfaiss 1.7.0 *_cuda
- libcusolver>=11.2.1
Expand Down
4 changes: 2 additions & 2 deletions cpp/cmake/thirdparty/get_treelite.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,6 @@ function(find_and_configure_treelite)
rapids_export_find_package_root(BUILD Treelite [=[${CMAKE_CURRENT_LIST_DIR}]=] cuml-exports)
endfunction()

find_and_configure_treelite(VERSION 2.1.0
PINNED_TAG e5248931c62e3807248e0b150e27b2530a510634
find_and_configure_treelite(VERSION 2.2.1
PINNED_TAG 1f9c5054ad7433fa88623fccf0ae46a6ba6a27c6
BUILD_STATIC_LIBS ${CUML_USE_TREELITE_STATIC})
10 changes: 5 additions & 5 deletions python/cuml/test/explainer/test_gpu_treeshap.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2021, NVIDIA CORPORATION.
# Copyright (c) 2021-2022, 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 @@ -59,9 +59,9 @@ def test_xgb_regressor(objective):

ref_explainer = shap.TreeExplainer(model=xgb_model)
correct_out = ref_explainer.shap_values(X)
np.testing.assert_almost_equal(out, correct_out)
np.testing.assert_almost_equal(out, correct_out, decimal=5)
np.testing.assert_almost_equal(explainer.expected_value,
ref_explainer.expected_value)
ref_explainer.expected_value, decimal=5)


@pytest.mark.parametrize('objective,n_classes',
Expand Down Expand Up @@ -102,9 +102,9 @@ def test_xgb_classifier(objective, n_classes):

ref_explainer = shap.TreeExplainer(model=xgb_model)
correct_out = ref_explainer.shap_values(X)
np.testing.assert_almost_equal(out, correct_out)
np.testing.assert_almost_equal(out, correct_out, decimal=5)
np.testing.assert_almost_equal(explainer.expected_value,
ref_explainer.expected_value)
ref_explainer.expected_value, decimal=5)


def test_degenerate_cases():
Expand Down

0 comments on commit 465e699

Please sign in to comment.