Skip to content

Commit

Permalink
Update to triton 20-08 triton
Browse files Browse the repository at this point in the history
  • Loading branch information
ukclivecox committed Sep 5, 2020
1 parent 943a7cd commit 7564b69
Show file tree
Hide file tree
Showing 11 changed files with 1,328 additions and 1,028 deletions.
14 changes: 7 additions & 7 deletions executor/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,13 @@ compile_tensorflow_proto:


compile_kfserving_proto:
git clone https://github.com/NVIDIA/triton-inference-server
mkdir -p api/grpc/kfserving/proto
cp triton-inference-server/src/core/*.proto api/grpc/kfserving/proto
cd api/grpc/kfserving/proto && protoc -I. --go_out=paths=source_relative,plugins=grpc:. grpc_service.proto && protoc -I. --go_out=paths=source_relative,plugins=grpc:. model_config.proto && protoc -I. --go_out=paths=source_relative,plugins=grpc:. server_status.proto
sed -i "s/package nvidia_inferenceserver/package proto/" api/grpc/kfserving/proto/grpc_service.pb.go
sed -i "s/package nvidia_inferenceserver/package proto/" api/grpc/kfserving/proto/model_config.pb.go
sed -i "s/package nvidia_inferenceserver/package proto/" api/grpc/kfserving/proto/server_status.pb.go
#git clone https://github.com/NVIDIA/triton-inference-server
mkdir -p api/grpc/kfserving/inference
cp triton-inference-server/src/core/*.proto api/grpc/kfserving/inference
cd api/grpc/kfserving/inference && protoc -I. --go_out=paths=source_relative,plugins=grpc:. grpc_service.proto && protoc -I. --go_out=paths=source_relative,plugins=grpc:. model_config.proto && protoc -I. --go_out=paths=source_relative,plugins=grpc:. server_status.proto
#sed -i "s/package nvidia_inferenceserver/package proto/" api/grpc/kfserving/proto/grpc_service.pb.go
#sed -i "s/package nvidia_inferenceserver/package proto/" api/grpc/kfserving/proto/model_config.pb.go
#sed -i "s/package nvidia_inferenceserver/package proto/" api/grpc/kfserving/proto/server_status.pb.go


.PHONY: add_protos
Expand Down
30 changes: 15 additions & 15 deletions executor/api/grpc/kfserving/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"github.com/pkg/errors"
"github.com/seldonio/seldon-core/executor/api/client"
grpc2 "github.com/seldonio/seldon-core/executor/api/grpc"
"github.com/seldonio/seldon-core/executor/api/grpc/kfserving/proto"
"github.com/seldonio/seldon-core/executor/api/grpc/kfserving/inference"
"github.com/seldonio/seldon-core/executor/api/payload"
v1 "github.com/seldonio/seldon-core/operator/apis/machinelearning.seldon.io/v1"
"google.golang.org/grpc"
Expand Down Expand Up @@ -68,11 +68,11 @@ func (s *KFServingGrpcClient) Predict(ctx context.Context, modelName string, hos
if err != nil {
return nil, err
}
grpcClient := proto.NewGRPCInferenceServiceClient(conn)
grpcClient := inference.NewGRPCInferenceServiceClient(conn)
ctx = grpc2.AddMetadataToOutgoingGrpcContext(ctx, meta)
var resp *proto.ModelInferResponse
var resp *inference.ModelInferResponse
switch v := msg.GetPayload().(type) {
case *proto.ModelInferRequest:
case *inference.ModelInferRequest:
resp, err = grpcClient.ModelInfer(ctx, v, s.callOptions...)
default:
return nil, errors.Errorf("Invalid type %v", v)
Expand Down Expand Up @@ -106,14 +106,14 @@ func (s *KFServingGrpcClient) Feedback(ctx context.Context, modelName string, ho

func (s *KFServingGrpcClient) Chain(ctx context.Context, modelName string, msg payload.SeldonPayload) (payload.SeldonPayload, error) {
switch v := msg.GetPayload().(type) {
case *proto.ModelInferRequest:
case *inference.ModelInferRequest:
s.Log.Info("Identity chain")
return msg, nil
case *proto.ModelInferResponse:
case *inference.ModelInferResponse:
s.Log.Info("Chain!")
inputTensors := make([]*proto.ModelInferRequest_InferInputTensor, len(v.Outputs))
inputTensors := make([]*inference.ModelInferRequest_InferInputTensor, len(v.Outputs))
for _, oTensor := range v.Outputs {
inputTensor := &proto.ModelInferRequest_InferInputTensor{
inputTensor := &inference.ModelInferRequest_InferInputTensor{
Name: oTensor.Name,
Datatype: oTensor.Datatype,
Shape: oTensor.Shape,
Expand All @@ -122,7 +122,7 @@ func (s *KFServingGrpcClient) Chain(ctx context.Context, modelName string, msg p
}
inputTensors = append(inputTensors, inputTensor)
}
pr := proto.ModelInferRequest{
pr := inference.ModelInferRequest{
Inputs: inputTensors,
}
msg2 := payload.ProtoPayload{Msg: &pr}
Expand All @@ -137,11 +137,11 @@ func (s *KFServingGrpcClient) Status(ctx context.Context, modelName string, host
if err != nil {
return nil, err
}
grpcClient := proto.NewGRPCInferenceServiceClient(conn)
grpcClient := inference.NewGRPCInferenceServiceClient(conn)
ctx = grpc2.AddMetadataToOutgoingGrpcContext(ctx, meta)
var resp *proto.ModelReadyResponse
var resp *inference.ModelReadyResponse
switch v := msg.GetPayload().(type) {
case *proto.ModelReadyRequest:
case *inference.ModelReadyRequest:
resp, err = grpcClient.ModelReady(ctx, v, s.callOptions...)
default:
return nil, errors.Errorf("Invalid type %v", v)
Expand All @@ -158,11 +158,11 @@ func (s *KFServingGrpcClient) Metadata(ctx context.Context, modelName string, ho
if err != nil {
return nil, err
}
grpcClient := proto.NewGRPCInferenceServiceClient(conn)
grpcClient := inference.NewGRPCInferenceServiceClient(conn)
ctx = grpc2.AddMetadataToOutgoingGrpcContext(ctx, meta)
var resp *proto.ModelMetadataResponse
var resp *inference.ModelMetadataResponse
switch v := msg.GetPayload().(type) {
case *proto.ModelMetadataRequest:
case *inference.ModelMetadataRequest:
resp, err = grpcClient.ModelMetadata(ctx, v, s.callOptions...)
default:
return nil, errors.Errorf("Invalid type %v", v)
Expand Down
Loading

0 comments on commit 7564b69

Please sign in to comment.