diff --git a/src/python/library/CMakeLists.txt b/src/python/library/CMakeLists.txt index 815f68fac..0c24d5b06 100644 --- a/src/python/library/CMakeLists.txt +++ b/src/python/library/CMakeLists.txt @@ -93,33 +93,6 @@ add_custom_target( # # Linux specific Wheel file. Compatible with x86, x64 and aarch64 # -if (NOT WIN32) - # Can generate linux specific wheel file on linux systems only. - set(LINUX_WHEEL_DEPENDS - ${WHEEL_DEPENDS} - ) - - if (${TRITON_PACKAGE_PERF_ANALYZER}) - set(perf_analyzer_arg --perf-analyzer ${CMAKE_INSTALL_PREFIX}/bin/perf_analyzer) - endif() - set(linux_wheel_stamp_file "linux_stamp.whl") - add_custom_command( - OUTPUT "${linux_wheel_stamp_file}" - COMMAND python3 - ARGS - "${CMAKE_CURRENT_SOURCE_DIR}/build_wheel.py" - --dest-dir "${CMAKE_CURRENT_BINARY_DIR}/linux" - --linux - ${perf_analyzer_arg} - DEPENDS ${LINUX_WHEEL_DEPENDS} - ) - - add_custom_target( - linux-client-wheel ALL - DEPENDS - "${linux_wheel_stamp_file}" - ) -endif() # NOT WIN32 if(${TRITON_ENABLE_PYTHON_GRPC}) add_dependencies( @@ -127,13 +100,6 @@ if(${TRITON_ENABLE_PYTHON_GRPC}) grpc-service-py-library proto-py-library ) - if (NOT WIN32) - add_dependencies( - linux-client-wheel - grpc-service-py-library proto-py-library - ) - endif() # NOT WIN32 - file( GLOB generated-py ${CMAKE_CURRENT_BINARY_DIR}/../../core/*_pb2.py @@ -151,9 +117,3 @@ install( CODE "file(INSTALL \${_Wheel} DESTINATION \"${CMAKE_INSTALL_PREFIX}/python\")" ) -if (NOT WIN32) - install( - CODE "file(GLOB _Wheel \"${CMAKE_CURRENT_BINARY_DIR}/linux/triton*.whl\")" - CODE "file(INSTALL \${_Wheel} DESTINATION \"${CMAKE_INSTALL_PREFIX}/python\")" - ) -endif() # NOT WIN32 diff --git a/src/python/library/build_wheel.py b/src/python/library/build_wheel.py index 73f727d0d..7d1455002 100755 --- a/src/python/library/build_wheel.py +++ b/src/python/library/build_wheel.py @@ -77,20 +77,6 @@ def sed(pattern, replace, source, dest=None): parser.add_argument( "--dest-dir", type=str, required=True, help="Destination directory." ) - parser.add_argument( - "--linux", - action="store_true", - required=False, - help="Include linux specific artifacts.", - ) - parser.add_argument( - "--perf-analyzer", - type=str, - required=False, - default=None, - help="perf-analyzer path.", - ) - FLAGS = parser.parse_args() FLAGS.triton_version = None @@ -118,9 +104,8 @@ def sed(pattern, replace, source, dest=None): cpdir("tritonhttpclient", os.path.join(FLAGS.whl_dir, "tritonhttpclient")) if os.path.isdir("tritongrpcclient"): cpdir("tritongrpcclient", os.path.join(FLAGS.whl_dir, "tritongrpcclient")) - if FLAGS.linux: - if os.path.isdir("tritonshmutils"): - cpdir("tritonshmutils", os.path.join(FLAGS.whl_dir, "tritonshmutils")) + if os.path.isdir("tritonshmutils"): + cpdir("tritonshmutils", os.path.join(FLAGS.whl_dir, "tritonshmutils")) if os.path.isdir("tritonclient/grpc"): cpdir("tritonclient/grpc", os.path.join(FLAGS.whl_dir, "tritonclient/grpc")) @@ -169,50 +154,32 @@ def sed(pattern, replace, source, dest=None): os.path.join(FLAGS.whl_dir, "tritonclient/utils/_shared_memory_tensor.py"), ) - if FLAGS.linux: + if os.path.isdir("tritonclient/utils/shared_memory"): cpdir( "tritonclient/utils/shared_memory", os.path.join(FLAGS.whl_dir, "tritonclient/utils/shared_memory"), ) + if os.path.isdir("tritonclient/utils/cuda_shared_memory"): cpdir( "tritonclient/utils/cuda_shared_memory", os.path.join(FLAGS.whl_dir, "tritonclient/utils/cuda_shared_memory"), ) - # Copy the pre-compiled perf_analyzer binary - if FLAGS.perf_analyzer is not None: - # The permission bits need to be copied to along with the executable - shutil.copy( - FLAGS.perf_analyzer, os.path.join(FLAGS.whl_dir, "perf_analyzer") - ) - - # Create a symbolic link for backwards compatibility - if not os.path.exists(os.path.join(FLAGS.whl_dir, "perf_client")): - os.symlink("perf_analyzer", os.path.join(FLAGS.whl_dir, "perf_client")) - shutil.copyfile("LICENSE.txt", os.path.join(FLAGS.whl_dir, "LICENSE.txt")) shutil.copyfile("setup.py", os.path.join(FLAGS.whl_dir, "setup.py")) cpdir("requirements", os.path.join(FLAGS.whl_dir, "requirements")) os.chdir(FLAGS.whl_dir) - print("=== Building wheel") - if FLAGS.linux: - if os.uname().machine == "aarch64": - platform_name = "manylinux2014_aarch64" - elif os.uname().machine == "ppc64le": - platform_name = "manylinux2014_ppc64le" - else: - platform_name = "manylinux1_x86_64" - args = ["python3", "setup.py", "bdist_wheel", "--plat-name", platform_name] - else: - args = ["python3", "setup.py", "bdist_wheel"] - wenv = os.environ.copy() wenv["VERSION"] = FLAGS.triton_version - p = subprocess.Popen(args, env=wenv) + + print("=== Building wheel") + p = subprocess.Popen( + ["python3", "setup.py", "bdist_wheel"], + env=wenv, + ) p.wait() fail_if(p.returncode != 0, "setup.py failed") - cpdir("dist", FLAGS.dest_dir) print("=== Output wheel file is in: {}".format(FLAGS.dest_dir)) diff --git a/src/python/library/setup.py b/src/python/library/setup.py index fd8304619..0f0398ea0 100755 --- a/src/python/library/setup.py +++ b/src/python/library/setup.py @@ -81,8 +81,6 @@ def req_file(filename, folder="requirements"): data_files = [ ("", ["LICENSE.txt"]), ] -if (PLATFORM_FLAG != "any") and ("@TRITON_PACKAGE_PERF_ANALYZER@" == "ON"): - data_files += [("bin", ["perf_analyzer", "perf_client"])] setup( name="tritonclient",