@@ -282,6 +282,56 @@ commands:
282282 mkdir -p /tmp/dist/builds
283283 cp dist/* /tmp/dist/builds
284284
285+ build-py-ngc :
286+ description : " Build the torch-tensorrt python release for NGC PyTorch (cxx11-abi)"
287+ parameters :
288+ release :
289+ type : boolean
290+ default : false
291+ torch-base-image :
292+ type : string
293+ default : nvcr.io/nvidia/pytorch:latest
294+ steps :
295+ - run :
296+ name : Log into docker
297+ command : |
298+ docker login --username="\$oauthtoken" --password=$NGC_TOKEN nvcr.io
299+ - run :
300+ name : Pull image
301+ command : |
302+ docker pull << parameters.torch-base-image >>
303+ - run :
304+ name : Create container
305+ command : |
306+ docker run -it -d --name ngc_build_container -v /home/circleci/project:/workspace -e BAZEL_VERSION="$(cat /home/circleci/project/.bazelversion)" -w /workspace << parameters.torch-base-image >>
307+ - run :
308+ name : Install build deps
309+ command : |
310+ export BAZEL_VERSION="$(cat /home/circleci/project/.bazelversion)"
311+ docker exec ngc_build_container bash -c "wget https://github.com/bazelbuild/bazel/releases/download/$BAZEL_VERSION/bazel-$BAZEL_VERSION-linux-x86_64 -O /usr/bin/bazel && chmod a+x /usr/bin/bazel"
312+ docker exec ngc_build_container bash -c "mv /workspace/docker/WORKSPACE.ngc /workspace/WORKSPACE"
313+ docker exec ngc_build_container bash -c "cd /workspace/py && pip install wheel setuptools pybind11==2.6.2"
314+ docker exec ngc_build_container bash -c "git config --global --add safe.directory /workspace"
315+ - when :
316+ condition : << parameters.release >>
317+ steps :
318+ - run :
319+ name : Build torch-tensorrt release build for NGC
320+ command : |
321+ docker exec ngc_build_container bash -c "cd /workspace/py && python3 setup.py bdist_wheel --use-cxx11-abi --release"
322+ - unless :
323+ condition : << parameters.release >>
324+ steps :
325+ - run :
326+ name : Build torch-tensorrt debug build for NGC
327+ command : |
328+ docker exec ngc_build_container bash -c "cd /workspace/py && python3 setup.py bdist_wheel --use-cxx11-abi"
329+ - run :
330+ name : Collect builds
331+ command : |
332+ mkdir -p /tmp/dist/builds
333+ cp /home/circleci/project/py/dist/* /tmp/dist/builds
334+
285335 build-cmake :
286336 description : " Build the torch-tensorrt using CMake"
287337 parameters :
@@ -829,7 +879,7 @@ jobs:
829879 TORCHTRT_VERSION=$(cd torch_tensorrt && python3 -c "from _version import __version__;print(__version__)")
830880 TRT_VERSION=$(cd torch_tensorrt && python3 -c "from _version import __tensorrt_version__;print(__tensorrt_version__)")
831881 CUDNN_VERSION=$(cd torch_tensorrt && python3 -c "from _version import __cudnn_version__;print(__cudnn_version__)")
832- pip3 install -r ~/project/py/requirements.txt
882+ python3 -m pip install pybind11==2.6.2
833883 TORCH_VERSION=$(python3 -c "from torch import __version__;print(__version__.split('+')[0])")
834884 cp ~/project/bazel-bin/libtorchtrt.tar.gz ~/project/py/dist/libtorchtrt-${TORCHTRT_VERSION}-cudnn${CUDNN_VERSION}-tensorrt${TRT_VERSION}-cuda${CUDA_VERSION}-libtorch${TORCH_VERSION}-aarch64-linux-jp<< parameters.jetpack-version >>.tar.gz
835885 - run :
@@ -881,6 +931,64 @@ jobs:
881931 path : /tmp/dist/cmake
882932 destination : x86_64-cmake
883933
934+ build-x86_64-pyt-ngc :
935+ parameters :
936+ torch-base-image :
937+ type : string
938+ machine :
939+ image : ubuntu-2004-cuda-11.4:202110-01
940+ resource_class : xlarge
941+ steps :
942+ - checkout
943+ - build-py-ngc :
944+ release : false
945+ torch-base-image : << parameters.torch-base-image >>
946+ - run :
947+ name : Move to NGC dir
948+ command : |
949+ mkdir -p /tmp/dist/ngc
950+ cp -r /tmp/dist/builds/* /tmp/dist/ngc
951+ - persist_to_workspace :
952+ root : /tmp/dist
953+ paths :
954+ - ngc
955+ - store_artifacts :
956+ path : /tmp/dist/ngc
957+ destination : x86_64-pyt-ngc
958+
959+ package-x86_64-ngc :
960+ parameters :
961+ enabled :
962+ type : boolean
963+ default : false
964+ torch-base-image :
965+ type : string
966+ machine :
967+ image : ubuntu-2004-cuda-11.4:202110-01
968+ resource_class : xlarge
969+ steps :
970+ - when :
971+ condition : << parameters.enabled >>
972+ steps :
973+ - checkout
974+ - build-py-ngc :
975+ release : true
976+ torch-base-image : << parameters.torch-base-image >>
977+ - run :
978+ name : Collect packages
979+ command : |
980+ mkdir -p /tmp/dist/ngc
981+ cp -r ~/project/py/dist/* /tmp/dist/ngc
982+ - store_artifacts :
983+ path : /tmp/dist/ngc
984+ destination : x86_64-ngc-pkgs
985+ - unless :
986+ condition : << parameters.enabled >>
987+ steps :
988+ - run :
989+ name : Skipped packaging
990+ command : echo -e "Packaging stage not enabled"
991+
884992parameters :
885993 bazel-version :
886994 type : string
@@ -923,10 +1031,10 @@ parameters:
9231031 # Jetson platform config
9241032 torch-jetson-build :
9251033 type : string
926- default : " torch-1.13.0a0+340c4120 .nv22.06 -cp38-cp38-linux_aarch64.whl"
1034+ default : " torch-1.13.0a0+08820cb0 .nv22.07 -cp38-cp38-linux_aarch64.whl"
9271035 jetpack-version :
9281036 type : string
929- default : " 50 "
1037+ default : " 502 "
9301038 cudnn-jetson-version :
9311039 type : string
9321040 default : " 8.3.2"
@@ -937,10 +1045,18 @@ parameters:
9371045 type : string
9381046 default : " 8.4.1.5"
9391047
1048+ torch-ngc-base-image :
1049+ type : string
1050+ default : " nvcr.io/nvidia/pytorch:22.07-py3"
1051+
9401052 enable-packaging :
9411053 type : boolean
9421054 default : false
9431055
1056+ enable-ngc-packaging :
1057+ type : boolean
1058+ default : false
1059+
9441060# Invoke jobs via workflows
9451061# See: https://circleci.com/docs/2.0/configuration-reference/#workflows
9461062workflows :
@@ -1028,10 +1144,6 @@ workflows:
10281144 release :
10291145 when : << pipeline.parameters.enable-packaging >>
10301146 jobs :
1031- - build-aarch64-pyt-jetson :
1032- torch-build : << pipeline.parameters.torch-jetson-build >>
1033- jetpack-version : << pipeline.parameters.jetpack-version >>
1034- python-version : 3.8.10
10351147
10361148 - build-x86_64-pyt-release :
10371149 torch-build : << pipeline.parameters.torch-release-build >>
@@ -1077,9 +1189,26 @@ workflows:
10771189 - test-py-ts-x86_64-pyt-release
10781190 - test-py-fx-x86_64-pyt-release
10791191
1192+ ngc-release :
1193+ when : << pipeline.parameters.enable-ngc-packaging >>
1194+ jobs :
1195+ - build-aarch64-pyt-jetson :
1196+ torch-build : << pipeline.parameters.torch-jetson-build >>
1197+ jetpack-version : << pipeline.parameters.jetpack-version >>
1198+ python-version : 3.8.10
1199+
1200+ - build-x86_64-pyt-ngc :
1201+ torch-base-image : << pipeline.parameters.torch-ngc-base-image >>
1202+
1203+ - package-x86_64-ngc :
1204+ torch-base-image : << pipeline.parameters.torch-ngc-base-image >>
1205+ enabled : << pipeline.parameters.enable-ngc-packaging >>
1206+ requires :
1207+ - build-x86_64-pyt-ngc
1208+
10801209 - package-jetson :
10811210 name : package-release-aarch64-jetson
1082- enabled : << pipeline.parameters.enable-packaging >>
1211+ enabled : << pipeline.parameters.enable-ngc- packaging >>
10831212 torch-build : << pipeline.parameters.torch-jetson-build >>
10841213 jetpack-version : << pipeline.parameters.jetpack-version >>
10851214 python-version : 3.8.10
0 commit comments