Skip to content

Commit ffb20e4

Browse files
authored
Merge branch 'master' into partitioning_ctx
2 parents 1a4084b + 1cf0476 commit ffb20e4

File tree

326 files changed

+24743
-9474
lines changed

Some content is hidden

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

326 files changed

+24743
-9474
lines changed

.circleci/config.yml

Lines changed: 155 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,81 @@ commands:
1919
sudo wget -q https://github.com/bazelbuild/bazel/releases/download/<< parameters.version >>/bazel-<< parameters.version >>-linux-<< parameters.platform >> -O /usr/bin/bazel
2020
sudo chmod a+x /usr/bin/bazel
2121
22+
install-cmake:
23+
description: Install CMake.
24+
parameters:
25+
cache:
26+
default: true
27+
description: Whether or not to cache the installation.
28+
type: boolean
29+
cache-key:
30+
default: v1
31+
description: String to use in cache key. Typically overridden when needed to bust cache.
32+
type: string
33+
install-dir:
34+
default: $HOME/cmake
35+
description: The path to install CMake to.
36+
type: string
37+
version:
38+
default: 3.18.2
39+
description: The version of CMake to install.
40+
type: string
41+
steps:
42+
- when:
43+
condition:
44+
equal:
45+
- << parameters.cache >>
46+
- true
47+
steps:
48+
- run:
49+
command: mkdir -pv << parameters.install-dir >>
50+
name: Prep cache restore
51+
- restore_cache:
52+
keys:
53+
- cmake-<< parameters.cache-key >>-<< parameters.version >>
54+
- run:
55+
command: |
56+
echo 'export PATH="<< parameters.install-dir >>/bin:$PATH"' >> $BASH_ENV
57+
name: Add CMake to PATH
58+
- run:
59+
command: |
60+
if which cmake; then
61+
if cmake --version | grep "<< parameters.version >>"; then
62+
echo "CMake is already installed."
63+
exit 0
64+
else
65+
echo "CMake is already installed but it is the wrong version."
66+
fi
67+
fi
68+
69+
rm -rf << parameters.install-dir >>/*
70+
echo "Installing the requested version of CMake."
71+
baseUrl="https://github.com/Kitware/CMake/releases/download/"
72+
url="${baseUrl}/v<< parameters.version >>/cmake-<< parameters.version >>-Linux-x86_64.tar.gz"
73+
curl -sSL -o /tmp/cmake.tar.gz $url
74+
tar -C << parameters.install-dir >> --strip-components 1 -zxf /tmp/cmake.tar.gz
75+
name: Install CMake
76+
- run:
77+
command: rm -rf << parameters.install-dir >>/{doc,man}
78+
name: Remove unnecessary files
79+
- run:
80+
command: |
81+
ls -l << parameters.install-dir >>/bin
82+
echo $PATH
83+
cmake --version
84+
name: Verify CMake installation
85+
- when:
86+
condition:
87+
equal:
88+
- << parameters.cache >>
89+
- true
90+
steps:
91+
- save_cache:
92+
key: cmake-<< parameters.cache-key >>-<< parameters.version >>
93+
paths:
94+
- << parameters.install-dir >>
95+
96+
2297
install-cuda:
2398
description: "Install CUDA"
2499
parameters:
@@ -207,6 +282,30 @@ commands:
207282
mkdir -p /tmp/dist/builds
208283
cp dist/* /tmp/dist/builds
209284
285+
build-cmake:
286+
description: "Build the torch-tensorrt using CMake"
287+
parameters:
288+
platform:
289+
type: string
290+
default: "x86_64"
291+
steps:
292+
- run:
293+
name: Build torch-tensorrt library with CMake
294+
command: |
295+
mkdir build
296+
export PATH=$PATH:/usr/local/cuda/bin
297+
~/cmake/bin/cmake -S. -Bbuild \
298+
-DCMAKE_MODULE_PATH=cmake/Module \
299+
-DTorch_DIR=/opt/circleci/.pyenv/versions/3.9.4/lib/python3.9/site-packages/torch/share/cmake/Torch \
300+
-DTensorRT_ROOT=/usr \
301+
-DCMAKE_BUILD_TYPE=Debug
302+
cmake --build build -- -j12
303+
mkdir -p /tmp/dist/builds
304+
cp -r build/bin /tmp/dist/builds
305+
cp -r build/lib /tmp/dist/builds
306+
cp -r cpp/include /tmp/dist/builds
307+
308+
210309
dump-test-env:
211310
description: "Dump the test env to console"
212311
steps:
@@ -632,7 +731,7 @@ jobs:
632731
platform: "x86_64"
633732
cudnn-version: << pipeline.parameters.cudnn-release-version >>
634733
trt-version-short: << pipeline.parameters.trt-release-version-short >>
635-
bazel-version: "5.1.1"
734+
bazel-version: << pipeline.parameters.bazel-version >>
636735
bazel-platform: "x86_64"
637736
- run:
638737
name: Build cxx11-abi tarball
@@ -703,7 +802,7 @@ jobs:
703802
platform: "sbsa"
704803
cudnn-version: << pipeline.parameters.cudnn-jetson-version >>
705804
trt-version-short: << pipeline.parameters.trt-jetson-version-short >>
706-
bazel-version: "5.1.1"
805+
bazel-version: << pipeline.parameters.bazel-version >>
707806
bazel-platform: "arm64"
708807
- run:
709808
name: Set python version
@@ -742,6 +841,45 @@ jobs:
742841
path: /tmp/dist/jetson
743842
destination: aarch64-release-pkgs
744843

844+
build-x86_64-cmake:
845+
parameters:
846+
cudnn-version:
847+
type: string
848+
trt-version-short:
849+
type: string
850+
torch-build:
851+
type: string
852+
torch-build-index:
853+
type: string
854+
machine:
855+
image: ubuntu-2004-cuda-11.4:202110-01
856+
resource_class: xlarge
857+
steps:
858+
- checkout
859+
- create-env:
860+
os: "ubuntu2004"
861+
platform: "x86_64"
862+
cudnn-version: << parameters.cudnn-version >>
863+
trt-version-short: << parameters.trt-version-short >>
864+
bazel-platform: "x86_64"
865+
- install-cmake:
866+
version: 3.24.1
867+
- install-torch-from-index:
868+
torch-build: << parameters.torch-build >>
869+
torch-build-index: << parameters.torch-build-index >>
870+
- build-cmake
871+
- run:
872+
name: Move to cmake build dir
873+
command: |
874+
mkdir -p /tmp/dist/cmake
875+
cp -r /tmp/dist/builds/* /tmp/dist/cmake
876+
- persist_to_workspace:
877+
root: /tmp/dist
878+
paths:
879+
- cmake
880+
- store_artifacts:
881+
path: /tmp/dist/cmake
882+
destination: x86_64-cmake
745883

746884
parameters:
747885
bazel-version:
@@ -751,7 +889,7 @@ parameters:
751889
# Nightly platform config
752890
torch-nightly-build:
753891
type: string
754-
default: "1.13.0.dev20220731+cu113"
892+
default: "1.13.0.dev20220810+cu113"
755893
torch-nightly-build-index:
756894
type: string
757895
default: "https://download.pytorch.org/whl/nightly/cu113"
@@ -821,7 +959,6 @@ workflows:
821959
jetpack-version: << pipeline.parameters.jetpack-version >>
822960
python-version: 3.8.10
823961

824-
825962
- build-x86_64-pyt-release:
826963
torch-build: << pipeline.parameters.torch-release-build >>
827964
torch-build-index: << pipeline.parameters.torch-release-build-index >>
@@ -855,7 +992,6 @@ workflows:
855992
requires:
856993
- build-x86_64-pyt-release
857994

858-
859995
- build-x86_64-pyt-nightly:
860996
torch-build: << pipeline.parameters.torch-nightly-build >>
861997
torch-build-index: << pipeline.parameters.torch-nightly-build-index >>
@@ -901,7 +1037,6 @@ workflows:
9011037
torch-build: << pipeline.parameters.torch-release-build >>
9021038
torch-build-index: << pipeline.parameters.torch-release-build-index >>
9031039

904-
9051040
- test-core-cpp-x86_64:
9061041
name: test-core-cpp-x86_64-pyt-release
9071042
channel: "release"
@@ -958,7 +1093,6 @@ workflows:
9581093
jetpack-version: << pipeline.parameters.jetpack-version >>
9591094
python-version: 3.8.10
9601095

961-
9621096
- build-x86_64-pyt-release:
9631097
torch-build: << pipeline.parameters.torch-release-build >>
9641098
torch-build-index: << pipeline.parameters.torch-release-build-index >>
@@ -1025,3 +1159,17 @@ workflows:
10251159
trt-version-long: << pipeline.parameters.trt-nightly-version-long >>
10261160
requires:
10271161
- build-x86_64-pyt-nightly
1162+
1163+
- build-x86_64-cmake:
1164+
name: build-x86_64-cmake-pyt-nightly
1165+
torch-build: << pipeline.parameters.torch-nightly-build >>
1166+
torch-build-index: << pipeline.parameters.torch-nightly-build-index >>
1167+
trt-version-short: << pipeline.parameters.trt-nightly-version-short >>
1168+
cudnn-version: << pipeline.parameters.cudnn-nightly-version >>
1169+
1170+
- build-x86_64-cmake:
1171+
name: build-x86_64-cmake-pyt-release
1172+
torch-build: << pipeline.parameters.torch-release-build >>
1173+
torch-build-index: << pipeline.parameters.torch-release-build-index >>
1174+
trt-version-short: << pipeline.parameters.trt-release-version-short >>
1175+
cudnn-version: << pipeline.parameters.cudnn-release-version >>

.github/actions/assigner/package-lock.json

Lines changed: 24 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.github/actions/assigner/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"license": "BSD-3-Clause",
2020
"repository": "https://www.github.com/pytorch/TensorRT",
2121
"dependencies": {
22-
"@actions/core": "^1.8.2",
22+
"@actions/core": "^1.9.1",
2323
"@actions/github": "^5.0.3",
2424
"fs": "^0.0.1-security",
2525
"js-yaml": "^4.1.0"

.github/workflows/docgen.yml

Lines changed: 47 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ on:
1010

1111
jobs:
1212
build-docs:
13-
runs-on: ubuntu-18.04
13+
runs-on: ubuntu-20.04
1414
container:
15-
image: docker.pkg.github.com/pytorch/tensorrt/docgen:latest
15+
image: ghcr.io/pytorch/tensorrt/docgen:latest
1616
credentials:
1717
username: ${{ github.actor }}
1818
password: ${{ secrets.GITHUB_TOKEN }}
@@ -22,23 +22,66 @@ jobs:
2222
rm -rf /usr/share/dotnet
2323
rm -rf /opt/ghc
2424
rm -rf "/usr/local/share/boost"
25+
rm -rf /usr/local/cuda/cuda-*
26+
- name: Install base deps
27+
run: |
28+
apt update
29+
DEBIAN_FRONTEND=noninteractive apt install -y software-properties-common gcc git curl wget make zlib1g-dev bzip2 libbz2-dev lzma lzma-dev libreadline-dev libsqlite3-dev libssl-dev libffi-dev doxygen pandoc
30+
git config --global --add safe.directory '*'
31+
- name: Set up Python 3.9.4
32+
uses: actions/setup-python@v2
33+
with:
34+
python-version: 3.9.4
2535
- uses: actions/checkout@v2
2636
with:
2737
ref: ${{github.head_ref}}
2838
- name: Get HEAD SHA
2939
id: vars
3040
run: echo "::set-output name=sha::$(git rev-parse --short HEAD)"
41+
- name: Get Bazel version
42+
id: bazel_info
43+
run: echo "::set-output name=version::$(cat .bazelversion)"
44+
- name: Install Bazel
45+
run: |
46+
wget -q https://github.com/bazelbuild/bazel/releases/download/${{ steps.bazel_info.outputs.version }}/bazel-${{ steps.bazel_info.outputs.version }}-linux-x86_64 -O /usr/bin/bazel
47+
chmod a+x /usr/bin/bazel
48+
- name: Install cudnn + tensorrt
49+
run: |
50+
apt-get update
51+
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/cuda-ubuntu2004.pin
52+
mv cuda-ubuntu2004.pin /etc/apt/preferences.d/cuda-repository-pin-600
53+
apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/7fa2af80.pub
54+
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 536F8F1DE80F6A35
55+
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A4B469963BF863CC
56+
add-apt-repository "deb https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/ /"
57+
apt-get update
58+
apt-get install -y libcudnn8 libcudnn8-dev
59+
60+
apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/3bf863cc.pub
61+
add-apt-repository "deb https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/ /"
62+
apt-get update
63+
64+
apt-get install -y libnvinfer8 libnvinfer-plugin8 libnvinfer-dev libnvinfer-plugin-dev
65+
- name: Install Torch
66+
run: |
67+
python3 -m pip install -r py/requirements.txt
3168
- name: Build Python Package
3269
run: |
33-
cp docker/WORKSPACE.docker WORKSPACE
70+
cp toolchains/ci_workspaces/WORKSPACE.x86_64 WORKSPACE
3471
cd py
72+
echo $(which python3)
73+
echo $(python3 -c 'import site; print(site.getsitepackages()[0])')
74+
mkdir -p /opt/circleci/.pyenv/versions/3.9.4/lib/python3.9/
75+
ln -s $(python3 -c 'import site; print(site.getsitepackages()[0])') /opt/circleci/.pyenv/versions/3.9.4/lib/python3.9/site-packages
3576
python3 setup.py install
77+
cd ..
3678
- name: Generate New Docs
3779
run: |
3880
cd docsrc
39-
pip3 install -r requirements.txt
81+
python3 -m pip install -r requirements.txt
4082
python3 -c "import torch_tensorrt; print(torch_tensorrt.__version__)"
4183
make html
84+
cd ..
4285
- uses: stefanzweifel/git-auto-commit-action@v4
4386
with:
4487
# Required

0 commit comments

Comments
 (0)