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

[REVIEW] Handle C++ exception thrown from FIL predict #3061

Merged
merged 5 commits into from
Oct 29, 2020

Conversation

hcho3
Copy link
Contributor

@hcho3 hcho3 commented Oct 26, 2020

Currently, attempting to use predict_proba() with a multi-class classifier will result into a segfault, because a C++ exception is not properly handled in the Python layer.

Use except + construct in Cython to convert C++ exceptions from the predict() function of FIL into Python exceptions.

@hcho3 hcho3 requested a review from a team as a code owner October 26, 2020 23:09
@GPUtester
Copy link
Contributor

Please update the changelog in order to start CI tests.

View the gpuCI docs here.

@hcho3 hcho3 requested review from canonizer, wphicks and levsnv October 26, 2020 23:11
Copy link
Contributor

@levsnv levsnv left a comment

Choose a reason for hiding this comment

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

looks good! what will happen once #2894 is merged and it stops throwing the exception? Will you need to fully revert it? (does not sound like a problem per se, just wondering)

@hcho3
Copy link
Contributor Author

hcho3 commented Oct 27, 2020

@levsnv No, we just need to remove the unit test test_cpp_exception. I think we should keep except +, unless it leads to big overhead.

@hcho3
Copy link
Contributor Author

hcho3 commented Oct 27, 2020

Personally, I am paranoid about letting a C++ exception escape the language boundary, because it leads to segfault. In XGBoost, we catch every single C++ exception and convert it to Python exceptions.

@hcho3 hcho3 changed the title Handle C++ exception thrown from FIL predict [REVIEW] Handle C++ exception thrown from FIL predict Oct 28, 2020
@codecov-io
Copy link

codecov-io commented Oct 29, 2020

Codecov Report

Merging #3061 into branch-0.17 will increase coverage by 0.01%.
The diff coverage is n/a.

Impacted file tree graph

@@               Coverage Diff               @@
##           branch-0.17    #3061      +/-   ##
===============================================
+ Coverage        59.22%   59.23%   +0.01%     
===============================================
  Files              142      142              
  Lines             8966     8966              
===============================================
+ Hits              5310     5311       +1     
+ Misses            3656     3655       -1     
Impacted Files Coverage Δ
...l/_thirdparty/sklearn/preprocessing/_imputation.py 62.50% <0.00%> (+0.40%) ⬆️

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 bb2e608...448d844. Read the comment docs.

@dantegd dantegd added the 5 - Ready to Merge Testing and reviews complete, ready to merge label Oct 29, 2020
@dantegd dantegd merged commit 3fa3cdf into rapidsai:branch-0.17 Oct 29, 2020
@hcho3 hcho3 deleted the catch_fil_exception branch October 30, 2020 00:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
5 - Ready to Merge Testing and reviews complete, ready to merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants