编译triton python-backend

python-backend编译

手动git依赖

git clone -b v2.6 --depth 5 git@github.com:pybind/pybind11.git

git clone -b v0.5 git@github.com:dmlc/dlpack.git

git clone -b r22.10 https://github.com/triton-inference-server/backend.git

git clone -b r22.10 https://github.com/triton-inference-server/core.git

git clone -b r22.10 git@github.com:triton-inference-server/common.git

wget -r https://boostorg.jfrog.io/artifactory/main/release/1.76.0/source/boost_1_76_0.tar.gz
mkdir github

把下载的依赖全部放进去

修改CMakeLists

修改依赖

FetchContent_Declare(
  repo-common
  SOURCE_DIR /workspace/python_backend/github/common
)
FetchContent_Declare(
  repo-core
  SOURCE_DIR /workspace/python_backend/github/core
)
FetchContent_Declare(
  repo-backend
  SOURCE_DIR /workspace/python_backend/github/backend
)
FetchContent_MakeAvailable(repo-common repo-core repo-backend)


ExternalProject_Add(
  boostorg
  URL file:///workspace/python_backend/github/boost_1_76_0.tar.gz
  
  PREFIX "boost-src"
  CONFIGURE_COMMAND ${CMAKE_COMMAND} -E copy_directory
                    <SOURCE_DIR>/boost/ ${CMAKE_BINARY_DIR}/boost
  INSTALL_COMMAND ""
  BUILD_COMMAND ""
)
set(boostorg_INCLUDE_DIRS "${CMAKE_BINARY_DIR}/boost/")

外部依赖都改成类似这样

修改pybind11的CMakeLists

这一行后面加上 set(DPYTHON_EXECUTABLE=/usr/include/python3.8)
环境有什么版本什么路径就写什么
否则默认python3.9

cmake_dependent_option(PYBIND11_FINDPYTHON "Force new FindPython" OFF
                       "NOT CMAKE_VERSION VERSION_LESS 3.12" OFF)


set(DPYTHON_EXECUTABLE=/usr/)

执行编译

mkdir build
cd build
cmake -DTRITON_ENABLE_GPU=ON -DPYTHON_EXECUTABLE=/usr/bin/python3.8 -DCMAKE_INSTALL_PREFIX:PATH=`pwd`/install ..

make install

替换python后端

install/backends/python整个文件替换掉原本的/opt/tritonserver/backends/python

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值