|
| 1 | +# Use the latest 2.1 version of CircleCI pipeline process engine. |
| 2 | +# See: https://circleci.com/docs/2.0/configuration-reference |
| 3 | +version: 2.1 |
| 4 | + |
| 5 | +# Define a job to be invoked later in a workflow. |
| 6 | +# See: https://circleci.com/docs/2.0/configuration-reference/#jobs |
| 7 | +jobs: |
| 8 | + build: |
| 9 | + machine: |
| 10 | + # Primary container image where all steps run. |
| 11 | + # image: nvcr.io/nvidia/tensorrt:22.01-py3 # does not work with customized image |
| 12 | + # https://circleci.com/docs/2.0/configuration-reference#available-linux-gpu-images |
| 13 | + image: ubuntu-2004-cuda-11.4:202110-01 |
| 14 | + resource_class: gpu.nvidia.large |
| 15 | + steps: |
| 16 | + - checkout |
| 17 | + - run: |
| 18 | + name: install cudnn + tensorrt + bazel |
| 19 | + command: | |
| 20 | + cd ~ |
| 21 | + OS=ubuntu2004 |
| 22 | + CUDNN_VERSION=8.2.1.*-1+cuda11.3 |
| 23 | + TRT_VERSION=8.2.4-1+cuda11.4 |
| 24 | + BAZEL_VERSION=5.1.1 |
| 25 | + |
| 26 | + wget https://developer.download.nvidia.com/compute/cuda/repos/${OS}/x86_64/cuda-${OS}.pin |
| 27 | + sudo mv cuda-${OS}.pin /etc/apt/preferences.d/cuda-repository-pin-600 |
| 28 | + sudo apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/${OS}/x86_64/7fa2af80.pub |
| 29 | + sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 536F8F1DE80F6A35 |
| 30 | + sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A4B469963BF863CC |
| 31 | + sudo add-apt-repository "deb https://developer.download.nvidia.com/compute/cuda/repos/${OS}/x86_64/ /" |
| 32 | + sudo apt-get update |
| 33 | + sudo apt-get install libcudnn8=${CUDNN_VERSION} |
| 34 | + sudo apt-get install libcudnn8-dev=${CUDNN_VERSION} |
| 35 | +
|
| 36 | + sudo apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/{OS}/x86_64/3bf863cc.pub |
| 37 | + sudo add-apt-repository "deb https://developer.download.nvidia.com/compute/cuda/repos/${OS}/x86_64/ /" |
| 38 | + sudo apt-get update |
| 39 | + |
| 40 | + sudo apt-get install libnvinfer8=${TRT_VERSION} libnvonnxparsers8=${TRT_VERSION} libnvparsers8=${TRT_VERSION} libnvinfer-plugin8=${TRT_VERSION} libnvinfer-dev=${TRT_VERSION} libnvonnxparsers-dev=${TRT_VERSION} libnvparsers-dev=${TRT_VERSION} libnvinfer-plugin-dev=${TRT_VERSION} python3-libnvinfer=${TRT_VERSION} |
| 41 | + # check available version, apt list libnvinfer8 -a |
| 42 | + sudo wget -q https://github.com/bazelbuild/bazel/releases/download/${BAZEL_VERSION}/bazel-${BAZEL_VERSION}-linux-x86_64 -O /usr/bin/bazel |
| 43 | + sudo chmod a+x /usr/bin/bazel |
| 44 | +
|
| 45 | + - run: |
| 46 | + name: set up python environment |
| 47 | + command: | |
| 48 | + pip3 install nvidia-pyindex |
| 49 | + pip3 install nvidia-tensorrt==8.2.4.2 |
| 50 | + pip3 install --pre torch==1.13.0.dev20220621 torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/nightly/cu113 |
| 51 | + pip3 install pytest parameterized expecttest |
| 52 | + # install torch_tensorrt |
| 53 | + mv WORKSPACE.ci WORKSPACE |
| 54 | + cd py |
| 55 | + python3 setup.py install |
| 56 | +
|
| 57 | + # install fx2trt |
| 58 | + # cd py/torch_tensorrt/fx/setup |
| 59 | + # python3 setup.py install |
| 60 | + - run: |
| 61 | + name: run fx2trt tests |
| 62 | + command: | |
| 63 | + # one fix pending to enable below |
| 64 | + # cd py/torch_tensorrt/fx/test |
| 65 | + # pytest $(find . -name '*.py' | grep -v test_dispatch* | grep -v test_setitem*) |
| 66 | + |
| 67 | + cd py/torch_tensorrt/fx/test |
| 68 | + pushd converters/acc_op |
| 69 | + pytest |
| 70 | + popd |
| 71 | + pushd passes |
| 72 | + list_passes=$(ls | grep -v test_setitem*) |
| 73 | + pytest $list_passes |
| 74 | + popd |
| 75 | + pushd core |
| 76 | + pytest |
| 77 | + popd |
| 78 | + # pushd quant |
| 79 | + # pytest |
| 80 | + # popd |
| 81 | + pushd tools |
| 82 | + pytest |
| 83 | + popd |
| 84 | + pushd trt_lower |
| 85 | + pytest |
| 86 | + popd |
| 87 | + pushd tracer |
| 88 | + list_tracer=$(ls | grep -v test_dispatch_*) |
| 89 | + pytest $list_tracer |
| 90 | + popd |
| 91 | +# Invoke jobs via workflows |
| 92 | +# See: https://circleci.com/docs/2.0/configuration-reference/#workflows |
| 93 | +workflows: |
| 94 | + build_run: |
| 95 | + jobs: |
| 96 | + - build |
0 commit comments