forked from jiuyuan/InfiniTensor
82 lines
2.4 KiB
YAML
82 lines
2.4 KiB
YAML
name: Build and test cpu
|
|
on:
|
|
push:
|
|
paths-ignore:
|
|
- '**.md'
|
|
- 'LICENSE'
|
|
pull_request:
|
|
paths:
|
|
- '**.md'
|
|
- 'LICENSE'
|
|
|
|
env:
|
|
protobuf-download: https://github.com/protocolbuffers/protobuf/releases/download/v21.12/protobuf-cpp-3.21.12.tar.gz
|
|
protobuf-version: "3.21.12"
|
|
python-version: "3.10"
|
|
|
|
resnet-download: https://github.com/onnx/models/raw/main/vision/classification/resnet/model/resnet18-v2-7.onnx
|
|
inception-download: https://media.githubusercontent.com/media/onnx/models/main/vision/classification/inception_and_googlenet/inception_v2/model/inception-v2-9.onnx
|
|
densenet-download: https://github.com/onnx/models/raw/main/vision/classification/densenet-121/model/densenet-12.onnx
|
|
efficientnet-download: https://github.com/onnx/models/raw/main/vision/classification/efficientnet-lite4/model/efficientnet-lite4-11.onnx
|
|
|
|
jobs:
|
|
build:
|
|
name: Build
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
with:
|
|
submodules: recursive
|
|
|
|
- name: Set up Python ${{ env.python-version }}
|
|
uses: actions/setup-python@v4
|
|
with:
|
|
python-version: ${{ env.python-version }}
|
|
|
|
- name: Install libdw
|
|
run: sudo apt-get update && sudo apt-get install libdw-dev
|
|
|
|
# - name: Cache protobuf
|
|
# id: cache-protobuf
|
|
# uses: actions/cache@v3
|
|
# with:
|
|
# path: protobuf-${{ env.protobuf-version }}
|
|
# key: protobuf-${{ env.protobuf-version }}
|
|
|
|
# - name: Download and compile protobuf
|
|
# if: steps.cache-protobuf.outputs.cache-hit != 'true'
|
|
# run: |
|
|
# wget ${{ env.protobuf-download }}
|
|
# tar xf protobuf-cpp-${{ env.protobuf-version }}.tar.gz
|
|
# cd protobuf-${{ env.protobuf-version }}
|
|
# ./autogen.sh
|
|
# ./configure CFLAGS="-fPIC" CXXFLAGS="-fPIC"
|
|
# make -j8
|
|
|
|
# - name: Install protobuf
|
|
# run: |
|
|
# cd protobuf-${{ env.protobuf-version }}
|
|
# sudo make install
|
|
# sudo ldconfig
|
|
|
|
- name: Build
|
|
run: make
|
|
|
|
- name: Test cpu
|
|
run: make test-cpp
|
|
|
|
- name: Install python-frontend
|
|
run: |
|
|
python -m pip install --upgrade pip
|
|
make install-python
|
|
|
|
- name: Download test models
|
|
run: |
|
|
wget ${{ env.resnet-download }}
|
|
wget ${{ env.inception-download }}
|
|
wget ${{ env.densenet-download }}
|
|
wget ${{ env.efficientnet-download }}
|
|
|
|
- name: Test onnx frontend
|
|
run: make test-onnx
|