-
Notifications
You must be signed in to change notification settings - Fork 800
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: separate and optimize async and sync clients #4116
Conversation
c14b693
to
46e8dd5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For backwards compatibility, the client implementations will have to retain the sync/async methods; perhaps the default client could instantiate a sync / async client?
1fd8efa
to
34940ff
Compare
@sauyon The latest changes should maintain backwards compatibility. Is this sort of a solution acceptable? If so I'll push forwards with getting the tests passing and perhaps also look at splitting the tests up by sync and async implementation. |
45c29c8
to
e916f29
Compare
5077691
to
5b3eefa
Compare
I think that this PR has gotten a bit muddled. This is something which I am keen to address as at the moment I think the client implementations are quite poor. However, I may take another stab at this later understanding more about all the various moving parts. There seems to be a lot which needs changes to:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few things that I think need changing. Haven't reviewed the async client code entirely carefully yet.
@aarnphm can you help review the grpc client?
I think apart from the IO descriptor change we should get this in, then probably circle back after we rework those.
Yep. Somewhat related, there was at one point an issue where connections were being dropped and we were running into strange errors when we reused a connection which we haven't gotten to the bottom of, which I probably could have added a comment for, but we really need to figure that out.
We probably need to think more carefully about this one in general; a lot of our dependencies are only required for servers / only required for clients, etc. @parano @bojiang something to think about, I think. |
cc85ea2
to
27f5279
Compare
FWIW I think we can separate out a |
Agreed. I also wonder if the serialization/deserialization logic should live in a separate package (given that both the client and server will want to depend on it). This is something a lot of Rust projects do very very well (see I believe PDM might even be able to cope with this setup in Python? https://pdm.fming.dev/latest/usage/advanced/#use-pdm-to-manage-a-monorepo |
this will be added to bentoml-core 🎉 |
@ssheng do you think it is good to refactor our repo into monorepo architecture now? Maybe good to also separate SDK and CLI as well as client We might also want to think about bentoml-core development 🤔 |
I don't know that it needs to be a monorepo. |
Would it be ok if I took this one over so we can get it in while we work on the rework? |
100% - sorry for letting this one lag. Various demands on time etc etc etc - same as everyone else 🤣 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am mostly fine with it.
9dd5261
to
943982c
Compare
943982c
to
25c5a67
Compare
Co-Authored-By: Judah Rand <17158624+judahrand@users.noreply.github.com>
For more information, see https://pre-commit.ci
For more information, see https://pre-commit.ci
6d24963
to
3e1cd6b
Compare
@aarnphm @frostming should be ready for another look! |
08803c5
to
fc8b726
Compare
For more information, see https://pre-commit.ci
Signed-off-by: Aaron <29749331+aarnphm@users.noreply.github.com>
What does this PR address?
A draft attempt at addressing #4115
Currently, this introduces a lot of duplicate code. However, I think it should be possible to reduce this significantly.
I believe by having separate sync and async implementations optimal performance can be achieved for both.
I'd be interested to get thoughts and feedback on this PR as well as advice on how to benchmark it against
main
as I believe it should see some performance benefit across multiple requests on the same client.Fixes #(issue)
Before submitting:
guide on how to create a pull request.
pre-commit run -a
script has passed (instructions)?those accordingly? Here are documentation guidelines and tips on writting docs.