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

Clarify interactions between TorchServe and KServe #3378

Open
kimminw00 opened this issue Dec 26, 2024 · 1 comment
Open

Clarify interactions between TorchServe and KServe #3378

kimminw00 opened this issue Dec 26, 2024 · 1 comment

Comments

@kimminw00
Copy link

kimminw00 commented Dec 26, 2024

📚 The doc issue

When deploying PyTorch models using the pytorch/torchserve-kfs image with Kserve, I found it challenging to understand the architecture and how different processes interact with each other. Specifically, I would like to know which processes run in which pods and how resources are allocated. To optimize for large traffic volumes, it's crucial to understand how resources are allocated to each process.

As I understand, TorchServe uses Netty-based HTTP/gRPC servers, while Kserve uses Tornado-based HTTP/gRPC servers. However, when deploying with pytorch/torchserve-kfs image, it's unclear what process runs where.

Reference
https://kserve.github.io/website/master/modelserving/v1beta1/torchserve/

Suggest a potential alternative/fix

If possible, providing a high-level diagram or explanation of how the different components interact would be incredibly helpful.

@cjidboon94
Copy link

Hey @kimminw00 as far as my understanding goes the following happens in the kserve-container:
Two processes get started:

  • a thin frontend FastAPI-based Kserve Modelserver
  • a backend Torchserve server which manages your models.

On startup, Kserve frontend server waits until torchserve is ready with loading all your models (checks status by pinging it every few seconds
Once the model is loaded and kserve got a positive response from the torchserve it marks and registers the model as ready to be used and I believe the health check then passes and the pod is also considered ready.

When requests come in, they go first through the Kserve modelserver, get redirected to the torchserve server ,returned to the Kserve server which then finally returns it to the client.

Graphically this would be:

Request ->   KServe -> Torchserve
Response <- Kserve <- Torchserve

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants