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

Make TorchServe usable without torch installed #3350

Open
racinmat opened this issue Oct 21, 2024 · 0 comments · May be fixed by #3351
Open

Make TorchServe usable without torch installed #3350

racinmat opened this issue Oct 21, 2024 · 0 comments · May be fixed by #3351

Comments

@racinmat
Copy link

racinmat commented Oct 21, 2024

🚀 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

  • Installing torch even when I don't need it, which takes ~600MB in the docker imagew
  • mocking the torch by using following script
    class Tensor:
        pass
    
    
    def save(val, buff):
        print("I am dummy! I am not real torch!")

Additional context

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

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

Successfully merging a pull request may close this issue.

1 participant