Skip to content

Commit 1751a7b

Browse files
committed
chore: update CI for new build path
Signed-off-by: Naren Dasan <[email protected]> Signed-off-by: Naren Dasan <[email protected]>
1 parent 0db3615 commit 1751a7b

File tree

2 files changed

+99
-43
lines changed

2 files changed

+99
-43
lines changed

.circleci/config.yml

Lines changed: 63 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -282,46 +282,54 @@ commands:
282282
build-py:
283283
description: "Build the torch-tensorrt python release (pre-cxx11-abi)"
284284
parameters:
285+
cuda-version:
286+
type: string
287+
torch-build-index:
288+
type: string
285289
platform:
286290
type: string
287291
default: "x86_64"
288292
steps:
289293
- run:
290294
name: Build torch-tensorrt python release (pre-cxx11-abi)
291295
command: |
292-
export CUDA_HOME=/usr/local/cuda-11.8/
296+
export CUDA_HOME=/usr/local/cuda-<< parameters.cuda-version >>/
293297
mv toolchains/ci_workspaces/WORKSPACE.<< parameters.platform >> WORKSPACE
294-
cd py
295-
python3 -m pip install wheel setuptools
296-
python3 -m pip install pybind11==2.6.2
297-
python3 setup.py bdist_wheel
298-
python3 setup.py install
298+
python3 -m pip install pip==21.3.1
299+
python3 -m pip wheel --verbose --pre . --extra-index-url << parameters.torch-build-index >> -w dist
300+
python3 -m pip install dist/torch_tensorrt*
299301
mkdir -p /tmp/dist/builds
300-
cp dist/* /tmp/dist/builds
302+
cp dist/torch_tensorrt* /tmp/dist/builds
301303
302304
build-py-legacy:
303305
description: "Build the torch-tensorrt python legacy release (pre-cxx11-abi)"
304306
parameters:
307+
cuda-version:
308+
type: string
309+
torch-build-index:
310+
type: string
305311
platform:
306312
type: string
307313
default: "x86_64"
308314
steps:
309315
- run:
310316
name: Build torch-tensorrt python legacy release (pre-cxx11-abi)
311317
command: |
312-
export CUDA_HOME=/usr/local/cuda-11.8/
318+
export CUDA_HOME=/usr/local/cuda-<< parameters.cuda-version >>/
313319
mv toolchains/ci_workspaces/WORKSPACE.<< parameters.platform >> WORKSPACE
314-
cd py
315-
python3 -m pip install wheel setuptools
316-
python3 -m pip install pybind11==2.6.2
317-
python3 setup.py bdist_wheel --legacy
318-
python3 setup.py install --legacy
320+
python3 -m pip install pip==21.3.1
321+
python3 -m pip wheel --verbose --pre . --extra-index-url << parameters.torch-build-index >> --config-setting="--build-option=--legacy" -w dist
322+
python3 -m pip install dist/torch_tensorrt*
319323
mkdir -p /tmp/dist/builds
320-
cp dist/* /tmp/dist/builds
324+
cp dist/torch_tensorrt* /tmp/dist/builds
321325
322326
build-py-cxx11-abi:
323327
description: "Build the torch-tensorrt python release (cxx11-abi)"
324328
parameters:
329+
cuda-version:
330+
type: string
331+
torch-build-index:
332+
type: string
325333
platform:
326334
type: string
327335
default: "x86_64"
@@ -333,36 +341,38 @@ commands:
333341
name: Build setup
334342
command: |
335343
mv ~/project/toolchains/ci_workspaces/WORKSPACE.<< parameters.platform >> ~/project/WORKSPACE
336-
python3 -m pip install wheel setuptools
337-
python3 -m pip install pybind11==2.6.2
338344
- when:
339345
condition: << parameters.release >>
340346
steps:
341347
- run:
342348
name: Build torch-tensorrt python release package
343349
command: |
344-
export CUDA_HOME=/usr/local/cuda-11.8/
345-
cd ~/project/py
346-
python3 setup.py bdist_wheel --use-cxx11-abi --release
347-
python3 setup.py install --use-cxx11-abi --release
350+
export CUDA_HOME=/usr/local/cuda-<< parameters.cuda-version >>/
351+
python3 -m pip install pip==21.3.1
352+
python3 -m pip wheel --verbose --pre . --extra-index-url << parameters.torch-build-index >> --config-setting="--build-option=--release" --config-setting="--build-option=--use-cxx11-abi" -w dist
353+
python3 -m pip install dist/torch_tensorrt*
348354
mkdir -p /tmp/dist/builds
349-
cp dist/* /tmp/dist/builds
355+
cp dist/torch_tensorrt* /tmp/dist/builds
350356
- unless:
351357
condition: << parameters.release >>
352358
steps:
353359
- run:
354360
name: Build torch-tensorrt python package
355361
command: |
356-
export CUDA_HOME=/usr/local/cuda-11.8/
357-
cd ~/project/py
358-
python3 setup.py bdist_wheel --use-cxx11-abi
359-
python3 setup.py install --use-cxx11-abi
362+
export CUDA_HOME=/usr/local/cuda-<< parameters.cuda-version >>/
363+
python3 -m pip install pip==21.3.1
364+
python3 -m pip wheel --verbose --pre . --extra-index-url << parameters.torch-build-index >> --config-setting="--build-option=--use-cxx11-abi" -w dist
365+
python3 -m pip install dist/torch_tensorrt*
360366
mkdir -p /tmp/dist/builds
361-
cp dist/* /tmp/dist/builds
367+
cp dist/torch_tensorrt* /tmp/dist/builds
362368
363369
build-py-fx-only:
364370
description: "Build the torch-tensorrt python release with only the fx backend"
365371
parameters:
372+
cuda-version:
373+
type: string
374+
torch-build-index:
375+
type: string
366376
platform:
367377
type: string
368378
default: "x86_64"
@@ -371,15 +381,13 @@ commands:
371381
- run:
372382
name: Build torch-tensorrt python release with only the fx backend
373383
command: |
374-
export CUDA_HOME=/usr/local/cuda-11.8/
384+
export CUDA_HOME=/usr/local/cuda-<< parameters.cuda-version >>/
375385
mv toolchains/ci_workspaces/WORKSPACE.<< parameters.platform >> WORKSPACE
376-
cd py
377-
python3 -m pip install wheel setuptools
378-
python3 -m pip install pybind11==2.6.2
379-
python3 setup.py bdist_wheel --fx-only
380-
python3 setup.py install --fx-only
386+
python3 -m pip install pip==21.3.1
387+
python3 -m pip wheel --verbose --pre . --extra-index-url << parameters.torch-build-index >> --config-setting="--build-option=--fx-only" -w dist
388+
python3 -m pip install dist/torch_tensorrt*
381389
mkdir -p /tmp/dist/builds
382-
cp dist/* /tmp/dist/builds
390+
cp dist/torch_tensorrt* /tmp/dist/builds
383391
384392
build-py-ngc:
385393
description: "Build the torch-tensorrt python release for NGC PyTorch (cxx11-abi)"
@@ -410,22 +418,21 @@ commands:
410418
export BAZEL_VERSION="$(cat /home/circleci/project/.bazelversion)"
411419
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"
412420
docker exec ngc_build_container bash -c "mv /workspace/docker/WORKSPACE.ngc /workspace/WORKSPACE"
413-
docker exec ngc_build_container bash -c "cd /workspace/py && pip install wheel setuptools pybind11==2.6.2"
414421
docker exec ngc_build_container bash -c "git config --global --add safe.directory /workspace"
415422
- when:
416423
condition: << parameters.release >>
417424
steps:
418425
- run:
419426
name: Build torch-tensorrt release build for NGC
420427
command: |
421-
docker exec ngc_build_container bash -c "cd /workspace/py && python3 setup.py bdist_wheel --use-cxx11-abi --release"
428+
docker exec ngc_build_container bash -c "cd /workspace/ && python3 -m pip wheel --verbose --pre . --config-setting="--build-option=--release" --config-setting="--build-option=--use-cxx11-abi" -w dist"
422429
- unless:
423430
condition: << parameters.release >>
424431
steps:
425432
- run:
426433
name: Build torch-tensorrt debug build for NGC
427434
command: |
428-
docker exec ngc_build_container bash -c "cd /workspace/py && python3 setup.py bdist_wheel --use-cxx11-abi"
435+
docker exec ngc_build_container bash -c "cd /workspace/py && python3 -m pip wheel --verbose --pre . --config-setting="--build-option=--use-cxx11-abi" -w dist"
429436
- run:
430437
name: Collect builds
431438
command: |
@@ -808,6 +815,8 @@ jobs:
808815
type: string
809816
python-version:
810817
type: string
818+
cuda-version:
819+
type: string
811820
cxx11-abi:
812821
type: boolean
813822
default: false
@@ -834,18 +843,24 @@ jobs:
834843
- when:
835844
condition: << parameters.cxx11-abi >>
836845
steps:
837-
- build-py-cxx11-abi
846+
- build-py-cxx11-abi:
847+
cuda-version: << parameters.cuda-version >>
848+
torch-build-index: << parameters.torch-build-index >>
838849
- unless:
839850
condition: << parameters.cxx11-abi >>
840851
steps:
841852
- when:
842853
condition: << parameters.legacy >>
843854
steps:
844-
- build-py-legacy
855+
- build-py-legacy:
856+
cuda-version: << parameters.cuda-version >>
857+
torch-build-index: << parameters.torch-build-index >>
845858
- unless:
846859
condition: << parameters.legacy >>
847860
steps:
848-
- build-py
861+
- build-py:
862+
cuda-version: << parameters.cuda-version >>
863+
torch-build-index: << parameters.torch-build-index >>
849864
- run:
850865
name: Move to build dir
851866
command: |
@@ -1140,8 +1155,8 @@ jobs:
11401155
TRT_VERSION=$(python3 -c "from versions import __tensorrt_version__;print(__tensorrt_version__)")
11411156
CUDNN_VERSION=$(python3 -c "from versions import __cudnn_version__;print(__cudnn_version__)")
11421157
TORCH_VERSION=$(python3 -c "from torch import __version__;print(__version__.split('+')[0])")
1143-
pip3 install --upgrade pip
1144-
pip3 install -r ~/project/py/requirements.txt
1158+
python3 -m pip install pip==21.3.1
1159+
python3 -m pip install -r ~/project/py/requirements.txt
11451160
TORCH_VERSION=$(python3 -c "from torch import __version__;print(__version__.split('+')[0])")
11461161
mkdir -p ~/project/py/dist/
11471162
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
@@ -1338,6 +1353,10 @@ parameters:
13381353
type: string
13391354
default: "3.9.4"
13401355

1356+
cuda-version:
1357+
type: string
1358+
default: "11.8"
1359+
13411360
# Nightly platform config
13421361
torch-build:
13431362
type: string
@@ -1418,6 +1437,7 @@ workflows:
14181437
torchvision-build: << pipeline.parameters.torchvision-build >>
14191438
torch-build-index: << pipeline.parameters.torch-build-index >>
14201439
python-version: << pipeline.parameters.python-version >>
1440+
cuda-version: << pipeline.parameters.cuda-version >>
14211441

14221442
- test-core-cpp-x86_64-linux:
14231443
torch-build: << pipeline.parameters.torch-build >>
@@ -1459,6 +1479,7 @@ workflows:
14591479

14601480
- build-x86_64-linux:
14611481
name: build-x86_64-linux-legacy
1482+
cuda-version: << pipeline.parameters.cuda-version >>
14621483
torch-build: << pipeline.parameters.torch-build-legacy >>
14631484
torchvision-build: << pipeline.parameters.torchvision-build-legacy >>
14641485
torch-build-index: << pipeline.parameters.torch-build-index-legacy >>
@@ -1551,6 +1572,7 @@ workflows:
15511572
on-push:
15521573
jobs:
15531574
- build-x86_64-linux:
1575+
cuda-version: << pipeline.parameters.cuda-version >>
15541576
torch-build: << pipeline.parameters.torch-build >>
15551577
torchvision-build: << pipeline.parameters.torchvision-build >>
15561578
torch-build-index: << pipeline.parameters.torch-build-index >>

pyproject.toml

Lines changed: 36 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ requires = [
1111
"typing_extensions",
1212
"future",
1313
"tensorrt>=8.6,<8.7",
14-
"torch >=2.0.0,<2.1.0",
15-
#"torch==2.1.0.dev20230605+cu118",
14+
#"torch >=2.0.0,<2.1.0",
15+
"torch==2.1.0.dev20230605+cu118",
1616
"pybind11==2.6.2"
1717
]
1818
build-backend = "setuptools.build_meta"
@@ -75,6 +75,40 @@ no_implicit_optional = true
7575

7676
[tool.setuptools]
7777
package-dir = {"" = "py"}
78+
include-package-data = true
79+
80+
[tool.setuptools.package-data]
81+
torch_tensorrt = [
82+
"BUILD",
83+
"WORKSPACE",
84+
]
85+
"torch_tensorrt.include" = [
86+
"include/torch_tensorrt/*.h",
87+
"include/torch_tensorrt/core/*.h",
88+
"include/torch_tensorrt/core/conversion/*.h",
89+
"include/torch_tensorrt/core/conversion/conversionctx/*.h",
90+
"include/torch_tensorrt/core/conversion/converters/*.h",
91+
"include/torch_tensorrt/core/conversion/evaluators/*.h",
92+
"include/torch_tensorrt/core/conversion/tensorcontainer/*.h",
93+
"include/torch_tensorrt/core/conversion/var/*.h",
94+
"include/torch_tensorrt/core/ir/*.h",
95+
"include/torch_tensorrt/core/lowering/*.h",
96+
"include/torch_tensorrt/core/lowering/passes/*.h",
97+
"include/torch_tensorrt/core/partitioning/*.h",
98+
"include/torch_tensorrt/core/partitioning/segmentedblock/*.h",
99+
"include/torch_tensorrt/core/partitioning/partitioninginfo/*.h",
100+
"include/torch_tensorrt/core/partitioning/partitioningctx/*.h",
101+
"include/torch_tensorrt/core/plugins/*.h",
102+
"include/torch_tensorrt/core/plugins/impl/*.h",
103+
"include/torch_tensorrt/core/runtime/*.h",
104+
"include/torch_tensorrt/core/util/*.h",
105+
"include/torch_tensorrt/core/util/logging/*.h",
106+
]
107+
"torch_tensorrt.lib" = ["*"]
108+
"torch_tensorrt.bin" = ["*"]
109+
110+
[tool.setuptools.exclude-package-data]
111+
torch_tensorrt = ["csrc/"]
78112

79113
[tool.setuptools.packages.find]
80114
where = ["py"]

0 commit comments

Comments
 (0)