1d6bf36034
Update tools including onnx-graphsurgeon(v0.3.25), Polygraphy(v0.43.1), tensorflow-quantization(v0.2.0) Update onnx-tensorrt(8.5GA) Mass merge sample, plugin, demo, python changes for TRT-8.5 GA release Update demoBERT benchmark data for TensorRT 8.5.1 Signed-off-by: Simeng Liu <simengl@nvidia.com> Signed-off-by: Simeng Liu <simengl@nvidia.com>
TensorRT Python Bindings
Installation
Download pybind11
Create a directory for external sources and download pybind11 into it.
export EXT_PATH=~/external
mkdir -p $EXT_PATH && cd $EXT_PATH
git clone https://github.com/pybind/pybind11.git
Download Python headers
Add Main Headers
- Get the source code from the official python sources
- Copy the contents of the
Include/directory into$EXT_PATH/pythonX.Y/include/directory.
Add PyConfig.h
- Download the deb package for the desired platform from here.
Typical plaforms include
x86_64(amd64),aarch64(arm64), andppc64le(ppc64el) - Unpack the debian with
ar x <libpython...>.deb - Unpack the contained
data.tar.xzwithtar -xvf - Copy the
./usr/include/<platform>/directory into the$$EXT_PATH/pythonX.Y/include/directory here. It should only contain a single file -pyconfig.h
Build Python bindings
Use build.sh to generate the installable wheels for intended python version and target architecture.
Example: for python 3.8 x86_64 wheel,
cd $TRT_OSSPATH/python
PYTHON_MAJOR_VERSION=3 PYTHON_MINOR_VERSION=8 TARGET_ARCHITECTURE=x86_64 ./build.sh
Install the python wheel
python3 -m pip install build/dist/tensorrt-*.whl