Skip to content

Commit

Permalink
Sherif akoush/sc 2543/alibi explain mlserver runtime (#3707)
Browse files Browse the repository at this point in the history
* Initial POC to integrate mlserver alibi

* Create svc without waiting for deployment to be ready

* add explainer image_v2 in operator configmap.yaml

* map core explainer type in mlserver type

* wire up explainer image_v2

* add  mlserver env constants and use them

* refactor to utils to mlserver.go

* allow to pass explainer init parameters + tests

* add initParameters to explainer in the CRD

* add initial  explainer_examples_v2.ipynb

* use mlserver:0.6.0.dev2

* add integration test for explainer v2 (anchor tabular)

* add  tests

* add v2 explainer doc reference
  • Loading branch information
sakoush authored Nov 16, 2021
1 parent d76909f commit 82fb30e
Show file tree
Hide file tree
Showing 22 changed files with 863 additions and 58 deletions.
9 changes: 8 additions & 1 deletion doc/source/analytics/explainers.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,13 @@ For Alibi explainers that need to be trained you should

The runtime environment in our [Alibi Explain Server](https://github.com/SeldonIO/seldon-core/tree/master/components/alibi-explain-server) is locked using [Poetry](https://python-poetry.org/). See our e2e example [here](../examples/iris_explainer_poetry.html) on how to use that definition to train your explainers.

### V2 protocol for explainer using [MLServer](https://github.com/SeldonIO/MLServer) (incubating)

The support for v2 protocol is now handled with MLServer moving forward. This is experimental
and only works for black-box explainers.

For an e2e example, please check AnchorTabular notebook [here](../examples/iris_anchor_tabular_explainer_v2.html).

## Explain API

For the Seldon Protocol an endpoint path will be exposed for:
Expand Down Expand Up @@ -84,7 +91,7 @@ The explain method is also supported for tensorflow and v2 kfserving protocols.
| ------ | ----- |
| seldon | `http://<host>/<ingress-path>/api/v1.0/explain` |
| tensorflow | `http://<host>/<ingress-path>/v1/models/<model-name>:explain` |
| kfserving | `http://<host>/<ingress-path>/v2/models/<model-name>/explain` |
| kfserving | `http://<host>/<ingress-path>/v2/models/<model-name>/infer` |


Note: for `tensorflow` protocol we support similar non-standard extension as for the [prediction API](../graph/protocols.md#rest-and-grpc-tensorflow-protocol), `http://<host>/<ingress-path>/v1/models/:explain`.
3 changes: 3 additions & 0 deletions doc/source/examples/iris_anchor_tabular_explainer_v2.nblink
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"path": "../../../notebooks/explainer_examples_v2.ipynb"
}
Original file line number Diff line number Diff line change
Expand Up @@ -4272,6 +4272,8 @@ spec:
type: object
envSecretRefName:
type: string
initParameters:
type: string
modelUri:
type: string
replicas:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5234,6 +5234,8 @@ spec:
type: object
envSecretRefName:
type: string
initParameters:
type: string
modelUri:
type: string
replicas:
Expand Down Expand Up @@ -11421,6 +11423,8 @@ spec:
type: object
envSecretRefName:
type: string
initParameters:
type: string
modelUri:
type: string
replicas:
Expand Down Expand Up @@ -17608,6 +17612,8 @@ spec:
type: object
envSecretRefName:
type: string
initParameters:
type: string
modelUri:
type: string
replicas:
Expand Down
13 changes: 7 additions & 6 deletions helm-charts/seldon-core-operator/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ certManager:

# ## Install with limited namespace visibility
# If you want to ensure seldon-core-controller can only have visibility
# to specifci namespaces you can set the controllerId
# to specify namespaces you can set the controllerId
controllerId: ""

# Whether operator should create the webhooks and configmap on startup (false means created from chart)
Expand All @@ -43,7 +43,7 @@ defaultUserID: "8888"
managerUserID: 8888

# ## Service Orchestrator (Executor)
# The executor is the default service orchestrator which has superceeded the "Java Engine"
# The executor is the default service orchestrator which has superceded the "Java Engine"
executor:
port: 8000
metricsPortName: metrics
Expand Down Expand Up @@ -119,15 +119,15 @@ predictor_servers:
defaultImageVersion: "1.12.0-dev"
image: seldonio/mlflowserver
kfserving:
defaultImageVersion: "0.5.0"
defaultImageVersion: "0.6.0.dev0"
image: seldonio/mlserver
SKLEARN_SERVER:
protocols:
seldon:
defaultImageVersion: "1.12.0-dev"
image: seldonio/sklearnserver
kfserving:
defaultImageVersion: "0.5.0"
defaultImageVersion: "0.6.0.dev0"
image: seldonio/mlserver
TENSORFLOW_SERVER:
protocols:
Expand All @@ -143,7 +143,7 @@ predictor_servers:
defaultImageVersion: "1.12.0-dev"
image: seldonio/xgboostserver
kfserving:
defaultImageVersion: "0.5.0"
defaultImageVersion: "0.6.0.dev0"
image: seldonio/mlserver
TRITON_SERVER:
protocols:
Expand All @@ -153,7 +153,7 @@ predictor_servers:
TEMPO_SERVER:
protocols:
kfserving:
defaultImageVersion: "0.5.0"
defaultImageVersion: "0.6.0.dev0"
image: seldonio/mlserver

# ## Other
Expand Down Expand Up @@ -206,3 +206,4 @@ engine:
# Explainer image
explainer:
image: seldonio/alibiexplainer:1.12.0-dev
image_v2: seldonio/mlserver:0.6.0.dev2
Loading

0 comments on commit 82fb30e

Please sign in to comment.