Skip to content

Commit 38685a0

Browse files
committed
Merge branch 'readme' into 'release/1.0'
doc: Update installation instructions based on ABI and platforms See merge request adlsa/TRTorch!22
2 parents 93e4c4a + 8c4224b commit 38685a0

File tree

3 files changed

+17
-10
lines changed

3 files changed

+17
-10
lines changed

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ import torch_tensorrt
5656
5757
...
5858
59-
trt_ts_module = torch_tensorrt.compile(torch_script_module,
59+
trt_ts_module = torch_tensorrt.compile(torch_script_module,
6060
inputs = [example_tensor, # Provide example tensor for input shape or...
6161
torch_tensorrt.Input( # Specify input object with shape and dtype
6262
min_shape=[1, 3, 224, 224],
@@ -204,9 +204,10 @@ bazel build //:libtorchtrt --compilation_mode=dbg
204204
```
205205

206206
### Native compilation on NVIDIA Jetson AGX
207+
We performed end to end testing on Jetson platform using Jetpack SDK 4.6.
207208

208209
``` shell
209-
bazel build //:libtorchtrt --distdir third_party/dist_dir/aarch64-linux-gnu
210+
bazel build //:libtorchtrt --platforms //toolchains:jetpack_4.6
210211
```
211212

212213
> Note: Please refer [installation](docs/tutorials/installation.html) instructions for Pre-requisites

docsrc/tutorials/creating_torchscript_module_in_python.rst

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22

33
Creating a TorchScript Module
44
------------------------------
5-
6-
Once you have a trained model you want to compile with Torch-TensorRT, you need to start by converting that model from Python code to TorchScript code.
5+
TorchScript is a way to create serializable and optimizable models from PyTorch code.
76
PyTorch has detailed documentation on how to do this https://pytorch.org/tutorials/beginner/Intro_to_TorchScript_tutorial.html but briefly here is the
87
here is key background information and the process:
98

@@ -65,7 +64,7 @@ To trace an instance of our LeNet module, we can call ``torch.jit.trace`` with a
6564

6665
.. code-block:: python
6766
68-
import torch.jit
67+
import torch
6968
7069
model = LeNet()
7170
input_data = torch.empty([1,1,32,32])
@@ -77,7 +76,7 @@ include these components. We can run the script compiler on our LeNet module by
7776

7877
.. code-block:: python
7978
80-
import torch.jit
79+
import torch
8180
8281
model = LeNet()
8382
script_model = torch.jit.script(model)
@@ -131,7 +130,7 @@ For either traced or scripted modules, you can save the module to disk with the
131130

132131
.. code-block:: python
133132
134-
import torch.jit
133+
import torch
135134
136135
model = LeNet()
137136
script_model = torch.jit.script(model)

py/README.md

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,16 @@ results = compiled_trt_model(data.half())
3131

3232
## Installation
3333

34-
```
35-
python3 setup.py install
36-
```
34+
| ABI / Platform | Installation command |
35+
| --------------------------------------- | ------------------------------------------------------------ |
36+
| Pre CXX11 ABI (Linux x86_64) | python3 setup.py install --release |
37+
| CXX ABI (Linux x86_64) | python3 setup.py install --use-cxx11-abi --release |
38+
| Pre CXX11 ABI (Jetson platform aarch64) | python3 setup.py install --release --jetpack-version 4.6 |
39+
| CXX11 ABI (Jetson platform aarch64) | python3 setup.py install --release --jetpack-version 4.6 --use-cxx11-abi |
40+
41+
For Linux x86_64 platform, Pytorch libraries default to pre cxx11 abi. So, please use `python3 setup.py install --release`.
42+
43+
On Jetson platforms, NVIDIA hosts <a href="https://forums.developer.nvidia.com/t/pytorch-for-jetson-version-1-10-now-available/72048">pre-built Pytorch wheel files</a>. These wheel files are built with CXX11 ABI. So on jetson platforms, please use `python3 setup.py install --release --jetpack-version 4.6`
3744

3845
## Under the Hood
3946

0 commit comments

Comments
 (0)