mmdeploy/.github/workflows/quantize.yml

78 lines
2.4 KiB
YAML

name: quantize
on:
push:
paths-ignore:
- "demo/**"
- "tools/**"
pull_request:
paths-ignore:
- "demo/**"
- "tools/**"
- "docs/**"
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
test_ncnn_PTQ:
runs-on: ubuntu-18.04
container:
image: pytorch/pytorch:1.8.0-cuda11.1-cudnn8-devel
strategy:
matrix:
python-version: [3.7]
torch: [1.8.0+cu111]
mmcv: [1.4.2]
include:
- torch: 1.8.0+cu111
torch_version: torch1.8
torchvision: 0.9.0+cu111
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install system dependencies
run: |
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A4B469963BF863CC
apt-get update && apt-get install -y wget ffmpeg libsm6 libxext6 git ninja-build libglib2.0-0 libxrender-dev python${{matrix.python-version}}-dev
apt-get clean
rm -rf /var/lib/apt/lists/*
- name: Install PyTorch
run: python -m pip install torch==${{matrix.torch}} torchvision==${{matrix.torchvision}} -f https://download.pytorch.org/whl/torch_stable.html
- name: Install dependencies
run: |
python -V
python -m pip install mmcv-full==${{matrix.mmcv}} -f https://download.openmmlab.com/mmcv/dist/cu111/${{matrix.torch_version}}/index.html
CFLAGS=`python -c 'import sysconfig;print("-I"+sysconfig.get_paths()["include"])'` python -m pip install -r requirements.txt
python -m pip install -U numpy
- name: Install mmcls
run: |
cd ~
git clone https://github.com/open-mmlab/mmclassification.git
cd mmclassification
git checkout v0.23.0
python3 -m pip install -e .
cd -
- name: Install ppq
run: |
cd ~
python -m pip install protobuf==3.20.0
git clone https://github.com/openppl-public/ppq
cd ppq
git checkout edbecf44c7b203515640e4f4119c000a1b66b33a
python3 -m pip install -r requirements.txt
python3 setup.py install
cd -
- name: Run tests
run: |
echo $(pwd)
python3 .github/scripts/quantize_to_ncnn.py