Skip to content

Commit 35477bd

Browse files
ttyiorajeevsrao
authored andcommitted
Mass integration for 23.08 release
1. update pytorch-quantization to 2.1.3 2. update SD to support torch 2.x 3. update docker container 4. misc fixed in samples Signed-off-by: Vincent Huang <[email protected]>
1 parent a167852 commit 35477bd

File tree

85 files changed

+560
-314
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

85 files changed

+560
-314
lines changed

README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ To build the TensorRT-OSS components, you will first need the following software
3131
**System Packages**
3232
* [CUDA](https://developer.nvidia.com/cuda-toolkit)
3333
* Recommended versions:
34-
* cuda-12.0.1 + cuDNN-8.8
34+
* cuda-12.2.0 + cuDNN-8.8
3535
* cuda-11.8.0 + cuDNN-8.8
3636
* [GNU make](https://ftp.gnu.org/gnu/make/) >= v4.1
3737
* [cmake](https://github.com/Kitware/CMake/releases) >= v3.13
@@ -99,9 +99,9 @@ For Linux platforms, we recommend that you generate a docker container for build
9999
1. #### Generate the TensorRT-OSS build container.
100100
The TensorRT-OSS build container can be generated using the supplied Dockerfiles and build scripts. The build containers are configured for building TensorRT OSS out-of-the-box.
101101
102-
**Example: Ubuntu 20.04 on x86-64 with cuda-12.0 (default)**
102+
**Example: Ubuntu 20.04 on x86-64 with cuda-12.1 (default)**
103103
```bash
104-
./docker/build.sh --file docker/ubuntu-20.04.Dockerfile --tag tensorrt-ubuntu20.04-cuda12.0
104+
./docker/build.sh --file docker/ubuntu-20.04.Dockerfile --tag tensorrt-ubuntu20.04-cuda12.1
105105
```
106106
**Example: CentOS/RedHat 7 on x86-64 with cuda-11.8**
107107
```bash
@@ -119,7 +119,7 @@ For Linux platforms, we recommend that you generate a docker container for build
119119
2. #### Launch the TensorRT-OSS build container.
120120
**Example: Ubuntu 20.04 build container**
121121
```bash
122-
./docker/launch.sh --tag tensorrt-ubuntu20.04-cuda12.0 --gpus all
122+
./docker/launch.sh --tag tensorrt-ubuntu20.04-cuda12.1 --gpus all
123123
```
124124
> NOTE:
125125
<br> 1. Use the `--tag` corresponding to build container generated in Step 1.
@@ -130,7 +130,7 @@ For Linux platforms, we recommend that you generate a docker container for build
130130
## Building TensorRT-OSS
131131
* Generate Makefiles and build.
132132
133-
**Example: Linux (x86-64) build with default cuda-12.0**
133+
**Example: Linux (x86-64) build with default cuda-12.1**
134134
```bash
135135
cd $TRT_OSSPATH
136136
mkdir -p build && cd build
@@ -146,7 +146,7 @@ For Linux platforms, we recommend that you generate a docker container for build
146146
export PATH="/opt/rh/devtoolset-8/root/bin:${PATH}"
147147
```
148148
149-
**Example: Linux (aarch64) build with default cuda-12.0**
149+
**Example: Linux (aarch64) build with default cuda-12.1**
150150
```bash
151151
cd $TRT_OSSPATH
152152
mkdir -p build && cd build
@@ -174,7 +174,7 @@ For Linux platforms, we recommend that you generate a docker container for build
174174
> NOTE: The latest JetPack SDK v5.1 only supports TensorRT 8.5.2.
175175
176176
> NOTE:
177-
<br> 1. The default CUDA version used by CMake is 12.0.1. To override this, for example to 11.8, append `-DCUDA_VERSION=11.8` to the cmake command.
177+
<br> 1. The default CUDA version used by CMake is 11.4.1. To override this, for example to 11.8, append `-DCUDA_VERSION=11.8` to the cmake command.
178178
<br> 2. If samples fail to link on CentOS7, create this symbolic link: `ln -s $TRT_OUT_DIR/libnvinfer_plugin.so $TRT_OUT_DIR/libnvinfer_plugin.so.8`
179179
* Required CMake build arguments are:
180180
- `TRT_LIB_DIR`: Path to the TensorRT installation directory containing libraries.

demo/Diffusion/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ cd TensorRT
1616
Install nvidia-docker using [these intructions](https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/install-guide.html#docker).
1717

1818
```bash
19-
docker run --rm -it --gpus all -v $PWD:/workspace nvcr.io/nvidia/pytorch:23.02-py3 /bin/bash
19+
docker run --rm -it --gpus all -v $PWD:/workspace nvcr.io/nvidia/pytorch:23.06-py3 /bin/bash
2020
```
2121

2222
### Install latest TensorRT release

demo/Diffusion/demo_img2img.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ def parseArgs():
9494
force_export=args.force_onnx_export, force_optimize=args.force_onnx_optimize, \
9595
force_build=args.force_engine_build, \
9696
static_batch=args.build_static_batch, static_shape=not args.build_dynamic_shape, \
97-
enable_refit=args.build_enable_refit, enable_preview=args.build_preview_features, enable_all_tactics=args.build_all_tactics, \
97+
enable_refit=args.build_enable_refit, enable_all_tactics=args.build_all_tactics, \
9898
timing_cache=args.timing_cache, onnx_refit_dir=args.onnx_refit_dir)
9999
demo.loadResources(image_height, image_width, batch_size, args.seed)
100100

demo/Diffusion/demo_inpaint.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ def parseArgs():
104104
force_export=args.force_onnx_export, force_optimize=args.force_onnx_optimize, \
105105
force_build=args.force_engine_build, \
106106
static_batch=args.build_static_batch, static_shape=not args.build_dynamic_shape, \
107-
enable_preview=args.build_preview_features, enable_all_tactics=args.build_all_tactics, \
107+
enable_all_tactics=args.build_all_tactics, \
108108
timing_cache=args.timing_cache)
109109
demo.loadResources(image_height, image_width, batch_size, args.seed)
110110

demo/Diffusion/demo_txt2img.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ def parseArgs():
8282
force_export=args.force_onnx_export, force_optimize=args.force_onnx_optimize, \
8383
force_build=args.force_engine_build, \
8484
static_batch=args.build_static_batch, static_shape=not args.build_dynamic_shape, \
85-
enable_refit=args.build_enable_refit, enable_preview=args.build_preview_features, enable_all_tactics=args.build_all_tactics, \
85+
enable_refit=args.build_enable_refit, enable_all_tactics=args.build_all_tactics, \
8686
timing_cache=args.timing_cache, onnx_refit_dir=args.onnx_refit_dir)
8787
demo.loadResources(image_height, image_width, batch_size, args.seed)
8888

demo/Diffusion/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@ onnxruntime==1.14.1
1111
onnx-graphsurgeon==0.3.26
1212
polygraphy==0.47.1
1313
scipy
14-
torch<2.0.0
14+
torch
1515
transformers==4.26.1

demo/Diffusion/stable_diffusion_pipeline.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,6 @@ def loadEngines(
195195
static_batch=False,
196196
static_shape=True,
197197
enable_refit=False,
198-
enable_preview=False,
199198
enable_all_tactics=False,
200199
timing_cache=None,
201200
onnx_refit_dir=None,
@@ -229,8 +228,6 @@ def loadEngines(
229228
Build engine only for specified opt_image_height & opt_image_width. Default = True.
230229
enable_refit (bool):
231230
Build engines with refit option enabled.
232-
enable_preview (bool):
233-
Enable TensorRT preview features.
234231
enable_all_tactics (bool):
235232
Enable all tactic sources during TensorRT engine builds.
236233
timing_cache (str):
@@ -304,7 +301,6 @@ def loadEngines(
304301
static_batch=static_batch, static_shape=static_shape
305302
),
306303
enable_refit=enable_refit,
307-
enable_preview=enable_preview,
308304
enable_all_tactics=enable_all_tactics,
309305
timing_cache=timing_cache,
310306
workspace_size=self.max_workspace_size)

demo/Diffusion/utilities.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ def map_name(name):
190190
print("Failed to refit!")
191191
exit(0)
192192

193-
def build(self, onnx_path, fp16, input_profile=None, enable_refit=False, enable_preview=False, enable_all_tactics=False, timing_cache=None, workspace_size=0):
193+
def build(self, onnx_path, fp16, input_profile=None, enable_refit=False, enable_all_tactics=False, timing_cache=None, workspace_size=0):
194194
print(f"Building TensorRT engine for {onnx_path}: {self.engine_path}")
195195
p = Profile()
196196
if input_profile:
@@ -200,10 +200,6 @@ def build(self, onnx_path, fp16, input_profile=None, enable_refit=False, enable_
200200

201201
config_kwargs = {}
202202

203-
config_kwargs['preview_features'] = [trt.PreviewFeature.DISABLE_EXTERNAL_TACTIC_SOURCES_FOR_CORE_0805]
204-
if enable_preview:
205-
# Faster dynamic shapes made optional since it increases engine build time.
206-
config_kwargs['preview_features'].append(trt.PreviewFeature.FASTER_DYNAMIC_SHAPES_0805)
207203
if workspace_size > 0:
208204
config_kwargs['memory_pool_limits'] = {trt.MemoryPoolType.WORKSPACE: workspace_size}
209205
if not enable_all_tactics:
@@ -1201,7 +1197,6 @@ def add_arguments(parser):
12011197
parser.add_argument('--build-static-batch', action='store_true', help="Build TensorRT engines with fixed batch size.")
12021198
parser.add_argument('--build-dynamic-shape', action='store_true', help="Build TensorRT engines with dynamic image shapes.")
12031199
parser.add_argument('--build-enable-refit', action='store_true', help="Enable Refit option in TensorRT engines during build.")
1204-
parser.add_argument('--build-preview-features', action='store_true', help="Build TensorRT engines with preview features.")
12051200
parser.add_argument('--build-all-tactics', action='store_true', help="Build TensorRT engines using all tactic sources.")
12061201
parser.add_argument('--timing-cache', default=None, type=str, help="Path to the precached timing measurements to accelerate build.")
12071202

demo/HuggingFace/GPT2/GPT2ModelConfig.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ def add_args(parser: argparse.ArgumentParser) -> None:
5151
network_group.add_argument(
5252
"--num-beams", type=int, default=1, help="Enables beam search during decoding."
5353
)
54-
54+
5555
network_group.add_argument(
5656
"--fp16", action="store_true", help="Enables fp16 TensorRT tactics."
5757
)
@@ -84,7 +84,7 @@ def add_benchmarking_args(parser: argparse.ArgumentParser) -> None:
8484

8585

8686
class GPT2ModelTRTConfig(NNConfig):
87-
TARGET_MODELS = ["gpt2", "gpt2-medium", "gpt2-large", "gpt2-xl", "EleutherAI/gpt-j-6B"]
87+
TARGET_MODELS = ["gpt2", "gpt2-medium", "gpt2-large", "gpt2-xl", "EleutherAI/gpt-j-6b"]
8888
NETWORK_DECODER_SEGMENT_NAME = "gpt2_decoder"
8989
NETWORK_SEGMENTS = [NETWORK_DECODER_SEGMENT_NAME]
9090
NETWORK_FULL_NAME = "full"

docker/centos-7.Dockerfile

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# limitations under the License.
1616
#
1717

18-
ARG CUDA_VERSION=12.0.1
18+
ARG CUDA_VERSION=12.1.1
1919

2020
FROM nvidia/cuda:${CUDA_VERSION}-cudnn8-devel-centos7
2121
LABEL maintainer="NVIDIA CORPORATION"
@@ -60,7 +60,11 @@ RUN if [ "${CUDA_VERSION}" = "10.2" ] ; then \
6060
libnvinfer-lean-devel-=${v} libnvinfer-vc-plugin8-=${v} libnvinfer-vc-plugin-devel-=${v} \
6161
libnvinfer-headers-devel-=${v} libnvinfer-headers-plugin-devel-=${v}; \
6262
else \
63-
v="${TRT_VERSION}-1.cuda${CUDA_VERSION%.*}" &&\
63+
ver="${CUDA_VERSION%.*}" &&\
64+
if [ "${ver%.*}" = "12" ] ; then \
65+
ver="12.0"; \
66+
fi &&\
67+
v="${TRT_VERSION}-1.cuda${ver}" &&\
6468
yum-config-manager --add-repo https://developer.download.nvidia.com/compute/cuda/repos/rhel7/x86_64/cuda-rhel7.repo &&\
6569
yum -y install libnvinfer8-${v} libnvparsers8-${v} libnvonnxparsers8-${v} libnvinfer-plugin8-${v} \
6670
libnvinfer-devel-${v} libnvparsers-devel-${v} libnvonnxparsers-devel-${v} libnvinfer-plugin-devel-${v} \

0 commit comments

Comments
 (0)