Skip to content

Commit 5b4757a

Browse files
committed
Merge branch 'main' into sdpa_decomp
2 parents 0562381 + 002bacf commit 5b4757a

File tree

257 files changed

+1296
-1270
lines changed

Some content is hidden

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

257 files changed

+1296
-1270
lines changed

.bazelrc

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,12 @@ build:windows --cxxopt="/GS-" --cxxopt="/std:c++17" --cxxopt="/permissive-"
3030
build:windows --cxxopt="/wd4244" --cxxopt="/wd4267" --cxxopt="/wd4819"
3131
build:windows --features=windows_export_all_symbols
3232

33-
build:python --cxxopt="-D_GLIBCXX_USE_CXX11_ABI=0"
34-
build:python --linkopt="-D_GLIBCXX_USE_CXX11_ABI=0"
35-
build:python --define=abi=pre_cxx11_abi
3633
build:python --define=target_lang=python
3734

35+
build:cxx11_abi --cxxopt="-D_GLIBCXX_USE_CXX11_ABI=1"
36+
build:cxx11_abi --linkopt="-D_GLIBCXX_USE_CXX11_ABI=1"
37+
build:cxx11_abi --define=abi=cxx11_abi
38+
3839
build:pre_cxx11_abi --cxxopt="-D_GLIBCXX_USE_CXX11_ABI=0"
3940
build:pre_cxx11_abi --linkopt="-D_GLIBCXX_USE_CXX11_ABI=0"
4041
build:pre_cxx11_abi --define=abi=pre_cxx11_abi

.github/scripts/generate_binary_build_matrix.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -469,7 +469,6 @@ def generate_wheels_matrix(
469469
ret: List[Dict[str, Any]] = []
470470
for python_version in python_versions:
471471
for arch_version in arches:
472-
473472
# TODO: Enable Python 3.13 support for ROCM
474473
if arch_version in ROCM_ARCHES and python_version == "3.13":
475474
continue

.github/workflows/docgen.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ jobs:
4242
run: echo "sha=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
4343
- name: Build Python Package
4444
env:
45-
USE_CXX11_ABI: 1
45+
USE_PRE_CXX11_ABI: 0
4646
run: |
4747
python3 -m pip install --pre . --extra-index-url https://download.pytorch.org/whl/nightly/cu126
4848
- name: Generate New Docs

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ Environment variables supported by nox
7575
```
7676
PYT_PATH - To use different PYTHONPATH than system installed Python packages
7777
TOP_DIR - To set the root directory of the noxfile
78-
USE_CXX11 - To use cxx11_abi (Defaults to 0)
78+
USE_PRE_CXX11 - To use pre_cxx11_abi (Defaults to 0)
7979
USE_HOST_DEPS - To use host dependencies for tests (Defaults to 0)
8080
```
8181

core/conversion/converters/impl/batch_norm.cpp

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -134,9 +134,14 @@ auto batch_norm_registrations TORCHTRT_UNUSED =
134134

135135
auto eps = static_cast<float>(args[7].unwrapToDouble(1e-5f));
136136

137-
auto scales = args[1].unwrapToTensor(at::ones(shape[1], options)).cpu().contiguous();
138-
auto bias = args[2].unwrapToTensor(at::zeros(shape[1], options)).cpu().contiguous();
139-
137+
auto scales = at::ones(shape[1], options);
138+
if (!args[1].IValue()->isNone()) {
139+
scales = args[1].unwrapToTensor(at::ones(shape[1], options)).cpu().contiguous();
140+
}
141+
auto bias = at::zeros(shape[1], options);
142+
if (!args[2].IValue()->isNone()) {
143+
bias = args[2].unwrapToTensor(at::zeros(shape[1], options)).cpu().contiguous();
144+
}
140145
// track_running_stats=True
141146
if (!args[3].IValue()->isNone() || !args[4].IValue()->isNone()) {
142147
auto running_mean = args[3].unwrapToTensor();
@@ -154,6 +159,8 @@ auto batch_norm_registrations TORCHTRT_UNUSED =
154159
return true;
155160
}
156161

162+
// Not sure this actually does something since the cudnn_enabled is from the PyTorch context.
163+
// We need cuDNN either way to run this converter
157164
auto cudnn_enabled = static_cast<bool>(args[8].unwrapToBool(false));
158165
if (!cudnn_enabled) {
159166
LOG_DEBUG(
@@ -162,7 +169,7 @@ auto batch_norm_registrations TORCHTRT_UNUSED =
162169
so for some functionalities, users need to install correct \
163170
cuDNN version by themselves. Please see our support matrix \
164171
here: https://docs.nvidia.com/deeplearning/tensorrt/support-matrix/index.html.");
165-
return false;
172+
// return false;
166173
}
167174

168175
const int relu = 0;

core/util/prelude.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
// A collection of headers from util that will typically get included in most
44
// files
5+
#include <cstdint>
56
#include "core/util/Exception.h"
67
#include "core/util/build_info.h"
78
#include "core/util/jit_util.h"

docker/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ RUN test -n "$TENSORRT_VERSION" || (echo "No tensorrt version specified, please
1212
ARG PYTHON_VERSION=3.10
1313
ENV PYTHON_VERSION=${PYTHON_VERSION}
1414

15-
ARG USE_CXX11_ABI
16-
ENV USE_CXX11=${USE_CXX11_ABI}
15+
ARG USE_PRE_CXX11_ABI
16+
ENV USE_PRE_CXX11=${USE_PRE_CXX11_ABI}
1717
ENV DEBIAN_FRONTEND=noninteractive
1818

1919
# Install basic dependencies

docker/README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,30 @@
11
# Building a Torch-TensorRT container
22

3-
* Use `Dockerfile` to build a container which provides the exact development environment that our master branch is usually tested against.
3+
* Use `Dockerfile` to build a container which provides the exact development environment that our main branch is usually tested against.
44

55
* The `Dockerfile` currently uses <a href="https://github.com/bazelbuild/bazelisk">Bazelisk</a> to select the Bazel version, and uses the exact library versions of Torch and CUDA listed in <a href="https://github.com/pytorch/TensorRT#dependencies">dependencies</a>.
66
* The desired versions of TensorRT must be specified as build-args, with major and minor versions as in: `--build-arg TENSORRT_VERSION=a.b`
7-
* [**Optional**] The desired base image be changed by explicitly setting a base image, as in `--build-arg BASE_IMG=nvidia/cuda:11.8.0-devel-ubuntu22.04`, though this is optional
7+
* [**Optional**] The desired base image be changed by explicitly setting a base image, as in `--build-arg BASE_IMG=nvidia/cuda:11.8.0-devel-ubuntu22.04`, though this is optional.
88
* [**Optional**] Additionally, the desired Python version can be changed by explicitly setting a version, as in `--build-arg PYTHON_VERSION=3.10`, though this is optional as well.
99

10-
* This `Dockerfile` installs `pre-cxx11-abi` versions of Pytorch and builds Torch-TRT using `pre-cxx11-abi` libtorch as well.
10+
* This `Dockerfile` installs `cxx11-abi` versions of Pytorch and builds Torch-TRT using `cxx11-abi` libtorch as well. As of torch 2.7, torch requires `cxx11-abi` for all CUDA 11.8, 12.4, and 12.6.
1111

12-
Note: By default the container uses the `pre-cxx11-abi` version of Torch + Torch-TRT. If you are using a workflow that requires a build of PyTorch on the CXX11 ABI (e.g. using the PyTorch NGC containers as a base image), add the Docker build argument: `--build-arg USE_CXX11_ABI=1`
12+
Note: By default the container uses the `cxx11-abi` version of Torch + Torch-TRT. If you are using a workflow that requires a build of PyTorch on the PRE CXX11 ABI, please add the Docker build argument: `--build-arg USE_PRE_CXX11_ABI=1`
1313

1414
### Dependencies
1515

1616
* Install nvidia-docker by following https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/install-guide.html#docker
1717

1818
### Instructions
1919

20-
- The example below uses TensorRT 10.6.0.26
20+
- The example below uses TensorRT 10.7.0.23
2121
- See <a href="https://github.com/pytorch/TensorRT#dependencies">dependencies</a> for a list of current default dependencies.
2222

2323
> From root of Torch-TensorRT repo
2424
2525
Build:
2626
```
27-
DOCKER_BUILDKIT=1 docker build --build-arg TENSORRT_VERSION=10.6.0 -f docker/Dockerfile -t torch_tensorrt:latest .
27+
DOCKER_BUILDKIT=1 docker build --build-arg TENSORRT_VERSION=10.7.0 -f docker/Dockerfile -t torch_tensorrt:latest .
2828
```
2929

3030
Run:

docker/dist-build.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ set -x
44

55
TOP_DIR=$(cd $(dirname $0); pwd)/..
66

7-
if [[ -z "${USE_CXX11}" ]]; then
7+
if [[ -z "${USE_PRE_CXX11}" ]]; then
88
BUILD_CMD="python -m pip wheel . --extra-index-url https://download.pytorch.org/whl/nightly/cu124 -w dist"
99
else
10-
BUILD_CMD="python -m pip wheel . --config-setting="--build-option=--use-cxx11-abi" --extra-index-url https://download.pytorch.org/whl/nightly/cu124 -w dist"
10+
BUILD_CMD="python -m pip wheel . --config-setting="--build-option=--use-pre-cxx11-abi" --extra-index-url https://download.pytorch.org/whl/nightly/cu124 -w dist"
1111
fi
1212

1313
# TensorRT restricts our pip version

docs/_cpp_api/classtorch__tensorrt_1_1DataType.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
<meta name="viewport" content="width=device-width, initial-scale=1.0">
1212

13-
<title>Class DataType &mdash; Torch-TensorRT v2.7.0.dev0+d6be4ba documentation</title>
13+
<title>Class DataType &mdash; Torch-TensorRT v2.7.0.dev0+f2a38f5 documentation</title>
1414

1515

1616

@@ -293,7 +293,7 @@
293293

294294

295295
<div class="version">
296-
v2.7.0.dev0+d6be4ba
296+
v2.7.0.dev0+f2a38f5
297297
</div>
298298

299299

0 commit comments

Comments
 (0)