yggdrasil-decision-forests icon indicating copy to clipboard operation
yggdrasil-decision-forests copied to clipboard

added model_server example

Open geraldstanje opened this issue 2 years ago • 4 comments

hi @achoum here is a pr with a model server example:

  • provides a docker container
  • trains the model
  • starts a http server and serves the model
  • caches the model serving data for a used model

could you please give me a code review and could we merge that example? what code formatting tool and style do you use?

geraldstanje avatar Jul 04 '22 01:07 geraldstanje

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

google-cla[bot] avatar Jul 04 '22 01:07 google-cla[bot]

Hi @geraldstanje,

This looks awesome, and I would like to have it submitted :).

However, before that, I think there is few design choices that could be brainstormed about. For example, how to efficiently serialize examples, can the binary serve multiple models, how to transition between models, basic security concerns, computation distribution, network io, etc.

It would also be interesting to see if this could be used by @Arnold1 (see https://github.com/google/yggdrasil-decision-forests/issues/22).

If you are interested, I'll create a new discussion for us to design this solution (partially based on your work). This could be the first public design doc for Yggdrasil decision forests :).

achoum avatar Jul 04 '22 16:07 achoum

Hi @achoum

thanks for the feedback - we can iterate on it in multiple pr's?

I have not spend time to optimize the serialize/deserialize part using GRPC for example. I would like to see if loading the model from s3 or an api would be possible without storing the model on a local disk.

Also what is the correct way to integrate 3rd party libs (which are not a bazel project) for the example directory using bazel? as far i understand - the /third_party folder is only for building the yggdrasil_decision_forests library itself?

geraldstanje avatar Jul 04 '22 16:07 geraldstanje

Hi,

Yes, such work should be done in multiple PRs. However, this one is probably not one of them as the final project might be implemented very differently.

While this is not trivial work, we can work together both in the design and the implementation.

Regarding your model serialization question, there are different options to explore. For example, we would simply serialize a model into a blog of bytes (and store/share it anyway we want). Alternatively, we would create an implementation of the filesystem that is compatible with AWS (if it is not already the case). Let's discuss those ideas in a design doc.

achoum avatar Jul 05 '22 19:07 achoum