-
Notifications
You must be signed in to change notification settings - Fork 102
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
Implementing Rust runtime API #189
Comments
@higumachan Hi, thank you so much for reaching out. I'd love to have a Rust runtime. Unfortunately, the current C API is not yet stable and is about to break soon. Here is why: The current runtime API has turned out to be rather deficient, in that it can only handle model and data with 32-bit floating point values. LightGBM and scikit-learn use 64-bit floating-point values, so in some corner cases Treelite produces wrong results. Related: #155 #153 #115 #98 #95. To make Treelite work, I will have to re-write the runtime API to handle multiple data types. I have been occupied with other priorities so far (I'm a maintainer of XGBoost). Let me make time and design a new runtime API by end of August. #130 was my previous attempt and it failed due to a poor API design. |
@hcho3 |
@higumachan Update: I'm currently working to enable 64-bit floating-point types in #196. The pull request has grown really large, so I plan to break it up and have others review it. Would you be interested in reviewing the new runtime API? |
@hcho3 Sorry, I'm late in replying. |
@higumachan Great! Let me assign you some PRs that will be relevant to the new Rust runtime. |
@higumachan I assign you #199 to review. Thanks for offering to review. |
@higumachan Hi, all the refactored code has now been merged into the mainline branch. You can now start building on it. |
Hi @higumachan @hcho3 I recently come to a project where I need to use lightgbm in Rust. I built https://github.com/dovahcrow/lightgbm-rs and then found this treelite project promising. If any help is needed to build a treelite Rust API binding, I definitely would like to help! I also find there already exists a treelite rust binding on crates.io https://crates.io/crates/treelite, however, there's no document or source code available. I think it would better to involve the author @zhchang here as well. |
yeah, i came across the need to have a treelite rust binding and found no
such thing existing, hence the treelite crate.
The binding source code, including build.rs is pretty self explanatory with
tests.
You need treelite lib 0.93 at link time though.
My approach is:
1. offline compile treelite c lib 0.93
2. ship my binary that links treelite crate as well as the 0.93 c lib
Hope this helps.
…On Fri, Jan 8, 2021 at 12:54 PM Weiyuan Wu ***@***.***> wrote:
Hi @higumachan <https://github.com/higumachan> @hcho3
<https://github.com/hcho3> I recently come to a project where I need to
use lightgbm in Rust. I built https://github.com/dovahcrow/lightgbm-rs
and then found this treelite project promising. If any help is needed to
build a treelite Rust API binding, I definitely would like to help!
I also find there already exists a treelite rust binding on crates.io
https://crates.io/crates/treelite, however, there's no document or source
code available. I think it would better to involve the author @zhchang
<https://github.com/zhchang> here as well.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#189 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AALVAZOV6JUYWQMBJZTNWILSY2FYXANCNFSM4PDIYMYA>
.
--
*Best Regards,*
*Zhao Chang.*
|
I had the runtime partially implemented at https://github.com/dovahcrow/treerite. The CI is failing due to the cmake 3.14 requirement - the rust github action had 3.13. Are there any ways to relax the cmake version requirement? |
@dovahcrow I filed #246 to relax the CMake requirement to 3.13. Can you try it out? |
@hcho3 unfortunately, it failed:
|
@dovahcrow I did not realize that |
@hcho3 thanks! I can confirm cmake works now. However, I got other CI errors originated from my side - I'm working on that. |
@hcho3 Good news, with #246 the CI passed. https://github.com/dovahcrow/treerite/actions/runs/473692895. I noticed that the shared library generated by |
The crate is published here, which binds to the just merged 1.0.0 release. You can use it by adding |
Closed by #247 |
Hi.
I'm thinking of creating a Runtime API for Rust, should I create it as a separate repository or in the
runtime/rust
directory?The text was updated successfully, but these errors were encountered: