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

feat: Support gRPC in BentoML API Server #703

Closed
parano opened this issue May 20, 2020 · 9 comments
Closed

feat: Support gRPC in BentoML API Server #703

parano opened this issue May 20, 2020 · 9 comments
Assignees
Labels
feature Feature requests or pull request implementing a new feature
Projects

Comments

@parano
Copy link
Member

parano commented May 20, 2020

Support using gRPC instead of HTTP API for sending prediction requests. When an API model server is deployed as a backend service, many teams prefer using gRPC over HTTP. See related discussion here

One blocker for this is the Asyncio support on gRPC end, it is currently under development https://github.com/grpc/grpc/projects/16

Also for users waiting for this feature, please notice that using gRPC does not necessarily bring better performance - Protobuf is faster when only comparing the data serialization time. But when building a model server, we need to take into consideration the computation required to turn the serialized Protobuf objects into a format that can be used by users' models. In most ML frameworks, a trained model is expecting pandas.DataFrame, np.array, tf.Tensor, or PIL.image:

JSON Request => pandas.DataFrame => Model

Protobuf Msg => Protobuf Object => pandas.DataFrame => Model

And it is this extra step of converting Protobuf message in-memory object into pandas.DataFrame, that is making it less efficient than the JSON/HTTP approach. Although gRPC does bring some edge over REST API due to the use of http/2 and compression.

Thus adding gRPC support is not for better performance, but mostly making it more convenient for teams that are already using gRPC for their backend services.

@parano parano added the roadmap label May 20, 2020
@parano parano added help-wanted An issue currently lacks a contributor feature Feature requests or pull request implementing a new feature and removed roadmap labels Jun 23, 2020
@parano parano added the MLH label Jul 12, 2020
@parano parano removed the MLH label Sep 13, 2020
@yubozhao yubozhao added the MLH label Sep 26, 2020
@parano parano added this to Next major release in Roadmap via automation Nov 26, 2020
@parano parano moved this from Next major release to Mid-Long Term in Roadmap Nov 26, 2020
@stale
Copy link

stale bot commented Dec 25, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Dec 25, 2020
@parano parano removed the stale label Dec 25, 2020
@stale
Copy link

stale bot commented Jun 2, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Jun 2, 2021
@stale stale bot closed this as completed Jun 18, 2021
Roadmap automation moved this from Mid-Long Term to Done Jun 18, 2021
@parano parano reopened this Jun 19, 2021
Roadmap automation moved this from Done to In progress Jun 19, 2021
@stale stale bot removed the stale label Jun 19, 2021
@harshitsinghai77
Copy link

Hey, are we implementing this?

@aarnphm
Copy link
Member

aarnphm commented Jul 18, 2021

Hi @harshitsinghai77, I believe this is P1, and will be addressed after BentoML 1.0

@harshitsinghai77
Copy link

Got it. Let me know if you need me to work on it.

@parano parano removed help-wanted An issue currently lacks a contributor MLH labels Jan 19, 2022
@aarnphm
Copy link
Member

aarnphm commented Jul 5, 2022

Working in progress, per current MLH batch. Current progress can be tracked here at https://github.com/bentoml/BentoML/tree/grpc branch and this PR #2808

@ssheng ssheng assigned ssheng and sauyon and unassigned ssheng Jul 22, 2022
@EricBentoML EricBentoML changed the title Support gRPC in BentoML API Server feat: Support gRPC in BentoML API Server Jul 26, 2022
@aarnphm aarnphm self-assigned this Jul 27, 2022
@aarnphm
Copy link
Member

aarnphm commented Sep 16, 2022

Hi all, I'm happy to say that gRPC support has been merged into main via PR #2808. We will include this in the next release as an experimental feature.

@aarnphm aarnphm closed this as completed Sep 16, 2022
@Bec-k
Copy link

Bec-k commented Sep 7, 2023

gRPC streaming is the way to go next

@aarnphm
Copy link
Member

aarnphm commented Sep 7, 2023

This is tracked on an adjacent ticket #4170

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Feature requests or pull request implementing a new feature
Projects
No open projects
Roadmap
In progress
Development

No branches or pull requests

7 participants