mirror of
https://github.com/hanzo-ml/kserve.git
synced 2026-10-30 20:53:49 +00:00
* Knative 1.0 upgrade Signed-off-by: Dan Sun <[email protected]> * Update knative test crds for 1.0 Signed-off-by: Dan Sun <[email protected]> * Set HTTPGet readiness probe for agent container Signed-off-by: Dan Sun <[email protected]> * Remove agent port hack Signed-off-by: Dan Sun <[email protected]> * Expose agent container port Signed-off-by: Dan Sun <[email protected]> * Use minScale/maxScale for compatibility as Knative 1.1 changed to min-scale/max-scale Signed-off-by: Dan Sun <[email protected]> * Update quick install script to use knative 1.0 Signed-off-by: Dan Sun <[email protected]> * Use kserve testing-worker image for go 1.17.3 Signed-off-by: Dan Sun <[email protected]>
1.5 KiB
1.5 KiB
Inference Batcher
We add this module to support batch prediction for any ML frameworks (TensorFlow, PyTorch, ...) without decreasing the performance.
This batcher is implemented in the KServe model agent sidecar, so the requests first hit the agent sidecar, when a batch prediction is triggered the request is then sent to the model server container for inference.
- We use webhook to inject the model agent container in the InferenceService pod to do the batching when batcher is enabled.
- We use go channels to transfer data between http requset handler and batcher go routines.
- Currently we only implemented batching with KServe v1 HTTP protocol, gRPC is not supported yet.
- When the number of instances (For example, the number of pictures) reaches the
maxBatchSizeor the latency meets themaxLatency, a batch prediction will be triggered.
apiVersion: "serving.kserve.io/v1beta1"
kind: "InferenceService"
metadata:
name: "pytorch-cifar10"
spec:
predictor:
timeout: 60
minReplicas: 1
batcher:
maxBatchSize: 32
maxLatency: 5000
pytorch:
storageUri: "gs://kfserving-examples/models/torchserve/image-classifier"
maxBatchSize: the max batch size for triggering a prediction.maxLatency: the max latency for triggering a prediction (In milliseconds).timeout: timeout of calling predictor service (In seconds).
All of the bellowing fields have default values in the code. You can config them or not as you wish.
maxBatchSize: 32.maxLatency: 5000.timeout: 60.
