-
Notifications
You must be signed in to change notification settings - Fork 68
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
GRPC Plugin #2506
Comments
Currently gRPC plugin is not installed by default, here is how to install this plugin:
You can use inference.proto to create your own grpc client to run inference against djl-serving. See example code: https://github.com/deepjavalibrary/djl-serving/blob/master/plugins/grpc/src/test/java/ai/djl/serving/grpc/GrpcTest.java#L69 |
Hello again, Thank you for your previous response—I really appreciate your help! I wanted to follow up on the earlier discussion. I have attempted the steps outlined, but it seems that the gRPC plugin isn't being added successfully. I suspect this may be due to a missing component in its JAR file. Additionally, I plan to use this within a Docker environment, which adds another layer of complexity. I also have another request regarding inference from a Java client using a BufferedImage. The current implementation requires the use of the ImageIO package to encode the image into a byte array. However, this encoding process can be quite time-consuming. For instance, encoding an image at a resolution of 1920x1080 takes approximately 200ms for PNG and 40ms for BMP formats. Could you please provide guidance on how to utilize a direct byte array from a BufferedImage with your inference API? Below is the code snippet I’m currently working with:
Thank you for your assistance! |
|
Hello, I would like to bring to your attention some details from the log file regarding the plugin initialization process:
While the plugins have been successfully initialized, I want to note that the gRPC plugin is not being added. I will attach the relevant .jar plugin files for your reference. Additionally, I have a couple of questions: How can I add a gRPC plugin to the Docker image? |
@Null1515 |
Thanks for your last answer! |
I'm not sure about that. The OpenCV extension we use (depends on And implement |
How can i implement my own byte array decoder in djl serve? |
I assume you are using You can implement your own After package your model, you also need copy all your 3rd party dependencies in
|
Hi there, I have dockerized version 0.31.0-snapshot and added the gRPC plugin to it. Now, I see the following message:
I'm running the Docker container with the following command: Any tips would be greatly appreciated! Thank you! |
Your grpc is listening on localhost (127.0.0.1), which means it can only accept connection from localhost. You need to add the following in
or you can set env in the dockerfile:
|
Hi again, Thank you for your help with my earlier mistake; I really appreciate it! I wanted to ask you something regarding gRPC. I’ve noticed that my inference time hasn’t improved at all. While I understand that REST can have latency issues, I expected gRPC to be faster. Do you have any tips for improving inference latency? For context, I’m using TorchScript with YOLOv8. Thanks in advance for your assistance! |
This is common misunderstanding about gRPC vs REST. In general gRPC performance comes from The reason we introduce gRPC plugin is not for performance. It's purely to make it easy for existing gRPC user to onboard with DJLServing. |
Thank you for the clarification! I appreciate your insights on the differences between gRPC and REST, especially regarding serialization and performance. Before we close this issue, could you share any tips or best practices for improving inference latency? Your expertise would be really helpful! Thanks again! |
Hey there,
First of all, I want to thank you for this amazing piece of art! Your work has been incredibly valuable.
I noticed that there is a gRPC plugin available in the source code, and I’m interested in utilizing it. However, I’m not sure how to go about using it effectively.
Could you please provide some guidance or documentation on how to use the gRPC plugin? Any tips or examples would be greatly appreciated!
Thank you for your help!
The text was updated successfully, but these errors were encountered: