Skip to content

Commit

Permalink
Merge branch 'main' into support-htc
Browse files Browse the repository at this point in the history
  • Loading branch information
irexyc authored Oct 10, 2023
2 parents 73e0978 + 4c376d9 commit ea41037
Show file tree
Hide file tree
Showing 65 changed files with 1,461 additions and 202 deletions.
6 changes: 5 additions & 1 deletion .github/scripts/prepare_reg_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,12 @@ def install_torch(torch_version):
tv = version.parse(torch_version)
if tv < version.parse('1.10.0'):
cuda_int = '111'
elif tv >= version.parse('1.13.0'):
elif tv < version.parse('1.13.0'):
cuda_int = '113'
elif tv < version.parse('2.0.0'):
cuda_int = '117'
else:
cuda_int = '118'

is_torch_v2 = tv >= version.parse('2.0.0')
if is_torch_v2:
Expand Down
28 changes: 16 additions & 12 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -268,12 +268,14 @@ jobs:
COLOR: ${{ steps.badge_status.conclusion == 'success' && 'green' || 'red' }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

build_cuda113_linux:
build_cuda118_linux:
needs: [build_cpu_model_convert, build_cpu_sdk, build_cuda117]
runs-on: [self-hosted, linux-3090]
container:
image: openmmlab/mmdeploy:ubuntu20.04-cuda11.3
image: openmmlab/mmdeploy:ubuntu20.04-cuda11.8
options: "--gpus=all --ipc=host"
volumes:
- /data2/pip-cache:/root/.cache/pip
steps:
- name: Checkout repository
uses: actions/checkout@v3
Expand Down Expand Up @@ -313,17 +315,17 @@ jobs:
if: always()
uses: RubbaBoy/[email protected]
with:
NAME: build_cuda113_linux
NAME: build_cuda118_linux
LABEL: 'build'
STATUS: ${{ steps.badge_status.conclusion == 'success' && 'passing' || 'failing' }}
COLOR: ${{ steps.badge_status.conclusion == 'success' && 'green' || 'red' }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

build_cuda113_windows:
build_cuda118_windows:
needs: [build_cpu_model_convert, build_cpu_sdk, build_cuda117]
runs-on: [self-hosted, win10-3080]
env:
BASE_ENV: cuda11.3-cudnn8.2-py3.8-torch1.10
BASE_ENV: mmdeploy-cuda11.8-torch2.0-py38
defaults:
run:
shell: powershell
Expand Down Expand Up @@ -356,18 +358,18 @@ jobs:
python -V
mkdir build
cd build
cmake .. -A x64 -T v142 `
cmake .. -A x64 -T v142,cuda=$env:CUDA_PATH `
-DMMDEPLOY_BUILD_TEST=ON `
-DMMDEPLOY_BUILD_SDK_CSHARP_API=ON `
-DMMDEPLOY_BUILD_SDK_PYTHON_API=ON `
-DMMDEPLOY_BUILD_SDK=ON `
-DMMDEPLOY_TARGET_DEVICES='cuda' `
-DMMDEPLOY_TARGET_BACKENDS='ort;trt' `
-DMMDEPLOY_CODEBASES='all' `
-Dpplcv_DIR="$env:PPLCV_DIR\pplcv-build\install\lib\cmake\ppl" `
-DOpenCV_DIR="$env:OPENCV_DIR\build\x64\vc15\lib" `
-Dpplcv_DIR="$env:pplcv_DIR" `
-DOpenCV_DIR="$env:OpenCV_DIR" `
-DTENSORRT_DIR="$env:TENSORRT_DIR" `
-DONNXRUNTIME_DIR="$env:ONNXRUNTIME_DIR" `
-DONNXRUNTIME_DIR="$env:ONNXRUNTIME_GPU_DIR" `
-DMMDEPLOY_BUILD_EXAMPLES=ON `
-DCUDNN_DIR="$env:CUDNN_DIR"
cmake --build . --config Release -- /m
Expand All @@ -382,21 +384,23 @@ jobs:
run: |
conda activate $env:TEMP_ENV
$env:path = "$pwd\build\bin\Release;" + $env:path
$env:path = "$env:ONNXRUNTIME_GPU_DIR\lib;" + $env:path
echo $env:path
.github\scripts\windows\test_full_pipeline.ps1 -Backend trt -Device cuda
- name: Clear temp env
if: always()
run: |
conda env remove --prefix "$env:TEMP_ENV"
badge_build_cuda113_windows:
needs: build_cuda113_windows
badge_build_cuda118_windows:
needs: build_cuda118_windows
if: always()
runs-on: ubuntu-20.04
steps:
- name: create badge
uses: RubbaBoy/[email protected]
with:
NAME: build_cuda113_windows
NAME: build_cuda118_windows
LABEL: 'build'
STATUS: ${{ needs.build_cuda113_windows.result == 'success' && 'passing' || needs.build_cuda113_windows.result }}
COLOR: ${{ needs.build_cuda113_windows.result == 'success' && 'green' || 'red' }}
Expand Down
53 changes: 33 additions & 20 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,34 +20,47 @@ on:

jobs:
publish_docker_image:
runs-on: [self-hosted, linux-3090]
runs-on: ubuntu-latest
environment: 'prod'
env:
TAG_PREFIX: openmmlab/mmdeploy:ubuntu20.04-cuda11.3-mmdeploy
TAG_PREFIX: openmmlab/mmdeploy:ubuntu20.04-cuda11.8-mmdeploy
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Get mmdeploy version
if: startsWith(github.ref, 'refs/tags/') == false
- name: Check disk space
run: |
echo "MMDEPLOY_VERSION=main" >> $GITHUB_ENV
echo "TAG=$TAG_PREFIX" >> $GITHUB_ENV
- name: Get mmdeploy tag
if: startsWith(github.ref, 'refs/tags/') == true
df -h
ls /opt/hostedtoolcache
rm -rf ${GITHUB_WORKSPACE}/.git
rm -rf /opt/hostedtoolcache/go
rm -rf /opt/hostedtoolcache/node
rm -rf /opt/hostedtoolcache/Ruby
rm -rf /opt/hostedtoolcache/CodeQL
cat /proc/cpuinfo | grep -ic proc
free
df -h
df . -h
- name: Get docker info
run: |
export MMDEPLOY_VERSION=$(python3 -c "import sys; sys.path.append('mmdeploy');from version import __version__;print(__version__)")
echo $MMDEPLOY_VERSION
echo "TAG=${TAG_PREFIX}${MMDEPLOY_VERSION}" >> $GITHUB_ENV
echo "MMDEPLOY_VERSION=v$MMDEPLOY_VERSION" >> $GITHUB_ENV
- name: Build Docker image
continue-on-error: true
docker info
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push the latest Docker image
run: |
echo $MMDEPLOY_VERSION
export TAG=$TAG_PREFIX
echo "TAG=${TAG}" >> $GITHUB_ENV
echo $TAG
docker build docker/Release/ -t ${TAG} --no-cache --build-arg MMDEPLOY_VERSION=${MMDEPLOY_VERSION}
- name: Push Docker image
continue-on-error: true
docker build ./docker/Release/ -t ${TAG} --no-cache
docker push $TAG
- name: Push docker image with released tag
if: startsWith(github.ref, 'refs/tags/') == true
run: |
export MMDEPLOY_VERSION=$(python3 -c "import sys; sys.path.append('mmdeploy');from version import __version__;print(__version__)")
echo $MMDEPLOY_VERSION
echo $TAG
docker push $TAG
export RELEASE_TAG=${TAG_PREFIX}${MMDEPLOY_VERSION}
echo $RELEASE_TAG
docker tag $TAG $RELEASE_TAG
docker push $RELEASE_TAG
8 changes: 5 additions & 3 deletions .github/workflows/prebuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,11 @@ jobs:
if: inputs.run == true || ${{ github.event_name == 'push' }}
runs-on: [self-hosted, linux-3090]
container:
image: openmmlab/mmdeploy:manylinux2014_x86_64-cuda11.3
image: openmmlab/mmdeploy:manylinux2014_x86_64-cuda11.8
options: "--gpus=all --ipc=host"
volumes:
- /data2/actions-runner/prebuild:/__w/mmdeploy/prebuild
- /data2/pip-cache:/root/.cache/pip
steps:
- name: Checkout repository
uses: actions/checkout@v3
Expand Down Expand Up @@ -80,10 +81,11 @@ jobs:
if: inputs.run == true || ${{ github.event_name == 'push' }}
runs-on: [self-hosted, linux-3090]
container:
image: openmmlab/mmdeploy:build-ubuntu16.04-cuda11.3
image: openmmlab/mmdeploy:build-ubuntu16.04-cuda11.8
options: "--gpus=all --ipc=host"
volumes:
- /data2/actions-runner/prebuild:/__w/mmdeploy/prebuild
- /data2/pip-cache:/root/.cache/pip
steps:
- name: Checkout repository
uses: actions/checkout@v3
Expand All @@ -107,7 +109,7 @@ jobs:
cd pack
python ../tools/package_tools/generate_build_config.py --backend 'ort;trt' \
--system linux --output config.yml --device cuda --build-sdk --build-sdk-monolithic \
--sdk-dynamic-net --cxx11abi --onnxruntime-dir=$ONNXRUNTIME_GPU_DIR --cudnn-dir /usr
--sdk-dynamic-net --cxx11abi --onnxruntime-dir=$ONNXRUNTIME_GPU_DIR --cudnn-dir $CUDNN_DIR
python ../tools/package_tools/mmdeploy_builder.py --config config.yml
- name: Zip mmdeploy sdk
run: |
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,19 +29,19 @@ jobs:
echo $MMDEPLOY_VERSION
echo "MMDEPLOY_VERSION=$MMDEPLOY_VERSION" >> $GITHUB_ENV
echo "OUTPUT_DIR=$PREBUILD_DIR/$MMDEPLOY_VERSION" >> $GITHUB_ENV
pip install twine
python3 -m pip install twine --user
- name: Upload mmdeploy
continue-on-error: true
run: |
cd $OUTPUT_DIR/mmdeploy
ls -sha *.whl
twine upload *.whl -u __token__ -p ${{ secrets.pypi_password }}
python3 -m twine upload *.whl -u __token__ -p ${{ secrets.pypi_password }}
- name: Upload mmdeploy_runtime
continue-on-error: true
run: |
cd $OUTPUT_DIR/mmdeploy_runtime
ls -sha *.whl
twine upload *.whl -u __token__ -p ${{ secrets.pypi_password }}
python3 -m twine upload *.whl -u __token__ -p ${{ secrets.pypi_password }}
- name: Check assets
run: |
ls -sha $OUTPUT_DIR/sdk
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/regression-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ on:
required: true
description: 'Tested torch versions. Default is ["1.10.0"]'
type: string
default: "['1.10.0']"
default: "['2.0.0']"
models:
required: true
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'
Expand Down Expand Up @@ -65,8 +65,8 @@ jobs:
timeout-minutes: 4320 # 72hours
environment: 'prod'
container:
image: openmmlab/mmdeploy:ubuntu20.04-cuda11.3
options: "--gpus=all --ipc=host"
image: openmmlab/mmdeploy:ubuntu20.04-cuda11.8
options: "--gpus=all --ipc=host -e NVIDIA_DRIVER_CAPABILITIES=all -e DISPLAY"
volumes:
- /data2/checkpoints:/__w/mmdeploy/mmdeploy_checkpoints
- /data2/benchmark:/__w/mmdeploy/data
Expand Down Expand Up @@ -173,7 +173,7 @@ jobs:
environment: 'prod'
runs-on: [self-hosted, win10-3080]
env:
BASE_ENV: cuda11.3-cudnn8.2-py3.8-torch1.10
BASE_ENV: mmdeploy-cuda11.8-torch2.0-py38
DATASET_DIR: D:\reg-test\data
REGRESSION_DIR: D:\reg-test\regression_log
CHECKPOINT_DIR: D:\reg-test\checkpoints
Expand Down Expand Up @@ -240,7 +240,7 @@ jobs:
echo "BACKENDS=$env:BACKENDS" >> $env:GITHUB_ENV
New-Item -Path build -ItemType Directory -Force
cd build
cmake .. -A x64 -T v142 `
cmake .. -A x64 -T v142,cuda=$env:CUDA_PATH `
-DMMDEPLOY_BUILD_TEST=OFF `
-DMMDEPLOY_BUILD_SDK_CSHARP_API=ON `
-DMMDEPLOY_BUILD_SDK_PYTHON_API=ON `
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ if (NOT CMAKE_BUILD_TYPE)
endif ()

cmake_minimum_required(VERSION 3.14)
project(MMDeploy VERSION 1.2.0)
project(MMDeploy VERSION 1.3.0)

set(CMAKE_CXX_STANDARD 17)

Expand Down
4 changes: 4 additions & 0 deletions configs/mmpose/pose-detection_simcc_onnxruntime_dynamic.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,7 @@
0: 'batch'
}
})

codebase_config = dict(
export_postprocess=False # do not export get_simcc_maximum
)
6 changes: 3 additions & 3 deletions csrc/mmdeploy/apis/csharp/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,14 @@ There are two methods to build the nuget package.

(*option 1*) Use the command.

If your environment is well prepared, you can just go to the `csrc\apis\csharp` folder, open a terminal and type the following command, the nupkg will be built in `csrc\apis\csharp\MMDeploy\bin\Release\MMDeployCSharp.1.2.0.nupkg`.
If your environment is well prepared, you can just go to the `csrc\apis\csharp` folder, open a terminal and type the following command, the nupkg will be built in `csrc\apis\csharp\MMDeploy\bin\Release\MMDeployCSharp.1.3.0.nupkg`.

```shell
dotnet build --configuration Release -p:Version=1.2.0
dotnet build --configuration Release -p:Version=1.3.0
```

(*option 2*) Open MMDeploy.sln && Build.

You can set the package-version through `Properties -> Package Version`. The default version is 1.2.0 if you don't set it.
You can set the package-version through `Properties -> Package Version`. The default version is 1.3.0 if you don't set it.

If you encounter missing dependencies, follow the instructions for MSVC.
Loading

0 comments on commit ea41037

Please sign in to comment.