From d90aeda36d4538afdbf79d3b776384be19cc507c Mon Sep 17 00:00:00 2001 From: Hyunjae Woo Date: Tue, 10 Dec 2024 11:20:59 -0800 Subject: [PATCH] fix build failure --- src/client_backend/client_backend.cc | 6 +++--- src/client_backend/dynamic_grpc/dynamic_grpc_client.cc | 3 +-- src/client_backend/dynamic_grpc/dynamic_grpc_client.h | 2 ++ .../dynamic_grpc/dynamic_grpc_client_backend.cc | 5 +++-- .../dynamic_grpc/dynamic_grpc_client_backend.h | 5 ++++- 5 files changed, 13 insertions(+), 8 deletions(-) diff --git a/src/client_backend/client_backend.cc b/src/client_backend/client_backend.cc index 479c65ce..18662776 100644 --- a/src/client_backend/client_backend.cc +++ b/src/client_backend/client_backend.cc @@ -33,7 +33,7 @@ #endif // TRITON_ENABLE_PERF_ANALYZER_C_API #ifdef TRITON_ENABLE_PERF_ANALYZER_DGRPC -#include "grpc/dynamic_grpc_client_backend.h" +#include "dynamic_grpc/dynamic_grpc_client_backend.h" #endif // TRITON_ENABLE_PERF_ANALYZER_DGRPC #ifdef TRITON_ENABLE_PERF_ANALYZER_OPENAI @@ -190,8 +190,8 @@ ClientBackend::Create( #ifdef TRITON_ENABLE_PERF_ANALYZER_DGRPC else if (kind == DYNAMIC_GRPC) { RETURN_IF_CB_ERROR(dynamicgrpc::DynamicGrpcClientBackend::Create( - url, protocol, BackendToGrpcType(compression_algorithm), http_headers, - verbose, &local_backend)); + url, protocol, ssl_options, BackendToGrpcType(compression_algorithm), + http_headers, verbose, &local_backend)); } #endif // TRITON_ENABLE_PERF_ANALYZER_DGRPC #ifdef TRITON_ENABLE_PERF_ANALYZER_OPENAI diff --git a/src/client_backend/dynamic_grpc/dynamic_grpc_client.cc b/src/client_backend/dynamic_grpc/dynamic_grpc_client.cc index e45155c4..23b8097d 100644 --- a/src/client_backend/dynamic_grpc/dynamic_grpc_client.cc +++ b/src/client_backend/dynamic_grpc/dynamic_grpc_client.cc @@ -48,8 +48,7 @@ DynamicGrpcInferResult::Id(std::string* id) const Error DynamicGrpcInferResult::RawData( - const std::string& output_name, const uint8_t** buf, - size_t* byte_size) const + const std::string& output_name, std::vector& buf) const { // TODO return Error("Not implemented yet."); diff --git a/src/client_backend/dynamic_grpc/dynamic_grpc_client.h b/src/client_backend/dynamic_grpc/dynamic_grpc_client.h index c6e9412c..a4893837 100644 --- a/src/client_backend/dynamic_grpc/dynamic_grpc_client.h +++ b/src/client_backend/dynamic_grpc/dynamic_grpc_client.h @@ -77,6 +77,8 @@ struct KeepAliveOptions { int http2_max_pings_without_data; }; +class DynamicGrpcClient; + //============================================================================== // An DynamicGrpcRequest represents an inflght request on gRPC. // diff --git a/src/client_backend/dynamic_grpc/dynamic_grpc_client_backend.cc b/src/client_backend/dynamic_grpc/dynamic_grpc_client_backend.cc index e4862ba6..fe1dabc8 100644 --- a/src/client_backend/dynamic_grpc/dynamic_grpc_client_backend.cc +++ b/src/client_backend/dynamic_grpc/dynamic_grpc_client_backend.cc @@ -47,6 +47,7 @@ ParseGrpcSslOptions(const cb::SslOptionsBase& ssl_options) Error DynamicGrpcClientBackend::Create( const std::string& url, const ProtocolType protocol, + const SslOptionsBase& ssl_options, const grpc_compression_algorithm compression_algorithm, std::shared_ptr http_headers, const bool verbose, std::unique_ptr* client_backend) @@ -77,8 +78,8 @@ DynamicGrpcClientBackend::StreamInfer( const std::vector& inputs, const std::vector& outputs) { - RETURN_IF_CB_ERROR(grpc_client_->Infer( - &result, options, inputs, outputs, *http_headers_, + RETURN_IF_CB_ERROR(grpc_client_->BidiStreamRPC( + result, options, inputs, outputs, *http_headers_, compression_algorithm_)); return Error::Success; diff --git a/src/client_backend/dynamic_grpc/dynamic_grpc_client_backend.h b/src/client_backend/dynamic_grpc/dynamic_grpc_client_backend.h index 4b1ce478..8107ffda 100644 --- a/src/client_backend/dynamic_grpc/dynamic_grpc_client_backend.h +++ b/src/client_backend/dynamic_grpc/dynamic_grpc_client_backend.h @@ -30,6 +30,7 @@ #include "../../perf_utils.h" #include "../client_backend.h" #include "dynamic_grpc_client.h" +#include "dynamic_grpc_infer_input.h" #define RETURN_IF_TRITON_ERROR(S) \ do { \ @@ -52,6 +53,7 @@ class DynamicGrpcClientBackend : public ClientBackend { /// arbitrary grpc service. /// \param url The grpc service url and port. /// \param protocol The protocol type used. + /// \param ssl_options The SSL options used with client backend. /// \param compression_algorithm The compression algorithm to be used /// on the grpc requests. /// \param http_headers Map of HTTP headers. The map key/value indicates @@ -62,6 +64,7 @@ class DynamicGrpcClientBackend : public ClientBackend { /// \return Error object indicating success or failure. static Error Create( const std::string& url, const ProtocolType protocol, + const SslOptionsBase& ssl_options, const grpc_compression_algorithm compression_algorithm, std::shared_ptr http_headers, const bool verbose, std::unique_ptr* client_backend); @@ -70,7 +73,7 @@ class DynamicGrpcClientBackend : public ClientBackend { Error StreamInfer( cb::InferResult** result, const InferOptions& options, const std::vector& inputs, - const std::vector& outputs) override; + const std::vector& outputs); /// See ClientBackend::ClientInferStat() Error ClientInferStat(InferStat* infer_stat) override;