-
Notifications
You must be signed in to change notification settings - Fork 834
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #689 from cliveseldon/standalone_servers
Model servers
- Loading branch information
Showing
43 changed files
with
3,205 additions
and
100 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"path": "../../../notebooks/server_examples.ipynb" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
# Prepackaged Model Servers | ||
|
||
Seldon provides several prepacked servers you can use to deploy trained models: | ||
|
||
* [SKLearn Server](./sklearn.html) | ||
* [XGBoost Server](xgboost.html) | ||
* [Tensorflow Serving](tensorflow.html) | ||
|
||
|
||
For these servers you only need the location of the saved model in a local filestore, Google bucket or S3 bucket. An example manifest with an sklearn server is shown below: | ||
|
||
``` | ||
apiVersion: machinelearning.seldon.io/v1alpha2 | ||
kind: SeldonDeployment | ||
metadata: | ||
name: sklearn | ||
spec: | ||
name: iris | ||
predictors: | ||
- graph: | ||
children: [] | ||
implementation: SKLEARN_SERVER | ||
modelUri: gs://seldon-models/sklearn/iris | ||
name: classifier | ||
name: default | ||
replicas: 1 | ||
``` | ||
|
||
The `modelUri` specifies the bucket containing the saved model, in this case `gs://seldon-models/sklearn/iris`. | ||
|
||
If you want to customize the resources for the server you can add a skeleton `Container` with the same name to your podSpecs, e.g. | ||
|
||
``` | ||
apiVersion: machinelearning.seldon.io/v1alpha2 | ||
kind: SeldonDeployment | ||
metadata: | ||
name: sklearn | ||
spec: | ||
name: iris | ||
predictors: | ||
- componentSpecs: | ||
- spec: | ||
containers: | ||
- name: classifier | ||
resources: | ||
requests: | ||
memory: 50Mi | ||
graph: | ||
children: [] | ||
implementation: SKLEARN_SERVER | ||
modelUri: gs://seldon-models/sklearn/iris | ||
name: classifier | ||
name: default | ||
replicas: 1 | ||
``` | ||
|
||
The image name and other details will be added when this is deployed automatically. | ||
|
||
Next steps: | ||
|
||
* [Worked notebook](../examples/server_examples.html) | ||
* [SKLearn Server](./sklearn.html) | ||
* [XGBoost Server](xgboost.html) | ||
* [Tensorflow Serving](tensorflow.html) | ||
|
||
If your use case does not fall into the above standard servers then you can create your own component using our wrappers. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# SKLearn Server | ||
|
||
If you have a trained SKLearn model saved as a pickle you can deploy it simply using Seldon's prepackaged SKLearn server. | ||
|
||
Prequisites: | ||
|
||
* The model pickle must be saved using joblib and presently be named `model.joblib` | ||
* We presently use sklearn version 0.20.3. Your pickled model must be compatbible with this version | ||
|
||
An example for a saved Iris prediction model: | ||
|
||
``` | ||
apiVersion: machinelearning.seldon.io/v1alpha2 | ||
kind: SeldonDeployment | ||
metadata: | ||
name: sklearn | ||
spec: | ||
name: iris | ||
predictors: | ||
- graph: | ||
children: [] | ||
implementation: SKLEARN_SERVER | ||
modelUri: gs://seldon-models/sklearn/iris | ||
name: classifier | ||
name: default | ||
replicas: 1 | ||
``` | ||
|
||
|
||
Try out a [worked notebook](../examples/server_examples.html) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
# Tensorflow Serving | ||
|
||
If you have a trained Tensorflow model you can deploy this directly via REST or gRPC servers. | ||
|
||
## MNIST Example | ||
|
||
### REST MNIST Example | ||
|
||
For REST you need to specify paramaters for: | ||
|
||
* signature_name | ||
* model_name | ||
|
||
``` | ||
apiVersion: machinelearning.seldon.io/v1alpha2 | ||
kind: SeldonDeployment | ||
metadata: | ||
name: tfserving | ||
spec: | ||
name: mnist | ||
predictors: | ||
- graph: | ||
children: [] | ||
implementation: TENSORFLOW_SERVER | ||
modelUri: gs://seldon-tfserving-store/mnist-model | ||
name: mnist-model | ||
parameters: | ||
- name: signature_name | ||
type: STRING | ||
value: predict_images | ||
- name: model_name | ||
type: STRING | ||
value: mnist-model | ||
name: default | ||
replicas: 1 | ||
``` | ||
|
||
### gRPC MNIST Example | ||
|
||
For gRPC you need to specify the following parameters: | ||
|
||
* signature_name | ||
* model_name | ||
* model_input | ||
* model_output | ||
|
||
``` | ||
apiVersion: machinelearning.seldon.io/v1alpha2 | ||
kind: SeldonDeployment | ||
metadata: | ||
name: tfserving | ||
spec: | ||
name: mnist | ||
predictors: | ||
- graph: | ||
children: [] | ||
implementation: TENSORFLOW_SERVER | ||
modelUri: gs://seldon-tfserving-store/mnist-model | ||
name: mnist-model | ||
endpoint: | ||
type: GRPC | ||
parameters: | ||
- name: signature_name | ||
type: STRING | ||
value: predict_images | ||
- name: model_name | ||
type: STRING | ||
value: mnist-model | ||
- name: model_input | ||
type: STRING | ||
value: images | ||
- name: model_output | ||
type: STRING | ||
value: scores | ||
name: default | ||
replicas: 1 | ||
``` | ||
|
||
|
||
Try out a [worked notebook](../examples/server_examples.html) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# XGBoost Server | ||
|
||
If you have a trained XGBoost model saved you can deploy it simply using Seldon's prepackaged XGBoost server. | ||
|
||
Prequisites: | ||
|
||
* The model pickle must be named `model.bst` | ||
|
||
An example for a saved Iris prediction model: | ||
|
||
``` | ||
apiVersion: machinelearning.seldon.io/v1alpha2 | ||
kind: SeldonDeployment | ||
metadata: | ||
name: xgboost | ||
spec: | ||
name: iris | ||
predictors: | ||
- graph: | ||
children: [] | ||
implementation: XGBOOST_SERVER | ||
modelUri: gs://seldon-models/xgboost/iris | ||
name: classifier | ||
name: default | ||
replicas: 1 | ||
``` | ||
|
||
|
||
Try out a [worked notebook](../examples/server_examples.html) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.