Skip to content
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

[New Integration]: Integration tf-serving #2984

Open
1 task done
rfsiten opened this issue Sep 23, 2022 · 0 comments
Open
1 task done

[New Integration]: Integration tf-serving #2984

rfsiten opened this issue Sep 23, 2022 · 0 comments
Labels
enhancement New feature or request help wanted Extra attention is needed integration New idea for the supported db integrations

Comments

@rfsiten
Copy link
Contributor

rfsiten commented Sep 23, 2022

Is there an existing integration?

  • I have searched the existing integrations.

Use Case

tf-serving (the whole name is tensorflow-serving, the url is https://github.com/tensorflow/serving) is a widely used Deep Model release/publish/inference platform which can provide model-inference function with ideal performace. The ML model generated by several mainly used ML-framework can work on tf-serving, including tensorflow, pytorch, maxnet and so on. (tf-serving, it's also a sub project of the top tensorflow project, I saw #2933 which also mentioned tensorflow, after read it, I think it means the project https://github.com/tensorflow/tensorflow, not including https://github.com/tensorflow/serving, so I think issues/2933 is different with this issue)

After the integration of tf-serving, that provides a query/predict only function, it can work as the usecase below:

register a tf-serving

CREATE PREDICTOR mindsdb.tf_house_price_predictor
PREDICT target
USING
url.predict='http://localhost:8501/v1/models/model_name/predict',
format='tfserving',
dtype_dict={"year": integer, "month": integer, "city_code": integer, "street_code": integer, "target": float};

predict with tf-serving

SELECT hp_tbl.year, hp_tbl.month, hp_tbl.city_code, hp_tbl.street_code, tf_p.target
FROM mindsdb_mysql_proxy.house_price AS hp_tbl
JOIN tf_house_price_predictor AS tf_p
WHERE hp_tbl.year >= 2022 AND hp_tbl.month >= 3

Motivation

tf-serving is a widely used Deep Model release platform which can provide an ideal performance model inference function.
The ML model generated by several mainly used ML-framework can work on tf-serving, including tensorflow, pytorch and so on.

Compare with integrate the tensorflow (https://github.com/tensorflow/tensorflow) framework, integrate tf-serving (https://github.com/tensorflow/serving) first will cost very less time, in fact, tf-serving is a platform for publish/release/inference models.

With mindsdb, people can implement ai features as easy as writing sql, I guess the main audiences of this product could not be the ai-specialists, so a model release platform should be more suitable to implement in the first time. Of crouse, tensorfow (https://github.com/tensorflow/tensorflow) framework is the most popular framework in ai-area, it must be integrated to our mindsdb, but it needs to cost more time, and maybe the using of tf-serving in mindsdb will provide more important experience for integrating tensorflow (https://github.com/tensorflow/tensorflow).

Believe me, to integrate tf-serving, it will be very useful, you will never regret to do such a right decision.

Thank you! ^_^

Implementation

Depend on integrating it as a virtual datasource or only a ml function, there're two ways to implement this funciton:
1 Datasource
Add handler in mindsdb, but only deal with the create and delete and query related sqls, because we only want to support prediction but training. Code path: \mindsdb\integration\handlers\tf_serving_handler

2 ML function
Integrate it in lightwood framework, in path \lightwood\mixer\tf_serving_model.py

Anything else?

In fact, I've read your project code for a few days, your project is very cool, have coverd many kinds of data source and ml-frameworks, here i sincerely to provide a piece of advice, i thought you can design some functions which focusing on providing professional services to some industry, to support its full lifecycle, such as online-shopping, supply-chain-management, etc. Thank you.

@rfsiten rfsiten added enhancement New feature or request integration New idea for the supported db integrations labels Sep 23, 2022
@ZoranPandovski ZoranPandovski added this to Ideas 💡 in ML Frameworks Contest Sep 23, 2022
@torrmal torrmal added the help wanted Extra attention is needed label Jan 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed integration New idea for the supported db integrations
Projects
Community Contributors
Awaiting triage
Development

No branches or pull requests

3 participants