@@ -282,6 +282,56 @@ commands:
282
282
mkdir -p /tmp/dist/builds
283
283
cp dist/* /tmp/dist/builds
284
284
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
+
285
335
build-cmake :
286
336
description : " Build the torch-tensorrt using CMake"
287
337
parameters :
@@ -829,7 +879,7 @@ jobs:
829
879
TORCHTRT_VERSION=$(cd torch_tensorrt && python3 -c "from _version import __version__;print(__version__)")
830
880
TRT_VERSION=$(cd torch_tensorrt && python3 -c "from _version import __tensorrt_version__;print(__tensorrt_version__)")
831
881
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
833
883
TORCH_VERSION=$(python3 -c "from torch import __version__;print(__version__.split('+')[0])")
834
884
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
835
885
- run :
@@ -881,6 +931,64 @@ jobs:
881
931
path : /tmp/dist/cmake
882
932
destination : x86_64-cmake
883
933
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
+
884
992
parameters :
885
993
bazel-version :
886
994
type : string
@@ -923,10 +1031,10 @@ parameters:
923
1031
# Jetson platform config
924
1032
torch-jetson-build :
925
1033
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"
927
1035
jetpack-version :
928
1036
type : string
929
- default : " 50 "
1037
+ default : " 502 "
930
1038
cudnn-jetson-version :
931
1039
type : string
932
1040
default : " 8.3.2"
@@ -937,10 +1045,18 @@ parameters:
937
1045
type : string
938
1046
default : " 8.4.1.5"
939
1047
1048
+ torch-ngc-base-image :
1049
+ type : string
1050
+ default : " nvcr.io/nvidia/pytorch:22.07-py3"
1051
+
940
1052
enable-packaging :
941
1053
type : boolean
942
1054
default : false
943
1055
1056
+ enable-ngc-packaging :
1057
+ type : boolean
1058
+ default : false
1059
+
944
1060
# Invoke jobs via workflows
945
1061
# See: https://circleci.com/docs/2.0/configuration-reference/#workflows
946
1062
workflows :
@@ -1028,10 +1144,6 @@ workflows:
1028
1144
release :
1029
1145
when : << pipeline.parameters.enable-packaging >>
1030
1146
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
1035
1147
1036
1148
- build-x86_64-pyt-release :
1037
1149
torch-build : << pipeline.parameters.torch-release-build >>
@@ -1077,9 +1189,26 @@ workflows:
1077
1189
- test-py-ts-x86_64-pyt-release
1078
1190
- test-py-fx-x86_64-pyt-release
1079
1191
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
+
1080
1209
- package-jetson :
1081
1210
name : package-release-aarch64-jetson
1082
- enabled : << pipeline.parameters.enable-packaging >>
1211
+ enabled : << pipeline.parameters.enable-ngc- packaging >>
1083
1212
torch-build : << pipeline.parameters.torch-jetson-build >>
1084
1213
jetpack-version : << pipeline.parameters.jetpack-version >>
1085
1214
python-version : 3.8.10
0 commit comments