-
Notifications
You must be signed in to change notification settings - Fork 835
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
PyTorch Hub General Seldon Deployment Example #642
Conversation
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.
The seldon_client uses gateway_endpoint
now. We probably need to check this in the examples.
Good catch @cliveseldon, I was using SeldonClient 0.2.7, I have now updated it to 0.3.0, and have added an explicit definition through the requirements-dev.txt so that people that go through this tutorial make sure they have the right configuration. |
By the way @cliveseldon what are your thoughts on the format suggested for the "Setup/install Seldon" section, which basically would references to another page. The idea there was that it could reduce the amount of work required when updates need to be put in place. |
A separate install reference rather than in each notebook makes sense. I will create a separate issue for this. |
This example is currently having issues when the models take longer to download than 20s, which is outlined in this issue #674 |
Can we use ModelUri for auto-download? |
After going through the pytorch load module it seems that the download of the model is too embedded with the code, and cannot be downloaded by the init container. |
failed to trigger Pull Request pipeline
|
* only add trailers headers if not nil * move trailer manipulation to one if statement
PyTorch Hub General Seldon Deployment Example
This PR contains an example that shows how it's possible to support most of the currently available PyTorch Hub models, and virtually all that follows the standard model structure. The README.md can be found here, and similarly the notebook for the example.
Context on PyTorch
PyTorch Hub is the latest initiative from Facebook's PyTorch team to tackle the challenge of reproducibility, allowing developers to expose their models through a
hubconf.py
file.Codebases with a
hubconf.py
file that are added to the PyTorch Hub repo are added to the list (which can be viewed withtorch.hub.list()
) can be imported by simply running the commandtorch.hub.load("USER/REPO_NAME", "MODEL_NAME", pretrained=True)
.Initial thoughts on General Architecture of PyTorch hub and Seldon
The approach that was taken was quite standard actually. Because there was a relatively good level of standardisation of the models they accept in their hub (with exception with others like the BERT tokenizers and util functions) so it was possible to create a very simple Python wrapper that allows the developer/user to define the model to deploy with the parameters in the seldondeployment config file. Below is just a high level overview of how pytorchHub as the module in the PyTorch library serves as an interface with the github repos, and then the trigger (which is referred to as "GitOps) is basically manual in this example, but here is where you could basically have a GitOps tool like ArgoCD making sure that any new changes result in the relevant updates.
Ideas on the general structure for examples
ONe thing to note in this example is that the installation instructions are different. Given that we have quite a lot of examples that reference to the installation (which most of the times is the same) I thought of a way of referring users towards a general installation page/notebook, which would allow us to then reduce the amount of work required when changing or updating installation instructions.