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

[FEA] Add predict_proba() to XGBoost-style models in FIL C++ #2894

Merged
merged 61 commits into from
Mar 10, 2021

Conversation

levsnv
Copy link
Contributor

@levsnv levsnv commented Oct 1, 2020

No description provided.

@GPUtester
Copy link
Contributor

Please update the changelog in order to start CI tests.

View the gpuCI docs here.

@levsnv levsnv changed the title [WIP] add predict_proba() to XGBoost-style models in FIL C++ [WIP] add predict_proba() to XGBoost-style models in FIL C++ [skip-ci] Oct 5, 2020
@levsnv levsnv changed the title [WIP] add predict_proba() to XGBoost-style models in FIL C++ [skip-ci] [WIP] add predict_proba() to XGBoost-style models in FIL C++ Oct 8, 2020
cpp/src/fil/fil.cu Outdated Show resolved Hide resolved
cpp/src/fil/fil.cu Outdated Show resolved Hide resolved
cpp/src/fil/infer.cu Outdated Show resolved Hide resolved
cpp/src/fil/infer.cu Outdated Show resolved Hide resolved
cpp/test/sg/fil_test.cu Outdated Show resolved Hide resolved
cpp/src/fil/infer.cu Outdated Show resolved Hide resolved
cpp/src/fil/infer.cu Outdated Show resolved Hide resolved
cpp/src/fil/infer.cu Outdated Show resolved Hide resolved
cpp/src/fil/infer.cu Outdated Show resolved Hide resolved
cpp/src/fil/infer.cu Outdated Show resolved Hide resolved
@levsnv
Copy link
Contributor Author

levsnv commented Oct 8, 2020

To copy the Slack response: I definitely agree that there can be a neat single template for softmax, and I will implement the suggestions above

cpp/src/fil/infer.cu Outdated Show resolved Hide resolved
@levsnv levsnv changed the base branch from branch-0.16 to branch-0.17 October 15, 2020 06:04
@levsnv levsnv requested a review from canonizer October 15, 2020 06:46
@levsnv levsnv added the 4 - Waiting on Reviewer Waiting for reviewer to review or respond label Oct 15, 2020
using BlockReduceHost =
typename cub::BlockReduce<vec<NITEMS, float>, FIL_TPB,
cub::BLOCK_REDUCE_WARP_REDUCTIONS, 1, 1, 600>;
size_t block_reduce_footprint_host() {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was changing half the cases where this was used, as well as deleting the device-side template using statements. This meant the host ones were left alone and did not need to define class separately from footprint. This allowed to implement smem footprint additions for GROVE_PER_CLASS_* in a much more readable way (see below).

cpp/src/fil/fil.cu Outdated Show resolved Hide resolved
cpp/src/fil/fil.cu Outdated Show resolved Hide resolved
cpp/src/fil/infer.cu Outdated Show resolved Hide resolved
cpp/src/fil/infer.cu Outdated Show resolved Hide resolved
cpp/src/fil/infer.cu Outdated Show resolved Hide resolved
cpp/src/fil/infer.cu Outdated Show resolved Hide resolved
cpp/src/fil/infer.cu Outdated Show resolved Hide resolved
cpp/src/fil/infer.cu Outdated Show resolved Hide resolved
cpp/src/fil/infer.cu Outdated Show resolved Hide resolved
cpp/src/fil/infer.cu Outdated Show resolved Hide resolved
@levsnv levsnv added 4 - Waiting on Author Waiting for author to respond to review and removed 4 - Waiting on Reviewer Waiting for reviewer to review or respond labels Oct 16, 2020
@levsnv levsnv changed the title [WIP] add predict_proba() to XGBoost-style models in FIL C++ [REVIEW] add predict_proba() to XGBoost-style models in FIL C++ Oct 16, 2020
@levsnv
Copy link
Contributor Author

levsnv commented Nov 3, 2020

now conflicts with #3088 for combo ML::fil::output_t combo values (but a simple update to resolve merge conflict)

@levsnv levsnv added 4 - Waiting on Author Waiting for author to respond to review and removed 4 - Waiting on Reviewer Waiting for reviewer to review or respond labels Mar 2, 2021
@levsnv
Copy link
Contributor Author

levsnv commented Mar 4, 2021

depends on #3582

# FIL doesn't yet support predict_proba() for multi-class
# TODO: Add a test for predict_proba() when it's supported
gbm_preds = bst.predict(X)
gbm_preds = gbm_preds.argmax(axis=1)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

since lightgbm doesn't support probabilities without the sklearn API, using it here for both predictions

@levsnv levsnv added 3 - Ready for Review Ready for review by team and removed 4 - Waiting on Author Waiting for author to respond to review labels Mar 5, 2021
@levsnv
Copy link
Contributor Author

levsnv commented Mar 5, 2021

rerun tests
./test/ml: symbol lookup error: ./test/ml: undefined symbol: _ZN5faiss3gpu20StandardGpuResources20setCudaMallocWarningEb

@levsnv levsnv added 4 - Waiting on Reviewer Waiting for reviewer to review or respond and removed 3 - Ready for Review Ready for review by team labels Mar 9, 2021
@dantegd
Copy link
Member

dantegd commented Mar 9, 2021

@JohnZed PR looks good to me, ready to merge and has addressed all feedback, when you have a sec could you take a look?

v0.19 Release automation moved this from PR-WIP to PR-Reviewer approved Mar 9, 2021
@JohnZed
Copy link
Contributor

JohnZed commented Mar 9, 2021

@gpucibot merge

@levsnv levsnv added 4 - Waiting on Author Waiting for author to respond to review and removed 4 - Waiting on Reviewer Waiting for reviewer to review or respond 4 - Waiting on Author Waiting for author to respond to review labels Mar 9, 2021
@codecov-io
Copy link

Codecov Report

Merging #2894 (a2eb0a7) into branch-0.19 (fd9ec89) will increase coverage by 0.03%.
The diff coverage is n/a.

Impacted file tree graph

@@               Coverage Diff               @@
##           branch-0.19    #2894      +/-   ##
===============================================
+ Coverage        80.70%   80.74%   +0.03%     
===============================================
  Files              227      227              
  Lines            17615    17737     +122     
===============================================
+ Hits             14217    14322     +105     
- Misses            3398     3415      +17     
Flag Coverage Δ
dask 45.30% <ø> (+0.31%) ⬆️
non-dask 72.89% <ø> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
python/cuml/cluster/kmeans.pyx 91.95% <ø> (ø)
python/cuml/linear_model/linear_regression.pyx 88.23% <0.00%> (-3.53%) ⬇️
...ython/cuml/thirdparty_adapters/sparsefuncs_fast.py 49.70% <0.00%> (-1.81%) ⬇️
python/cuml/common/import_utils.py 58.49% <0.00%> (-0.56%) ⬇️
...cuml/_thirdparty/sklearn/utils/skl_dependencies.py 53.39% <0.00%> (-0.53%) ⬇️
...on/cuml/_thirdparty/sklearn/preprocessing/_data.py 62.88% <0.00%> (-0.23%) ⬇️
...ython/cuml/_thirdparty/sklearn/utils/validation.py 22.37% <0.00%> (-0.08%) ⬇️
python/cuml/dask/solvers/cd.py 100.00% <0.00%> (ø)
python/cuml/common/numba_utils.py 0.00% <0.00%> (ø)
python/cuml/internals/global_settings.py 100.00% <0.00%> (ø)
... and 35 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0967a00...49fc29d. Read the comment docs.

@rapids-bot rapids-bot bot merged commit 8b78fa3 into rapidsai:branch-0.19 Mar 10, 2021
v0.19 Release automation moved this from PR-Reviewer approved to Done Mar 10, 2021
@levsnv levsnv deleted the softmax branch March 10, 2021 04:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Cython / Python Cython or Python issue feature request New feature or request libcuml non-breaking Non-breaking change
Projects
No open projects
v0.19 Release
  
Done
Development

Successfully merging this pull request may close these issues.

None yet

6 participants