Skip to content

Commit 062abd9

Browse files
authored
Upgrade CI and prebuild to cu118 (#2447)
* update * fix * update docs * fix * remove ort-fp16 in reg test * fix build * debug * debug * Revert "debug" This reverts commit 2505464. * Revert "debug" This reverts commit 7779f0b. * update * load ort lib for prebuilt mmdeploy
1 parent 71a1e6c commit 062abd9

File tree

22 files changed

+240
-92
lines changed

22 files changed

+240
-92
lines changed

.github/scripts/prepare_reg_test.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,12 @@ def install_torch(torch_version):
112112
tv = version.parse(torch_version)
113113
if tv < version.parse('1.10.0'):
114114
cuda_int = '111'
115-
elif tv >= version.parse('1.13.0'):
115+
elif tv < version.parse('1.13.0'):
116+
cuda_int = '113'
117+
elif tv < version.parse('2.0.0'):
116118
cuda_int = '117'
119+
else:
120+
cuda_int = '118'
117121

118122
is_torch_v2 = tv >= version.parse('2.0.0')
119123
if is_torch_v2:

.github/workflows/build.yml

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -268,12 +268,14 @@ jobs:
268268
COLOR: ${{ steps.badge_status.conclusion == 'success' && 'green' || 'red' }}
269269
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
270270

271-
build_cuda113_linux:
271+
build_cuda118_linux:
272272
needs: [build_cpu_model_convert, build_cpu_sdk, build_cuda117]
273273
runs-on: [self-hosted, linux-3090]
274274
container:
275-
image: openmmlab/mmdeploy:ubuntu20.04-cuda11.3
275+
image: openmmlab/mmdeploy:ubuntu20.04-cuda11.8
276276
options: "--gpus=all --ipc=host"
277+
volumes:
278+
- /data2/pip-cache:/root/.cache/pip
277279
steps:
278280
- name: Checkout repository
279281
uses: actions/checkout@v3
@@ -313,17 +315,17 @@ jobs:
313315
if: always()
314316
uses: RubbaBoy/[email protected]
315317
with:
316-
NAME: build_cuda113_linux
318+
NAME: build_cuda118_linux
317319
LABEL: 'build'
318320
STATUS: ${{ steps.badge_status.conclusion == 'success' && 'passing' || 'failing' }}
319321
COLOR: ${{ steps.badge_status.conclusion == 'success' && 'green' || 'red' }}
320322
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
321323

322-
build_cuda113_windows:
324+
build_cuda118_windows:
323325
needs: [build_cpu_model_convert, build_cpu_sdk, build_cuda117]
324326
runs-on: [self-hosted, win10-3080]
325327
env:
326-
BASE_ENV: cuda11.3-cudnn8.2-py3.8-torch1.10
328+
BASE_ENV: mmdeploy-cuda11.8-torch2.0-py38
327329
defaults:
328330
run:
329331
shell: powershell
@@ -356,18 +358,18 @@ jobs:
356358
python -V
357359
mkdir build
358360
cd build
359-
cmake .. -A x64 -T v142 `
361+
cmake .. -A x64 -T v142,cuda=$env:CUDA_PATH `
360362
-DMMDEPLOY_BUILD_TEST=ON `
361363
-DMMDEPLOY_BUILD_SDK_CSHARP_API=ON `
362364
-DMMDEPLOY_BUILD_SDK_PYTHON_API=ON `
363365
-DMMDEPLOY_BUILD_SDK=ON `
364366
-DMMDEPLOY_TARGET_DEVICES='cuda' `
365367
-DMMDEPLOY_TARGET_BACKENDS='ort;trt' `
366368
-DMMDEPLOY_CODEBASES='all' `
367-
-Dpplcv_DIR="$env:PPLCV_DIR\pplcv-build\install\lib\cmake\ppl" `
368-
-DOpenCV_DIR="$env:OPENCV_DIR\build\x64\vc15\lib" `
369+
-Dpplcv_DIR="$env:pplcv_DIR" `
370+
-DOpenCV_DIR="$env:OpenCV_DIR" `
369371
-DTENSORRT_DIR="$env:TENSORRT_DIR" `
370-
-DONNXRUNTIME_DIR="$env:ONNXRUNTIME_DIR" `
372+
-DONNXRUNTIME_DIR="$env:ONNXRUNTIME_GPU_DIR" `
371373
-DMMDEPLOY_BUILD_EXAMPLES=ON `
372374
-DCUDNN_DIR="$env:CUDNN_DIR"
373375
cmake --build . --config Release -- /m
@@ -382,21 +384,23 @@ jobs:
382384
run: |
383385
conda activate $env:TEMP_ENV
384386
$env:path = "$pwd\build\bin\Release;" + $env:path
387+
$env:path = "$env:ONNXRUNTIME_GPU_DIR\lib;" + $env:path
388+
echo $env:path
385389
.github\scripts\windows\test_full_pipeline.ps1 -Backend trt -Device cuda
386390
- name: Clear temp env
387391
if: always()
388392
run: |
389393
conda env remove --prefix "$env:TEMP_ENV"
390394
391-
badge_build_cuda113_windows:
392-
needs: build_cuda113_windows
395+
badge_build_cuda118_windows:
396+
needs: build_cuda118_windows
393397
if: always()
394398
runs-on: ubuntu-20.04
395399
steps:
396400
- name: create badge
397401
uses: RubbaBoy/[email protected]
398402
with:
399-
NAME: build_cuda113_windows
403+
NAME: build_cuda118_windows
400404
LABEL: 'build'
401405
STATUS: ${{ needs.build_cuda113_windows.result == 'success' && 'passing' || needs.build_cuda113_windows.result }}
402406
COLOR: ${{ needs.build_cuda113_windows.result == 'success' && 'green' || 'red' }}

.github/workflows/docker.yml

Lines changed: 33 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -20,34 +20,47 @@ on:
2020

2121
jobs:
2222
publish_docker_image:
23-
runs-on: [self-hosted, linux-3090]
23+
runs-on: ubuntu-latest
2424
environment: 'prod'
2525
env:
26-
TAG_PREFIX: openmmlab/mmdeploy:ubuntu20.04-cuda11.3-mmdeploy
26+
TAG_PREFIX: openmmlab/mmdeploy:ubuntu20.04-cuda11.8-mmdeploy
2727
steps:
2828
- name: Checkout repository
2929
uses: actions/checkout@v3
30-
- name: Get mmdeploy version
31-
if: startsWith(github.ref, 'refs/tags/') == false
30+
- name: Check disk space
3231
run: |
33-
echo "MMDEPLOY_VERSION=main" >> $GITHUB_ENV
34-
echo "TAG=$TAG_PREFIX" >> $GITHUB_ENV
35-
- name: Get mmdeploy tag
36-
if: startsWith(github.ref, 'refs/tags/') == true
32+
df -h
33+
ls /opt/hostedtoolcache
34+
rm -rf ${GITHUB_WORKSPACE}/.git
35+
rm -rf /opt/hostedtoolcache/go
36+
rm -rf /opt/hostedtoolcache/node
37+
rm -rf /opt/hostedtoolcache/Ruby
38+
rm -rf /opt/hostedtoolcache/CodeQL
39+
cat /proc/cpuinfo | grep -ic proc
40+
free
41+
df -h
42+
df . -h
43+
- name: Get docker info
3744
run: |
38-
export MMDEPLOY_VERSION=$(python3 -c "import sys; sys.path.append('mmdeploy');from version import __version__;print(__version__)")
39-
echo $MMDEPLOY_VERSION
40-
echo "TAG=${TAG_PREFIX}${MMDEPLOY_VERSION}" >> $GITHUB_ENV
41-
echo "MMDEPLOY_VERSION=v$MMDEPLOY_VERSION" >> $GITHUB_ENV
42-
- name: Build Docker image
43-
continue-on-error: true
45+
docker info
46+
- name: Login to Docker Hub
47+
uses: docker/login-action@v2
48+
with:
49+
username: ${{ secrets.DOCKERHUB_USERNAME }}
50+
password: ${{ secrets.DOCKERHUB_TOKEN }}
51+
- name: Build and push the latest Docker image
4452
run: |
45-
echo $MMDEPLOY_VERSION
53+
export TAG=$TAG_PREFIX
54+
echo "TAG=${TAG}" >> $GITHUB_ENV
4655
echo $TAG
47-
docker build docker/Release/ -t ${TAG} --no-cache --build-arg MMDEPLOY_VERSION=${MMDEPLOY_VERSION}
48-
- name: Push Docker image
49-
continue-on-error: true
56+
docker ./docker/Release/ -t ${TAG} --no-cache
57+
docker push $TAG
58+
- name: Push docker image with released tag
59+
if: startsWith(github.ref, 'refs/tags/') == true
5060
run: |
61+
export MMDEPLOY_VERSION=$(python3 -c "import sys; sys.path.append('mmdeploy');from version import __version__;print(__version__)")
5162
echo $MMDEPLOY_VERSION
52-
echo $TAG
53-
docker push $TAG
63+
export RELEASE_TAG=${TAG_PREFIX}${MMDEPLOY_VERSION}
64+
echo $RELEASE_TAG
65+
docker tag $TAG $RELEASE_TAG
66+
docker push $RELEASE_TAG

.github/workflows/prebuild.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,11 @@ jobs:
2222
if: inputs.run == true || ${{ github.event_name == 'push' }}
2323
runs-on: [self-hosted, linux-3090]
2424
container:
25-
image: openmmlab/mmdeploy:manylinux2014_x86_64-cuda11.3
25+
image: openmmlab/mmdeploy:manylinux2014_x86_64-cuda11.8
2626
options: "--gpus=all --ipc=host"
2727
volumes:
2828
- /data2/actions-runner/prebuild:/__w/mmdeploy/prebuild
29+
- /data2/pip-cache:/root/.cache/pip
2930
steps:
3031
- name: Checkout repository
3132
uses: actions/checkout@v3
@@ -80,10 +81,11 @@ jobs:
8081
if: inputs.run == true || ${{ github.event_name == 'push' }}
8182
runs-on: [self-hosted, linux-3090]
8283
container:
83-
image: openmmlab/mmdeploy:build-ubuntu16.04-cuda11.3
84+
image: openmmlab/mmdeploy:build-ubuntu16.04-cuda11.8
8485
options: "--gpus=all --ipc=host"
8586
volumes:
8687
- /data2/actions-runner/prebuild:/__w/mmdeploy/prebuild
88+
- /data2/pip-cache:/root/.cache/pip
8789
steps:
8890
- name: Checkout repository
8991
uses: actions/checkout@v3
@@ -107,7 +109,7 @@ jobs:
107109
cd pack
108110
python ../tools/package_tools/generate_build_config.py --backend 'ort;trt' \
109111
--system linux --output config.yml --device cuda --build-sdk --build-sdk-monolithic \
110-
--sdk-dynamic-net --cxx11abi --onnxruntime-dir=$ONNXRUNTIME_GPU_DIR --cudnn-dir /usr
112+
--sdk-dynamic-net --cxx11abi --onnxruntime-dir=$ONNXRUNTIME_GPU_DIR --cudnn-dir $CUDNN_DIR
111113
python ../tools/package_tools/mmdeploy_builder.py --config config.yml
112114
- name: Zip mmdeploy sdk
113115
run: |

.github/workflows/regression-test.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ on:
2727
required: true
2828
description: 'Tested torch versions. Default is ["1.10.0"]'
2929
type: string
30-
default: "['1.10.0']"
30+
default: "['2.0.0']"
3131
models:
3232
required: true
3333
description: 'Tested model list, eg: "resnet yolov3". Default is "all".\r\n Example: resnet ssd yolov5 maskrcnn srcnn pointpillars dbnet crnn hrnet fastscnn slowfast RotatedRetinanet'
@@ -65,8 +65,8 @@ jobs:
6565
timeout-minutes: 4320 # 72hours
6666
environment: 'prod'
6767
container:
68-
image: openmmlab/mmdeploy:ubuntu20.04-cuda11.3
69-
options: "--gpus=all --ipc=host"
68+
image: openmmlab/mmdeploy:ubuntu20.04-cuda11.8
69+
options: "--gpus=all --ipc=host -e NVIDIA_DRIVER_CAPABILITIES=all -e DISPLAY"
7070
volumes:
7171
- /data2/checkpoints:/__w/mmdeploy/mmdeploy_checkpoints
7272
- /data2/benchmark:/__w/mmdeploy/data
@@ -173,7 +173,7 @@ jobs:
173173
environment: 'prod'
174174
runs-on: [self-hosted, win10-3080]
175175
env:
176-
BASE_ENV: cuda11.3-cudnn8.2-py3.8-torch1.10
176+
BASE_ENV: mmdeploy-cuda11.8-torch2.0-py38
177177
DATASET_DIR: D:\reg-test\data
178178
REGRESSION_DIR: D:\reg-test\regression_log
179179
CHECKPOINT_DIR: D:\reg-test\checkpoints
@@ -240,7 +240,7 @@ jobs:
240240
echo "BACKENDS=$env:BACKENDS" >> $env:GITHUB_ENV
241241
New-Item -Path build -ItemType Directory -Force
242242
cd build
243-
cmake .. -A x64 -T v142 `
243+
cmake .. -A x64 -T v142,cuda=$env:CUDA_PATH `
244244
-DMMDEPLOY_BUILD_TEST=OFF `
245245
-DMMDEPLOY_BUILD_SDK_CSHARP_API=ON `
246246
-DMMDEPLOY_BUILD_SDK_PYTHON_API=ON `
File renamed without changes.

docker/Base/Dockerfile

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,24 @@
1-
ARG CUDA_INT=113
1+
ARG CUDA_INT=118
22

3+
FROM nvidia/cuda:11.8.0-cudnn8-devel-ubuntu20.04 AS cuda-118
34
FROM nvidia/cuda:11.3.0-cudnn8-devel-ubuntu20.04 AS cuda-113
4-
FROM nvidia/cuda:10.2-cudnn8-devel-ubuntu18.04 AS cuda-102
55

66
FROM cuda-${CUDA_INT} AS final
77

8-
ARG TORCH_VERSION=1.10.0
9-
ARG TORCHVISION_VERSION=0.11.0
8+
ARG TORCH_VERSION=2.0.0
9+
ARG TORCHVISION_VERSION=0.15.1
1010

1111
# important dependencies
1212
ARG OPENCV_VERSION==4.5.4.60
1313
ARG PPLCV_VERSION=0.7.0
1414

1515
# backends
16-
ARG ONNXRUNTIME_VERSION=1.8.1
16+
ARG ONNXRUNTIME_VERSION=1.15.1
1717
ARG PPLNN_VERSION=0.8.1
18-
ARG NCNN_VERSION=20221128
19-
ARG TENSORRT_VERSION=8.2.3.0
18+
ARG NCNN_VERSION=20230816
19+
ARG TENSORRT_VERSION=8.6.1.6
20+
ARG OPENVINO_VERSION=2022.3.0
21+
2022
# tensorrt tar file url
2123
ARG TENSORRT_URL
2224

@@ -47,21 +49,23 @@ ENV LD_LIBRARY_PATH=/usr/local/cuda/lib64:$LD_LIBRARY_PATH
4749
RUN wget https://download.java.net/java/GA/jdk18/43f95e8614114aeaa8e8a5fcf20a682d/36/GPL/openjdk-18_linux-x64_bin.tar.gz &&\
4850
tar xvf openjdk-18_linux-x64_bin.tar.gz && rm -rf openjdk-18_linux-x64_bin.tar.gz && \
4951
wget https://github.com/microsoft/onnxruntime/releases/download/v${ONNXRUNTIME_VERSION}/onnxruntime-linux-x64-${ONNXRUNTIME_VERSION}.tgz &&\
50-
tar -xzvf onnxruntime-linux-x64-${ONNXRUNTIME_VERSION}.tgz && rm onnxruntime-*.tgz &&\
52+
tar -xzvf onnxruntime-linux-x64-${ONNXRUNTIME_VERSION}.tgz &&\
53+
wget https://github.com/microsoft/onnxruntime/releases/download/v${ONNXRUNTIME_VERSION}/onnxruntime-linux-x64-gpu-${ONNXRUNTIME_VERSION}.tgz &&\
54+
tar -xzvf onnxruntime-linux-x64-gpu-${ONNXRUNTIME_VERSION}.tgz && rm onnxruntime-*.tgz &&\
5155
wget https://github.com/Kitware/CMake/releases/download/v3.25.2/cmake-3.25.2-linux-x86_64.tar.gz &&\
5256
tar -xzvf cmake-3.25.2-linux-x86_64.tar.gz && rm cmake-*.tar.gz && mv cmake-* cmake &&\
5357
export CUDA_INT=$(echo $CUDA_VERSION | awk '{split($0, a, "."); print a[1]a[2]}') &&\
5458
python3 -m pip install --no-cache-dir --upgrade pip setuptools wheel &&\
5559
python3 -m pip install --no-cache-dir onnxruntime-gpu==${ONNXRUNTIME_VERSION} &&\
56-
python3 -m pip install --no-cache-dir openvino openvino-dev[onnx] &&\
60+
python3 -m pip install --no-cache-dir openvino openvino-dev[onnx]==${OPENVINO_VERSION} &&\
5761
python3 -m pip install --no-cache-dir opencv-python==${OPENCV_VERSION} opencv-python-headless==${OPENCV_VERSION} opencv-contrib-python==${OPENCV_VERSION} &&\
5862
python3 -m pip install --no-cache-dir torch==${TORCH_VERSION}+cu${CUDA_INT} torchvision==${TORCHVISION_VERSION}+cu${CUDA_INT} -f https://download.pytorch.org/whl/torch_stable.html
5963

6064
# create env
6165
ENV JAVA_HOME=/root/workspace/jdk-18
6266
ENV PATH=$JAVA_HOME/bin:/root/workspace/cmake/bin:$PATH
63-
ENV ONNXRUNTIME_VERSION=${ONNXRUNTIME_VERSION}
6467
ENV ONNXRUNTIME_DIR=/root/workspace/onnxruntime-linux-x64-${ONNXRUNTIME_VERSION}
68+
ENV ONNXRUNTIME_GPU_DIR=/root/workspace/onnxruntime-linux-x64-gpu-${ONNXRUNTIME_VERSION}
6569
ENV LD_LIBRARY_PATH=${ONNXRUNTIME_DIR}/lib:$LD_LIBRARY_PATH
6670

6771
### install ppl.nn

docker/Release/Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
FROM openmmlab/mmdeploy:ubuntu20.04-cuda11.3
1+
FROM openmmlab/mmdeploy:ubuntu20.04-cuda11.8
22

3-
ARG MMDEPLOY_VERSION
3+
ARG MMDEPLOY_VERSION=main
44

55
ENV BACKUP_LD_LIBRARY_PATH=$LD_LIBRARY_PATH
66
ENV LD_LIBRARY_PATH=/usr/local/cuda/compat:$LD_LIBRARY_PATH
@@ -20,7 +20,7 @@ RUN git clone --recursive -b $MMDEPLOY_VERSION --depth 1 https://github.com/open
2020
python3 -m pip install -U openmim pycuda &&\
2121
python3 -m mim install "mmcv>=2.0.0" &&\
2222
python3 -m pip install -r requirements.txt &&\
23-
python3 -m pip install -e .
23+
python3 -m pip install -e . --user
2424

2525
ENV MMDeploy_DIR="/root/workspace/mmdeploy/build/install/lib/cmake/MMDeploy"
2626
ENV LD_LIBRARY_PATH="/root/workspace/mmdeploy/build/lib:${BACKUP_LD_LIBRARY_PATH}"

docker/prebuild/Dockerfile

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,19 @@ ARG CUDA_URL
55
ARG CUDNN_URL
66
ARG TENSORRT_URL
77

8-
ARG CUDA_VERSION=11.3
8+
ARG CUDA_VERSION=11.8
99

1010
# important dependencies
1111
ARG OPENCV_VERSION=4.5.5
1212
ARG PPLCV_VERSION=0.7.0
1313

1414
# backends
15-
ARG ONNXRUNTIME_VERSION=1.8.1
16-
ARG TENSORRT_VERSION=8.2.3.0
15+
ARG ONNXRUNTIME_VERSION=1.15.1
16+
ARG TENSORRT_VERSION=8.6.1.6
1717

1818
# torch
19-
ARG TORCH_VERSION=1.10.0
20-
ARG TORCHVISION_VERSION=0.11.0
19+
ARG TORCH_VERSION=2.0.0
20+
ARG TORCHVISION_VERSION=0.15.0
2121

2222
ARG TOOLSET_VERSION=7
2323

@@ -105,6 +105,7 @@ RUN curl -fsSL -v -o ~/miniconda.sh -O https://repo.anaconda.com/miniconda/Mini
105105
/opt/conda/bin/conda create -n mmdeploy-3.8 python=3.8 -y &&\
106106
/opt/conda/bin/conda create -n mmdeploy-3.9 python=3.9 -y &&\
107107
/opt/conda/bin/conda create -n mmdeploy-3.10 python=3.10 -y &&\
108+
/opt/conda/bin/conda create -n mmdeploy-3.11 python=3.11 -y &&\
108109
export CUDA_INT=$(echo $CUDA_VERSION | awk '{split($0, a, "."); print a[1]a[2]}') &&\
109110
/opt/conda/bin/conda create -n torch${TORCH_VERSION} python=3.8 -y &&\
110111
/opt/conda/envs/mmdeploy-3.6/bin/pip install --no-cache-dir setuptools wheel pyyaml packaging &&\

0 commit comments

Comments
 (0)