Skip to content

Commit

Permalink
chore: Adding CMake to the CI
Browse files Browse the repository at this point in the history
  • Loading branch information
narendasan committed Aug 25, 2022
1 parent 4d32d47 commit 5afd028
Showing 1 changed file with 78 additions and 6 deletions.
84 changes: 78 additions & 6 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
# See: https://circleci.com/docs/2.0/configuration-reference
version: 2.1

orbs:
cmake: sensu/cmake@1.0.0

commands:
install-bazel:
description: "Install bazel"
Expand Down Expand Up @@ -207,6 +210,26 @@ commands:
mkdir -p /tmp/dist/builds
cp dist/* /tmp/dist/builds
build-cmake:
description: "Build the torch-tensorrt using CMake"
parameters:
platform:
type: string
default: "x86_64"
steps:
- run:
name: Build torch-tensorrt library with CMake
command: |
mkdir build
cmake -S. -Bbuild \
-DCMAKE_MODULE_PATH=cmake/Module \
-DTorch_DIR=/opt/circleci/.pyenv/versions/3.9.4/lib/python3.9/site-packages/torch/share/cmake/Torch \
-DTensorRT_ROOT=/usr \
-DCMAKE_BUILD_TYPE=Debug
cmake --build build
mkdir -p /tmp/dist/builds
cp -r build /tmp/dist/builds
dump-test-env:
description: "Dump the test env to console"
steps:
Expand Down Expand Up @@ -632,7 +655,7 @@ jobs:
platform: "x86_64"
cudnn-version: << pipeline.parameters.cudnn-release-version >>
trt-version-short: << pipeline.parameters.trt-release-version-short >>
bazel-version: "5.1.1"
bazel-version: << pipeline.parameters.bazel-version >>
bazel-platform: "x86_64"
- run:
name: Build cxx11-abi tarball
Expand Down Expand Up @@ -703,7 +726,7 @@ jobs:
platform: "sbsa"
cudnn-version: << pipeline.parameters.cudnn-jetson-version >>
trt-version-short: << pipeline.parameters.trt-jetson-version-short >>
bazel-version: "5.1.1"
bazel-version: << pipeline.parameters.bazel-version >>
bazel-platform: "arm64"
- run:
name: Set python version
Expand Down Expand Up @@ -742,6 +765,45 @@ jobs:
path: /tmp/dist/jetson
destination: aarch64-release-pkgs

build-x86_64-cmake:
parameters:
cudnn-version:
type: string
trt-version-short:
type: string
torch-build:
type: string
torch-build-index:
type: string
machine:
image: ubuntu-2004-cuda-11.4:202110-01
resource_class: xlarge
steps:
- checkout
- create-env:
os: "ubuntu2004"
platform: "x86_64"
cudnn-version: << parameters.cudnn-version >>
trt-version-short: << parameters.trt-version-short >>
bazel-platform: "x86_64"
- cmake/install:
version: 3.24.1
- install-torch-from-index:
torch-build: << parameters.torch-build >>
torch-build-index: << parameters.torch-build-index >>
- build-cmake
- run:
name: Move to cmake build dir
command: |
mkdir -p /tmp/dist/cmake
cp -r /tmp/dist/builds/* /tmp/dist/cmake
- persist_to_workspace:
root: /tmp/dist
paths:
- cmake
- store_artifacts:
path: /tmp/dist/cmake
destination: x86_64-cmake

parameters:
bazel-version:
Expand Down Expand Up @@ -821,7 +883,6 @@ workflows:
jetpack-version: << pipeline.parameters.jetpack-version >>
python-version: 3.8.10


- build-x86_64-pyt-release:
torch-build: << pipeline.parameters.torch-release-build >>
torch-build-index: << pipeline.parameters.torch-release-build-index >>
Expand Down Expand Up @@ -855,7 +916,6 @@ workflows:
requires:
- build-x86_64-pyt-release


- build-x86_64-pyt-nightly:
torch-build: << pipeline.parameters.torch-nightly-build >>
torch-build-index: << pipeline.parameters.torch-nightly-build-index >>
Expand Down Expand Up @@ -901,7 +961,6 @@ workflows:
torch-build: << pipeline.parameters.torch-release-build >>
torch-build-index: << pipeline.parameters.torch-release-build-index >>


- test-core-cpp-x86_64:
name: test-core-cpp-x86_64-pyt-release
channel: "release"
Expand Down Expand Up @@ -958,7 +1017,6 @@ workflows:
jetpack-version: << pipeline.parameters.jetpack-version >>
python-version: 3.8.10


- build-x86_64-pyt-release:
torch-build: << pipeline.parameters.torch-release-build >>
torch-build-index: << pipeline.parameters.torch-release-build-index >>
Expand Down Expand Up @@ -1025,3 +1083,17 @@ workflows:
trt-version-long: << pipeline.parameters.trt-nightly-version-long >>
requires:
- build-x86_64-pyt-nightly

- build-x86_64-cmake:
name: build-x86_64-cmake-pyt-nightly
torch-build: << pipeline.parameters.torch-nightly-build >>
torch-build-index: << pipeline.parameters.torch-nightly-build-index >>
trt-version-short: << pipeline.parameters.trt-nightly-version-short >>
cudnn-version: << pipeline.parameters.cudnn-nightly-version >>

- build-x86_64-cmake:
name: build-x86_64-cmake-pyt-release
torch-build: << pipeline.parameters.torch-release-build >>
torch-build-index: << pipeline.parameters.torch-release-build-index >>
trt-version-short: << pipeline.parameters.trt-release-version-short >>
cudnn-version: << pipeline.parameters.cudnn-release-version >>

0 comments on commit 5afd028

Please sign in to comment.