-
Notifications
You must be signed in to change notification settings - Fork 13
/
build_triton_cpu_libs.sh
executable file
·52 lines (45 loc) · 1.74 KB
/
build_triton_cpu_libs.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#!/bin/bash
# Copyright (c) 2023, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# This script will build the Tensorflow and OpenVino backends for Triton necessary to run
# the Triton-CPU benchmarks
# Set up build directory
build_dir="build/tmp/tritonbuild"
build_branch="mlperf-inference-v2.0-cpu"
mkdir -p ${build_dir}
pushd ${build_dir}
rm -fr *
# Clone Triton server repository
git clone --single-branch --depth=1 -b ${build_branch} https://github.com/triton-inference-server/s\
erver.git
# Build for CPU, TensorFlow2 and OpenVINO backends only
rm -fr build
mkdir build
cd server
./build.py -v --build-dir=${build_dir}/build --cmake-dir=/w\
orkspace/build --enable-logging --repo-tag=common:${build_branch} --repo-tag=core:${\
build_branch} --repo-tag=backend:${build_branch} --repo-tag=thirdparty:${build_branch} --endpoint=g\
rpc --endpoint=http --backend=openvino:${build_branch} --build-multiple-openvino
# Copy out built libraries to host
popd
mkdir -p prebuilt_triton_libs
id=$(docker create tritonserver:latest)
if [ ! -d "backends" ]
then
docker cp $id:/opt/tritonserver/backends backends
fi
mv backends/* .
rm -r backends
docker cp $id:/opt/tritonserver/lib/libtritonserver.so prebuilt_triton_libs
docker rm -v $id