From a4bc294d19cb9848e596d27c63a47b1183ba3e22 Mon Sep 17 00:00:00 2001 From: George Wu Date: Mon, 12 Feb 2024 09:02:52 -0800 Subject: [PATCH 1/2] add back proto lite support for TRT EP --- cmake/CMakeLists.txt | 3 +-- tools/ci_build/build.py | 6 +++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt index 90fe8276ea9c7..ff1c7a84f077f 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt @@ -117,8 +117,7 @@ option(onnxruntime_CROSS_COMPILING "Cross compiling onnx runtime" OFF) option(onnxruntime_GCOV_COVERAGE "Compile with options necessary to run code coverage" OFF) option(onnxruntime_DONT_VECTORIZE "Do not vectorize operations in Eigen" OFF) -#It's preferred to turn it OFF when onnxruntime is dynamically linked to PROTOBUF. But Tensort always required the full version of protobuf. -cmake_dependent_option(onnxruntime_USE_FULL_PROTOBUF "Link to libprotobuf instead of libprotobuf-lite when this option is ON" OFF "NOT onnxruntime_USE_TENSORRT" ON) +option(onnxruntime_USE_FULL_PROTOBUF "Link to libprotobuf instead of libprotobuf-lite when this option is ON" OFF) option(tensorflow_C_PACKAGE_PATH "Path to tensorflow C package installation dir") option(onnxruntime_ENABLE_LANGUAGE_INTEROP_OPS "Enable operator implemented in language other than cpp" OFF) option(onnxruntime_DEBUG_NODE_INPUTS_OUTPUTS "Dump debug information about node inputs and outputs when executing the model." OFF) diff --git a/tools/ci_build/build.py b/tools/ci_build/build.py index 8567d595b7429..b36405ec6a6d4 100644 --- a/tools/ci_build/build.py +++ b/tools/ci_build/build.py @@ -1236,9 +1236,9 @@ def generate_build_tree( "-Donnxruntime_USE_OPENVINO_AUTO=" + ("ON" if args.use_openvino.startswith("AUTO") else "OFF"), ] - # TensorRT and OpenVINO providers currently only support - # full_protobuf option. - if args.use_full_protobuf or args.use_tensorrt or args.use_openvino or args.use_vitisai or args.gen_doc: + # VitisAI and OpenVINO providers currently only support + # full_protobuf option. TensorRT provider only requires it if built with oss_parser + if args.use_full_protobuf or (args.use_tensorrt and args.use_tensorrt_oss_parser) or args.use_openvino or args.use_vitisai or args.gen_doc: cmake_args += ["-Donnxruntime_USE_FULL_PROTOBUF=ON", "-DProtobuf_USE_STATIC_LIBS=ON"] if args.use_tvm and args.llvm_path is not None: From e3b5c6daf5490ca2c0f6ad11e97210006d14118d Mon Sep 17 00:00:00 2001 From: George Wu Date: Mon, 12 Feb 2024 09:17:12 -0800 Subject: [PATCH 2/2] lint --- tools/ci_build/build.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tools/ci_build/build.py b/tools/ci_build/build.py index b36405ec6a6d4..96567c8767a82 100644 --- a/tools/ci_build/build.py +++ b/tools/ci_build/build.py @@ -1238,7 +1238,13 @@ def generate_build_tree( # VitisAI and OpenVINO providers currently only support # full_protobuf option. TensorRT provider only requires it if built with oss_parser - if args.use_full_protobuf or (args.use_tensorrt and args.use_tensorrt_oss_parser) or args.use_openvino or args.use_vitisai or args.gen_doc: + if ( + args.use_full_protobuf + or (args.use_tensorrt and args.use_tensorrt_oss_parser) + or args.use_openvino + or args.use_vitisai + or args.gen_doc + ): cmake_args += ["-Donnxruntime_USE_FULL_PROTOBUF=ON", "-DProtobuf_USE_STATIC_LIBS=ON"] if args.use_tvm and args.llvm_path is not None: