Skip to content

Commit a1d230a

Browse files
committed
chore: update CI for new build path
Signed-off-by: Naren Dasan <naren@narendasan.com> Signed-off-by: Naren Dasan <narens@nvidia.com> Adding no deps flag
1 parent 9e929f2 commit a1d230a

File tree

8 files changed

+125
-72
lines changed

8 files changed

+125
-72
lines changed

.circleci/config.yml

Lines changed: 72 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ commands:
215215
parameters:
216216
python-version:
217217
type: string
218-
default: "3.9.4"
218+
default: "3.10.9"
219219
steps:
220220
- run:
221221
name: Set python version
@@ -268,46 +268,54 @@ commands:
268268
build-py:
269269
description: "Build the torch-tensorrt python release (pre-cxx11-abi)"
270270
parameters:
271+
cuda-version:
272+
type: string
273+
torch-build-index:
274+
type: string
271275
platform:
272276
type: string
273277
default: "x86_64"
274278
steps:
275279
- run:
276280
name: Build torch-tensorrt python release (pre-cxx11-abi)
277281
command: |
278-
export CUDA_HOME=/usr/local/cuda-12.1/
282+
export CUDA_HOME=/usr/local/cuda-<< parameters.cuda-version >>/
279283
mv toolchains/ci_workspaces/WORKSPACE.<< parameters.platform >> WORKSPACE
280-
cd py
281-
python3 -m pip install wheel setuptools
282-
python3 -m pip install pybind11==2.6.2
283-
python3 setup.py bdist_wheel
284-
python3 setup.py install
284+
python3 -m pip install pip==22.0.2
285+
python3 -m pip wheel --no-deps --verbose --pre . --extra-index-url << parameters.torch-build-index >> -w dist
286+
python3 -m pip install dist/torch_tensorrt*
285287
mkdir -p /tmp/dist/builds
286-
cp dist/* /tmp/dist/builds
288+
cp dist/torch_tensorrt* /tmp/dist/builds
287289
288290
build-py-legacy:
289291
description: "Build the torch-tensorrt python legacy release (pre-cxx11-abi)"
290292
parameters:
293+
cuda-version:
294+
type: string
295+
torch-build-index:
296+
type: string
291297
platform:
292298
type: string
293299
default: "x86_64"
294300
steps:
295301
- run:
296302
name: Build torch-tensorrt python legacy release (pre-cxx11-abi)
297303
command: |
298-
export CUDA_HOME=/usr/local/cuda-12.1/
304+
export CUDA_HOME=/usr/local/cuda-<< parameters.cuda-version >>/
299305
mv toolchains/ci_workspaces/WORKSPACE.<< parameters.platform >> WORKSPACE
300-
cd py
301-
python3 -m pip install wheel setuptools
302-
python3 -m pip install pybind11==2.6.2
303-
python3 setup.py bdist_wheel --legacy
304-
python3 setup.py install --legacy
306+
python3 -m pip install pip==22.0.2
307+
python3 -m pip wheel --no-deps --verbose --pre . --extra-index-url << parameters.torch-build-index >> --config-setting="--build-option=--legacy" -w dist
308+
python3 -m pip install dist/torch_tensorrt*
305309
mkdir -p /tmp/dist/builds
306-
cp dist/* /tmp/dist/builds
310+
cp dist/torch_tensorrt* /tmp/dist/builds
307311
308312
build-py-cxx11-abi:
309313
description: "Build the torch-tensorrt python release (cxx11-abi)"
310314
parameters:
315+
cuda-version:
316+
type: string
317+
torch-build-index:
318+
type: string
311319
platform:
312320
type: string
313321
default: "x86_64"
@@ -319,36 +327,38 @@ commands:
319327
name: Build setup
320328
command: |
321329
mv ~/project/toolchains/ci_workspaces/WORKSPACE.<< parameters.platform >> ~/project/WORKSPACE
322-
python3 -m pip install wheel setuptools
323-
python3 -m pip install pybind11==2.6.2
324330
- when:
325331
condition: << parameters.release >>
326332
steps:
327333
- run:
328334
name: Build torch-tensorrt python release package
329335
command: |
330-
export CUDA_HOME=/usr/local/cuda-12.1/
331-
cd ~/project/py
332-
python3 setup.py bdist_wheel --use-cxx11-abi --release
333-
python3 setup.py install --use-cxx11-abi --release
336+
export CUDA_HOME=/usr/local/cuda-<< parameters.cuda-version >>/
337+
python3 -m pip install pip==22.0.2
338+
python3 -m pip wheel --no-deps --verbose --pre . --extra-index-url << parameters.torch-build-index >> --config-setting="--build-option=--release" --config-setting="--build-option=--use-cxx11-abi" -w dist
339+
python3 -m pip install dist/torch_tensorrt*
334340
mkdir -p /tmp/dist/builds
335-
cp dist/* /tmp/dist/builds
341+
cp dist/torch_tensorrt* /tmp/dist/builds
336342
- unless:
337343
condition: << parameters.release >>
338344
steps:
339345
- run:
340346
name: Build torch-tensorrt python package
341347
command: |
342-
export CUDA_HOME=/usr/local/cuda-12.1/
343-
cd ~/project/py
344-
python3 setup.py bdist_wheel --use-cxx11-abi
345-
python3 setup.py install --use-cxx11-abi
348+
export CUDA_HOME=/usr/local/cuda-<< parameters.cuda-version >>/
349+
python3 -m pip install pip==22.0.2
350+
python3 -m pip wheel --no-deps --verbose --pre . --extra-index-url << parameters.torch-build-index >> --config-setting="--build-option=--use-cxx11-abi" -w dist
351+
python3 -m pip install dist/torch_tensorrt*
346352
mkdir -p /tmp/dist/builds
347-
cp dist/* /tmp/dist/builds
353+
cp dist/torch_tensorrt* /tmp/dist/builds
348354
349355
build-py-fx-only:
350356
description: "Build the torch-tensorrt python release with only the fx backend"
351357
parameters:
358+
cuda-version:
359+
type: string
360+
torch-build-index:
361+
type: string
352362
platform:
353363
type: string
354364
default: "x86_64"
@@ -357,15 +367,13 @@ commands:
357367
- run:
358368
name: Build torch-tensorrt python release with only the fx backend
359369
command: |
360-
export CUDA_HOME=/usr/local/cuda-12.1/
370+
export CUDA_HOME=/usr/local/cuda-<< parameters.cuda-version >>/
361371
mv toolchains/ci_workspaces/WORKSPACE.<< parameters.platform >> WORKSPACE
362-
cd py
363-
python3 -m pip install wheel setuptools
364-
python3 -m pip install pybind11==2.6.2
365-
python3 setup.py bdist_wheel --fx-only
366-
python3 setup.py install --fx-only
372+
python3 -m pip install pip==22.0.2
373+
python3 -m pip wheel --no-deps --verbose --pre . --extra-index-url << parameters.torch-build-index >> --config-setting="--build-option=--fx-only" -w dist
374+
python3 -m pip install dist/torch_tensorrt*
367375
mkdir -p /tmp/dist/builds
368-
cp dist/* /tmp/dist/builds
376+
cp dist/torch_tensorrt* /tmp/dist/builds
369377
370378
build-py-ngc:
371379
description: "Build the torch-tensorrt python release for NGC PyTorch (cxx11-abi)"
@@ -396,22 +404,21 @@ commands:
396404
export BAZEL_VERSION="$(cat /home/circleci/project/.bazelversion)"
397405
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"
398406
docker exec ngc_build_container bash -c "mv /workspace/docker/WORKSPACE.ngc /workspace/WORKSPACE"
399-
docker exec ngc_build_container bash -c "cd /workspace/py && pip install wheel setuptools pybind11==2.6.2"
400407
docker exec ngc_build_container bash -c "git config --global --add safe.directory /workspace"
401408
- when:
402409
condition: << parameters.release >>
403410
steps:
404411
- run:
405412
name: Build torch-tensorrt release build for NGC
406413
command: |
407-
docker exec ngc_build_container bash -c "cd /workspace/py && python3 setup.py bdist_wheel --use-cxx11-abi --release"
414+
docker exec ngc_build_container bash -c "cd /workspace/ && python3 -m pip wheel --no-deps --verbose --pre . --config-setting="--build-option=--release" --config-setting="--build-option=--use-cxx11-abi" -w dist"
408415
- unless:
409416
condition: << parameters.release >>
410417
steps:
411418
- run:
412419
name: Build torch-tensorrt debug build for NGC
413420
command: |
414-
docker exec ngc_build_container bash -c "cd /workspace/py && python3 setup.py bdist_wheel --use-cxx11-abi"
421+
docker exec ngc_build_container bash -c "cd /workspace/py && python3 -m pip wheel --no-deps --verbose --pre . --config-setting="--build-option=--use-cxx11-abi" -w dist"
415422
- run:
416423
name: Collect builds
417424
command: |
@@ -432,7 +439,7 @@ commands:
432439
export PATH=$PATH:/usr/local/cuda-12.1/bin
433440
~/cmake/bin/cmake -S. -Bbuild \
434441
-DCMAKE_MODULE_PATH=cmake/Module \
435-
-DTorch_DIR=/opt/circleci/.pyenv/versions/3.9.4/lib/python3.9/site-packages/torch/share/cmake/Torch \
442+
-DTorch_DIR=/opt/circleci/.pyenv/versions/3.10.9/lib/python3.10/site-packages/torch/share/cmake/Torch \
436443
-DTensorRT_ROOT=/usr \
437444
-DCMAKE_BUILD_TYPE=Debug
438445
cmake --build build -- -j12
@@ -481,7 +488,7 @@ commands:
481488
name: Run core / C++ tests
482489
no_output_timeout: 15m
483490
environment:
484-
LD_LIBRARY_PATH: "/opt/circleci/.pyenv/versions/3.9.4/lib/python3.9/site-packages/torch_tensorrt.libs:/home/circleci/project/bazel-project/external/libtorch_pre_cxx11_abi/lib/:/home/circleci/project/bazel-project/external/tensorrt/lib/:/usr/local/cuda-12.1/lib64/:$LD_LIBRARY_PATH"
491+
LD_LIBRARY_PATH: "/opt/circleci/.pyenv/versions/3.10.9/lib/python3.10/site-packages/torch_tensorrt.libs:/home/circleci/project/bazel-project/external/libtorch_pre_cxx11_abi/lib/:/home/circleci/project/bazel-project/external/tensorrt/lib/:/usr/local/cuda-12.1/lib64/:$LD_LIBRARY_PATH"
485492
command: |
486493
set -e
487494
mv toolchains/ci_workspaces/WORKSPACE.<< parameters.platform >> WORKSPACE
@@ -794,6 +801,8 @@ jobs:
794801
type: string
795802
python-version:
796803
type: string
804+
cuda-version:
805+
type: string
797806
cxx11-abi:
798807
type: boolean
799808
default: false
@@ -820,18 +829,24 @@ jobs:
820829
- when:
821830
condition: << parameters.cxx11-abi >>
822831
steps:
823-
- build-py-cxx11-abi
832+
- build-py-cxx11-abi:
833+
cuda-version: << parameters.cuda-version >>
834+
torch-build-index: << parameters.torch-build-index >>
824835
- unless:
825836
condition: << parameters.cxx11-abi >>
826837
steps:
827838
- when:
828839
condition: << parameters.legacy >>
829840
steps:
830-
- build-py-legacy
841+
- build-py-legacy:
842+
cuda-version: << parameters.cuda-version >>
843+
torch-build-index: << parameters.torch-build-index >>
831844
- unless:
832845
condition: << parameters.legacy >>
833846
steps:
834-
- build-py
847+
- build-py:
848+
cuda-version: << parameters.cuda-version >>
849+
torch-build-index: << parameters.torch-build-index >>
835850
- run:
836851
name: Move to build dir
837852
command: |
@@ -885,7 +900,7 @@ jobs:
885900
at: /tmp/dist
886901
- run:
887902
name: "Install torch-tensorrt"
888-
command: pip3 install /tmp/dist/x86_64-linux/*cp39-cp39*.whl
903+
command: python3 -m pip install --pre /tmp/dist/x86_64-linux/*cp310-cp310*.whl --extra-index-url << parameters.torch-build-index >>
889904
- dump-test-env
890905
- test-ts-core
891906

@@ -918,7 +933,7 @@ jobs:
918933
torch-build-index: << parameters.torch-build-index >>
919934
- run:
920935
name: "Install torch-tensorrt"
921-
command: pip3 install --pre /tmp/dist/x86_64-linux/*cp39-cp39*.whl
936+
command: python3 -m pip install --pre /tmp/dist/x86_64-linux/*cp310-cp310*.whl --extra-index-url << parameters.torch-build-index >>
922937
- dump-test-env
923938
- test-ts-py-api
924939

@@ -953,7 +968,7 @@ jobs:
953968
- install-cudnn
954969
- run:
955970
name: "Install torch-tensorrt"
956-
command: pip3 install --pre /tmp/dist/x86_64-linux/*cp39-cp39*.whl
971+
command: python3 -m pip install --pre /tmp/dist/x86_64-linux/*cp310-cp310*.whl --extra-index-url << parameters.torch-build-index >>
957972
# We install torch after torch-trt because pip automatically enforces the version constraint otherwise
958973
- dump-test-env
959974
- test-fx
@@ -992,7 +1007,7 @@ jobs:
9921007
# command: export LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu/:$LD_LIBRARY_PATH
9931008
- run:
9941009
name: "Install torch-tensorrt"
995-
command: pip3 install --pre /tmp/dist/x86_64-linux/*cp39-cp39*.whl
1010+
command: python3 -m pip install --pre /tmp/dist/x86_64-linux/*cp310-cp310*.whl --extra-index-url << parameters.torch-build-index >>
9961011
# We install torch after torch-trt because pip automatically enforces the version constraint otherwise
9971012
- dump-test-env
9981013
- test-fx-no-aten
@@ -1030,7 +1045,7 @@ jobs:
10301045
# command: export LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu/:$LD_LIBRARY_PATH
10311046
- run:
10321047
name: "Install torch-tensorrt"
1033-
command: pip3 install --pre /tmp/dist/x86_64-linux/*cp39-cp39*.whl
1048+
command: python3 -m pip install --pre /tmp/dist/x86_64-linux/*cp310-cp310*.whl --extra-index-url << parameters.torch-build-index >>
10341049
# We install torch after torch-trt because pip automatically enforces the version constraint otherwise
10351050
- dump-test-env
10361051
- test-dynamo-compile
@@ -1126,8 +1141,8 @@ jobs:
11261141
TRT_VERSION=$(python3 -c "from versions import __tensorrt_version__;print(__tensorrt_version__)")
11271142
CUDNN_VERSION=$(python3 -c "from versions import __cudnn_version__;print(__cudnn_version__)")
11281143
TORCH_VERSION=$(python3 -c "from torch import __version__;print(__version__.split('+')[0])")
1129-
pip3 install --upgrade pip
1130-
pip3 install -r ~/project/py/requirements.txt
1144+
python3 -m pip install pip==22.0.2
1145+
python3 -m pip install -r ~/project/py/requirements.txt
11311146
TORCH_VERSION=$(python3 -c "from torch import __version__;print(__version__.split('+')[0])")
11321147
mkdir -p ~/project/py/dist/
11331148
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}-x86_64-linux.tar.gz
@@ -1322,7 +1337,11 @@ jobs:
13221337
parameters:
13231338
python-version:
13241339
type: string
1325-
default: "3.9.4"
1340+
default: "3.10.9"
1341+
1342+
cuda-version:
1343+
type: string
1344+
default: "12.1"
13261345

13271346
# Nightly platform config
13281347
torch-build:
@@ -1404,6 +1423,7 @@ workflows:
14041423
torchvision-build: << pipeline.parameters.torchvision-build >>
14051424
torch-build-index: << pipeline.parameters.torch-build-index >>
14061425
python-version: << pipeline.parameters.python-version >>
1426+
cuda-version: << pipeline.parameters.cuda-version >>
14071427

14081428
- test-core-cpp-x86_64-linux:
14091429
torch-build: << pipeline.parameters.torch-build >>
@@ -1445,6 +1465,7 @@ workflows:
14451465

14461466
- build-x86_64-linux:
14471467
name: build-x86_64-linux-legacy
1468+
cuda-version: << pipeline.parameters.cuda-version >>
14481469
torch-build: << pipeline.parameters.torch-build-legacy >>
14491470
torchvision-build: << pipeline.parameters.torchvision-build-legacy >>
14501471
torch-build-index: << pipeline.parameters.torch-build-index-legacy >>
@@ -1537,6 +1558,7 @@ workflows:
15371558
on-push:
15381559
jobs:
15391560
- build-x86_64-linux:
1561+
cuda-version: << pipeline.parameters.cuda-version >>
15401562
torch-build: << pipeline.parameters.torch-build >>
15411563
torchvision-build: << pipeline.parameters.torchvision-build >>
15421564
torch-build-index: << pipeline.parameters.torch-build-index >>

py/ci/Dockerfile.ci

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
FROM pytorch/manylinux-builder:cuda11.8
1+
FROM pytorch/manylinux-builder:cuda12.1
22
ARG trt_version
33

44
RUN echo -e "Installing with TensorRT ${trt_version}"
55

66
RUN yum install -y ninja-build tensorrt-${trt_version}.*
77

8-
RUN wget https://github.com/bazelbuild/bazelisk/releases/download/v1.11.0/bazelisk-linux-amd64 \
8+
RUN wget https://github.com/bazelbuild/bazelisk/releases/download/v1.17.0/bazelisk-linux-amd64 \
99
&& mv bazelisk-linux-amd64 /usr/bin/bazel \
1010
&& chmod +x /usr/bin/bazel
1111

0 commit comments

Comments
 (0)