-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
Fast single row predict API v2 #3268
Fast single row predict API v2 #3268
Conversation
@imatiach-msft @StrikerRUS @guolinke please review, it is now even faster by the latest tests. It could be slightly faster if we used a fixed address for the input prediction data instance, but @imatiach-msft needs a dynamic one, so I left the code like this as the extra speedup was not that large. Thank you for waiting for the patch and good luck with the v3 release! ;) |
c0b19cd
to
c5e59ea
Compare
I'm confused by |
For the non pointer arguments (and non reference$), I think we can unify them to the non constant types. |
…F/LightGBM into fast-single-row-predict-api-v2
@StrikerRUS good catch! I had const mismatches even between the .c and .h in the function signatures which made things extremely weird. @guolinke I put instead everything const just because many were lacking const when they could be. Now I think it's really easy to interpret from the user's viewpoint. Only the input booster - which will be modified - and output pointers, are non-const. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@AlbertoEAF Thanks a lot! I think with all const
it looks much better.
@guolinke do you think it's ready to merge? Thank you |
Yeah, looks good to me |
This pull request has been automatically locked since there has not been any recent activity since it was closed. To start a new related discussion, open a new issue at https://github.com/microsoft/LightGBM/issues including a reference to this. |
The latest single-thread benchmark with a model of 42 numerical features achieved a speedup 1.30x-1.85x vs the standard single row prediction API)