-
Notifications
You must be signed in to change notification settings - Fork 52
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
Decision forests prediction question #19
Comments
User came to #python on the Libera.chat IRC network for help with this issue, and after a good bit of investigation, we discovered that this failure is caused by the OpenBLAS warning emitted when importing numpy. This warning is benign and the include path is still correctly reported, but TF's bazel configuration treats it as a fatal error. I have reported this as an upstream bug, see tensorflow/tensorflow#56346 Users who want to patch around this problem will need to pass |
@SnoopJeDi thanks again. I installed bazel version 4.0.0 - now the build works fine. the fix @SnoopJeDi mentioned is still needed. |
Hi, regarding your first question: I'm not familiar with the project you linked, but it sounds like it is not compatible with TF custom ops and will therefore not work with YDF/TF-DF at this time. If you have interesting use cases not covered by our current APIs, please let us know, so we might consider them for future releases! |
@rstz im interested if there is a way to call model prediction from Golang - any idea if thats possible and it might be ago and calling c or c++? I would like to get more infos about it.
are this custom ops difficult to add? is there more documentation on it? also, is there even a way to call decision forests with C_API? |
hi @Arnold1 , for the inference in Golang, let's follow on issue #115. Hopefully we can have a native impelementation (albeit not complete) not too far in the future. About galeone/tfgo: indeed there needs to be a way of linking the TF Custom Ops. I would guess (but not sure) there should be a way, one could use the compiled custom ops from TF-DF's PyPI (pip) packages -- but I have no idea of how to have them loaded. Maybe ask in the Tensorflow Forum ? |
Btw, the official TensorFlow Go API has the One has just to be careful to use the pre-built TF library and prebuilt TF-DF custom ops on the same version. Taking the most recent theoretically would work -- but I haven't tried it. |
@janpfeifer attached an example in C - looks good from the logs? How to convert that code to Go? for Go I also need the tf .so? the TF_SessionRun call gives me segmentation fault - any idea what I do wrong? im not sure if I define input and output tensors correctly...
here the output of the program:
model is from here btw: https://github.com/tensorflow/decision-forests/blob/main/examples/minimal.py
the example above is based on: https://discuss.tensorflow.org/t/decision-forests-issue-with-c-api/7434 |
@janpfeifer I assume using the golang api will run much inference slower than the yggdrasil-decision-forests c++ code? |
hey @Arnold1 sorry I missed the thread, I was out on vacation. The pure Go API we want to open source here will be slower than the C++ version -- it was just a straight forward re-implementation. Still it's pretty fast -- in our use case the generation of the features was way more expensive than the inference itself. If this turns out to be a limiting factor (let us know what the size of your forests/time constraint), consider: (A) Using cgo and link the c++ inference from Yggdrasil Decision Forests (not the Tensorflow one, since it adds some overhead, plus lots of memory). Consider benchmarking the C++ inference (again Yggdrasil Decision Forest) time before going there, but our C++ inference is one of the fastest implementations out there (maybe the fastest under certain constraints?); (B) Re-implementing our C++ optimized engines in Go. There will be some challenges -- locality of memory played a huge role -- but probably super fun project :) On your C++ implementation: it's been a while I used the tensorflow C API, but it seems correct. That's the tensorflow API, as opposed to Yggdrasil, which is simpler. |
hi all, Took a while, but we just released a YDF (and TF-DF) inference API in Go. It's fresh from the oven, so we consider it beta. But internally it has already been used successfully. Also it doesn't support all types of models yet, but should be easier now to add any model type. If you see the need just ping us. |
@janpfeifer amazing! I currently wrote some code to load/serve the model with tensor flow... I can just use this lib to load the model and do the inferencing with that lib and expect to be faster? how is that related to python? will I need python installed?
do you currently support tfdf.keras.RandomForestModel() models? I currently use that... |
No need for Python. I mean you can train the model in Python+TensorFlow (or with Yggdrasil command line tool). But after that this is pure Go inference engine. Ugh, no, we haven't implemented RandomForestModel yet -- our internal use case was GradientBoostedTrees. Let me take a stab a it, I'll post back in a bit. |
we train the model in python and serve it in go.
@janpfeifer ok waiting for RandomForestModel code :) amazing thanks! |
hi @janpfeifer would like to check for an update on it - do you think you have time in the next 1-2 weeks to add support for RandomForestModel? |
I think we never give timelines, but I can confidently say that what we have looks very good :) (answering for jan, I'm also a member of the team) |
@rstz yeah I know.... just wanted to check back :) @janpfeifer amazing! |
Good news: e03e98d just landed with support for
This is still very fresh (no guarantees it won't be rolled back or changed or ...) but feel free to have a look and tell us what you think |
awesome - im also intersted to test it. |
@rstz is there also support for Multiclass classification with decision trees? it looks like its in the repo - I have a use case for Multiclass classification - could you also add support for go? |
Hi, multiclass support is not available in the Go port of YDF yet. |
@rstz could I run it with tensorflow and special ops (inference.so) in the meantime and switch over later when go port is ready? |
Hi,
Is the generated Yggdrasil decision forests model the same format as other tf models?
Could I use https://github.com/galeone/tfgo and call predict from a golang app?
I run into an issue with bazel when building the standalone example - any idea what could be the issue?
Here is how I install bazel: https://docs.bazel.build/versions/main/install-ubuntu.html#19
how to fix the issue:
disable this line: https://github.com/google/yggdrasil-decision-forests/blob/main/.bazelrc#L43
but than I got his error:
my dockerfile (to reproduce the hazel error):
cc @achoum
The text was updated successfully, but these errors were encountered: