segment-anything icon indicating copy to clipboard operation
segment-anything copied to clipboard

How do I deploy sam using triton

Open Sencc opened this issue 3 years ago • 6 comments

I want to use NVIDIA triton to deploy the sam model and use grpc to request it. Are there any examples for reference?

Sencc avatar Jul 12 '23 07:07 Sencc

Hi, I have the same demand as you. Do you have any ideas?

vvForedawn avatar Jul 18 '23 07:07 vvForedawn

@vvForedawn I've solved it, you need to export the segment-anything models to onnx, deploy them to triton server, and finally call them using grpc.

Sencc avatar Jul 25 '23 01:07 Sencc

Hi @Sencc , Can you share some details our you managed to make it work with Triton? I managed to serve the decoder onnx model, but the inference call with grpc result in error. Which triton server version are you using?

tritonclient.utils.InferenceServerException: [StatusCode.INTERNAL] onnx runtime error 6: Non-zero status code returned while running Gemm node. Name:'/output_hypernetworks_mlps.3/layers.0/Gemm' Status Message: /workspace/onnxruntime/onnxruntime/core/providers/cuda/cuda_call.cc:121 std::conditional_t<THRW, void, onnxruntime::common::Status> onnxruntime::CudaCall(ERRTYPE, const char*, const char*, ERRTYPE, const char*, const char*, int) [with ERRTYPE = cublasStatus_t; bool THRW = true; std::conditional_t<THRW, void, onnxruntime::common::Status> = void] /workspace/onnxruntime/onnxruntime/core/providers/cuda/cuda_call.cc:114 std::conditional_t<THRW, void, onnxruntime::common::Status> onnxruntime::CudaCall(ERRTYPE, const char*, const char*, ERRTYPE, const char*, const char*, int) [with ERRTYPE = cublasStatus_t; bool THRW = true; std::conditional_t<THRW, void, onnxruntime::common::Status> = void] CUBLAS failure 3: CUBLAS_STATUS_ALLOC_FAILED ; GPU=0 ; hostname=p-sam-triton-inference-id-predictor-default-00001-deploymexpss7 ; file=/workspace/onnxruntime/onnxruntime/core/providers/cuda/cuda_execution_provider.cc ; line=164 ; expr=cublasCreate(&cublas_handle_);

idonahum1 avatar Aug 10 '23 09:08 idonahum1

@idonahum1 , I am using the triton-server-23.06 container, your error seems to be a cuda problem.

Sencc avatar Aug 23 '23 03:08 Sencc

@vvForedawn I've solved it, you need to export the segment-anything models to onnx, deploy them to triton server, and finally call them using grpc.

Dude,how about the input and output,do you have some examples?

Bestbbb avatar Nov 08 '23 20:11 Bestbbb

@Bestbbb You can refer to the demo example of calling the onnx model.

Sencc avatar Jan 08 '24 08:01 Sencc