pytorch / serve

Serve, optimize and scale PyTorch models in production
https://pytorch.org/serve/
Apache License 2.0
4.22k stars 863 forks source link

Make TorchServe usable without torch installed #3350

Open racinmat opened 1 month ago

racinmat commented 1 month ago

🚀 The feature

Being able to use TorchServe with some form of base handler and base server worker without having torch installed.

Motivation, pitch

TorchServe has unique set of features and is quite powerful, while offering flexibility of executing python code during inference and can handle multiple python versions out of the box, This makes it superior to TF Serving which requires traced models and thus is unusable if I use custom layers calling python code, or nvidia triton, which works outside of the box only with python 3.10 and you need to compile it to work with other python versions.

It's already almost usable, it just needs some refactoring to better split the framework-agnostic code from torch-specific code.

Alternatives

Additional context

I spent quite some time investigating this topic and comparing them, you can see my talk about it