Closed conradkun closed 11 months ago
hi @conradkun , let me try to answer it:
1 and 3. We don't have such a conversion tool, but likely it could be doable. Now ... I wouldn't expect necessarily much gain, since decision forests (DF) inference (and learning) generally don't require any matrix multiplication, and the parallelization is trivial. Still, often accelerators have faster memory bandwidth, so maybe ... but not a gain like what one gets with NN.
Have you tried Yggdrasil Decision Forests, or YDF, for inference ? It is the underlying pure C++ implementation (TF-DF uses it) and inference using it are already superfast: in some of our use cases, they run on 100s of nanoseconds per inference on a normal intel cpu (on a model with ~70 trees), likely faster on a Mac M1/M2. Notice TF-DF models will work out-of-the-box in YDF, no conversion needed.
Let me know if that helps, or if you have any other questions.
cheers
I'd be interested to learn what performance you ultimately want to achieve for (roughly) which types of model. Feel free to post here or drop an email to the team.
Hi, and thank you both for your helpful and quick replies.
I'm not sure about how much I am allowed to publicly say, since this is industry related, but I may drop you an email if we decide it's worth pursuing; unfortunately, I assume the ANE is optimized mostly for NNs (although they do have support for tree ensembles from XGBoost and sci-kit), so there is a considerable chance it won't be much.
On a personal note, I may be interested in volunteering to implement the conversion; seems like a fun exercise. I will try to familiarize myself better with both ydf and coremltools, and I'll contact you if I think I have the time and understanding to do it.
Hi, that's great, we'd be very happy to help you and give pointers!
Some initial pointers to start with:
Closing this but feel free to reopen if there's additional questions.
Hi,
I have been playing around with this library on my Mac and had some questions regarding performance:
random_forest_model_1/16566
, but changing across runs).Thank you!