Skip to content

Commit 93ee2b2

Browse files
authored
feat: Add V2 Inference API support for OVMS runtime (#31)
#### Motivation Intel's OpenVINO Model Server has historically only supported the v1 (TFS) prediction API, but may also support v2 in upcoming versions. #### Modifications Adjust the built-in OVMS adapter to advertise the V2 gRPC Service APIs in addition to V1. #### Result KServe V2 Inference API will work with OVMS in ModelMesh Serving once supported by the OVMS container. Signed-off-by: Nick Hill <[email protected]>
1 parent 46f3b74 commit 93ee2b2

File tree

3 files changed

+10
-6
lines changed

3 files changed

+10
-6
lines changed

model-mesh-ovms-adapter/server/const.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
package server
1515

1616
const (
17-
ovmsModelSubdir string = "_ovms_models"
18-
onnxModelFilename string = "model.onnx"
17+
tfsGrpcServiceName string = "tensorflow.serving.PredictionService"
18+
kServeV2GrpcServiceName string = "inference.GRPCInferenceService"
19+
ovmsModelSubdir string = "_ovms_models"
20+
onnxModelFilename string = "model.onnx"
1921
)

model-mesh-ovms-adapter/server/server.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -221,10 +221,14 @@ func (s *OvmsAdapterServer) RuntimeStatus(ctx context.Context, req *mmesh.Runtim
221221
runtimeStatus.RuntimeVersion = s.AdapterConfig.RuntimeVersion
222222
runtimeStatus.LimitModelConcurrency = s.AdapterConfig.LimitModelConcurrency > 0
223223

224-
// OVMS only supports the Predict API currently
224+
path_1 := []uint32{1}
225225
path_1_1 := []uint32{1, 1} // PredictRequest[model_spec][name]
226226
mis := make(map[string]*mmesh.RuntimeStatusResponse_MethodInfo)
227-
mis["tensorflow.serving.PredictionService/Predict"] = &mmesh.RuntimeStatusResponse_MethodInfo{IdInjectionPath: path_1_1}
227+
// V1 (TFS) API
228+
mis[tfsGrpcServiceName+"/Predict"] = &mmesh.RuntimeStatusResponse_MethodInfo{IdInjectionPath: path_1_1}
229+
// KServe V2 API
230+
mis[kServeV2GrpcServiceName+"/ModelInfer"] = &mmesh.RuntimeStatusResponse_MethodInfo{IdInjectionPath: path_1}
231+
mis[kServeV2GrpcServiceName+"/ModelMetadata"] = &mmesh.RuntimeStatusResponse_MethodInfo{IdInjectionPath: path_1}
228232
runtimeStatus.MethodInfos = mis
229233

230234
log.Info("runtimeStatus", "Status", runtimeStatus)

model-mesh-triton-adapter/server/server.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -261,8 +261,6 @@ func (s *TritonAdapterServer) RuntimeStatus(ctx context.Context, req *mmesh.Runt
261261
path1 := []uint32{1}
262262

263263
mis := make(map[string]*mmesh.RuntimeStatusResponse_MethodInfo)
264-
265-
// only support Transform for now
266264
mis[tritonServiceName+"/ModelInfer"] = &mmesh.RuntimeStatusResponse_MethodInfo{IdInjectionPath: path1}
267265
mis[tritonServiceName+"/ModelMetadata"] = &mmesh.RuntimeStatusResponse_MethodInfo{IdInjectionPath: path1}
268266
runtimeStatus.MethodInfos = mis

0 commit comments

Comments
 (0)