Skip to content

Commit 162f4cb

Browse files
authored
fix ci (#2058)
* fix * fix * update * fix
1 parent 49103cb commit 162f4cb

File tree

5 files changed

+88
-125
lines changed

5 files changed

+88
-125
lines changed

.github/scripts/quantize_to_ncnn.py

Lines changed: 0 additions & 59 deletions
This file was deleted.

.github/workflows/backend-ncnn.yml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,3 +78,58 @@ jobs:
7878
python -m pip install mmcv-lite
7979
python tools/scripts/build_ubuntu_x64_ncnn.py 8
8080
python -c 'import mmdeploy.apis.ncnn as ncnn_api; assert ncnn_api.is_available(with_custom_ops=True)'
81+
82+
test_ncnn_ptq:
83+
runs-on: [self-hosted, linux-3090]
84+
container:
85+
image: openmmlab/mmdeploy:ubuntu20.04-cuda11.3
86+
options: "--gpus=all --ipc=host"
87+
steps:
88+
- name: Checkout repository
89+
uses: actions/checkout@v3
90+
with:
91+
submodules: recursive
92+
- name: Install dependencies
93+
run: |
94+
apt-get update
95+
apt-get install ninja-build -y
96+
python3 -V
97+
python3 -m pip install openmim
98+
python3 -m pip install -r requirements.txt
99+
python3 -m mim install $(cat requirements/codebases.txt | grep mmpretrain)
100+
python3 -m pip install numpy==1.22.0
101+
python3 -m pip list
102+
- name: Install mmdeploy
103+
run: |
104+
rm -rf .eggs && python3 -m pip install -e .
105+
python3 tools/check_env.py
106+
- name: Install ppq
107+
run: |
108+
git clone -b v0.6.6 --depth 1 https://github.com/openppl-public/ppq
109+
cd ppq
110+
python3 -m pip install -r requirements.txt
111+
python3 setup.py install
112+
- name: Test ncnn + ppq pipeline
113+
run: |
114+
export PYTHONPATH=${PWD}/ppq:${PYTHONPATH}
115+
export LD_LIBRARY_PATH="/root/workspace/mmdeploy/build/lib:${LD_LIBRARY_PATH}"
116+
export LD_LIBRARY_PATH="/root/workspace/mmdeploy/mmdeploy/lib:${LD_LIBRARY_PATH}"
117+
export work_dir=./work_dir
118+
mkdir -p $work_dir
119+
export model_cfg=$work_dir/resnet18_8xb32_in1k.py
120+
export deploy_cfg=configs/mmpretrain/classification_ncnn-int8_static.py
121+
export checkpoint=$work_dir/resnet18_8xb32_in1k_20210831-fbbb1da6.pth
122+
export input_img=tests/data/tiger.jpeg
123+
python3 -m mim download mmpretrain --config resnet18_8xb32_in1k --dest $work_dir
124+
python3 tools/torch2onnx.py $deploy_cfg $model_cfg $checkpoint $input_img --work-dir $work_dir
125+
wget https://media.githubusercontent.com/media/tpoisonooo/mmdeploy-onnx2ncnn-testdata/main/dataset.tar
126+
tar xvf dataset.tar
127+
python3 tools/onnx2ncnn_quant_table.py \
128+
--onnx $work_dir/end2end.onnx \
129+
--deploy-cfg $deploy_cfg \
130+
--model-cfg $model_cfg \
131+
--out-onnx $work_dir/quant.onnx \
132+
--out-table $work_dir/ncnn.table \
133+
--image-dir ./dataset
134+
ls -sha $work_dir/quant.onnx
135+
cat $work_dir/ncnn.table

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ jobs:
4848
python -m pip install -r requirements/backends.txt
4949
python -m mim install "mmcv>=2.0.0"
5050
python -m mim install -r requirements/codebases.txt
51-
python -m pip install -U numpy clip numba transformers
51+
python -m pip install clip numba transformers numpy==1.23
5252
python -m pip list
5353
- name: Install mmyolo
5454
run: |

.github/workflows/quantize.yml

Lines changed: 0 additions & 65 deletions
This file was deleted.

.github/workflows/stale.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: 'Close stale issues and PRs'
2+
3+
on:
4+
schedule:
5+
# check issue and pull request once at 01:30 a.m. every day
6+
- cron: '30 1 * * *'
7+
8+
permissions:
9+
contents: read
10+
11+
jobs:
12+
stale:
13+
permissions:
14+
issues: write
15+
pull-requests: write
16+
runs-on: ubuntu-latest
17+
steps:
18+
- uses: actions/stale@v7
19+
with:
20+
stale-issue-message: 'This issue is marked as stale because it has been marked as invalid or awaiting response for 7 days without any further response. It will be closed in 5 days if the stale label is not removed or if there is no further response.'
21+
stale-pr-message: 'This PR is marked as stale because there has been no activity in the past 45 days. It will be closed in 10 days if the stale label is not removed or if there is no further updates.'
22+
close-issue-message: 'This issue is closed because it has been stale for 5 days. Please open a new issue if you have similar issues or you have any new updates now.'
23+
close-pr-message: 'This PR is closed because it has been stale for 10 days. Please reopen this PR if you have any updates and want to keep contributing the code.'
24+
# only issues/PRS with following labels are checked
25+
any-of-labels: 'invalid, awaiting response, duplicate'
26+
days-before-issue-stale: 7
27+
days-before-pr-stale: 45
28+
days-before-issue-close: 5
29+
days-before-pr-close: 10
30+
# automatically remove the stale label when the issues or the pull requests are updated or commented
31+
remove-stale-when-updated: true
32+
operations-per-run: 50

0 commit comments

Comments
 (0)