Skip to content

Commit

Permalink
Merge branch 'master' into release/2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangyang2057 committed Sep 22, 2023
2 parents e325238 + e76b478 commit c853e3d
Show file tree
Hide file tree
Showing 251 changed files with 8,981 additions and 3,016 deletions.
11 changes: 10 additions & 1 deletion .github/workflows/code-format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,20 @@ name: code-format

on: [pull_request]

concurrency:
group: code-format-${{ github.ref }}
cancel-in-progress: true

permissions:
contents: read

jobs:
code-format:
permissions:
contents: write # for stefanzweifel/git-auto-commit-action to push code in repo
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Setup .NET
uses: actions/setup-dotnet@v1
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/compiler-build.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
name: compiler-build

on: [push, pull_request]

concurrency:
group: compiler-build-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/master' && !startsWith(github.ref, 'refs/heads/release/') }}

env:
NUGET_CERT_REVOCATION_MODE: offline
NUGET_PACKAGES: ${{ github.workspace }}/.nuget/packages
Expand Down Expand Up @@ -256,6 +261,7 @@ jobs:
dotnet-coverage collect -s tools/dotnet_coverage.settings.xml -f cobertura -o coverage/tflite_basic.xml pytest tests/importer/tflite_/basic/ --doctest-modules --junitxml=test_results/tflite_basic.xml
dotnet-coverage collect -s tools/dotnet_coverage.settings.xml -f cobertura -o coverage/tflite_combine.xml pytest tests/importer/tflite_/combine/ --doctest-modules --junitxml=test_results/tflite_combine.xml
dotnet-coverage collect -s tools/dotnet_coverage.settings.xml -f cobertura -o coverage/tflite_model.xml pytest tests/importer/tflite_/model/ --doctest-modules --junitxml=test_results/tflite_model.xml
dotnet-coverage collect -s tools/dotnet_coverage.settings.xml -f cobertura -o coverage/ncnn_basic.xml pytest tests/importer/ncnn_/basic/ --doctest-modules --junitxml=test_results/ncnn_basic.xml
dotnet-coverage merge -o coverage.integration.xml -f cobertura -r coverage/*.xml
- name: Upload Coverage
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/compiler-python-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ name: compiler-python-release

on: [push, pull_request]

concurrency:
group: compiler-python-release-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/master' && !startsWith(github.ref, 'refs/heads/release/') }}

jobs:
build-compiler:
name: build-${{matrix.config.name}}
Expand Down
60 changes: 30 additions & 30 deletions .github/workflows/jupyter-test.yml
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
# on:
# push:
# tags:
# - '*'
on:
push:
tags:
- '*'

# jobs:
# test:
# name: test-notebook-${{matrix.config.name}}
# runs-on: ${{matrix.config.os}}
# strategy:
# matrix:
# config:
# - {name: x86_64-macos, os: macos-latest}
# - {name: x86_64-linux, os: ubuntu-latest}
# - {name: x86_64-windows, os: windows-latest}
# steps:
# - uses: actions/checkout@v2
# - name: Setup Python
# uses: actions/setup-python@v2
# with:
# python-version: 3.7
# - name: Install dependencies
# run: pip install --upgrade pip && pip install jupyterlab pytest nbmake
# - name: Run tests
# run: pytest --nbmake examples/user_guide
# env:
# PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION: python
jobs:
test:
name: test-notebook-${{matrix.config.name}}
runs-on: ${{matrix.config.os}}
strategy:
matrix:
config:
- {name: x86_64-macos, os: macos-latest}
- {name: x86_64-linux, os: ubuntu-latest}
- {name: x86_64-windows, os: windows-latest}

steps:
- uses: actions/checkout@v2

- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: 3.7

- name: Install dependencies
run: pip install --upgrade pip && pip install jupyterlab pytest nbmake

- name: Run tests
run: pytest --nbmake examples/user_guide
env:
PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION: python
4 changes: 4 additions & 0 deletions .github/workflows/runtime-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ name: runtime-build

on: [push, pull_request]

concurrency:
group: runtime-build-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/master' && !startsWith(github.ref, 'refs/heads/release/') }}

jobs:
build-native-runtime:
name: build-runtime-${{matrix.config.name}}
Expand Down
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,9 @@ __pycache__/
# vscode
.vscode/

# clangd
.cache/

# pip
/python/*/dist
*egg-info
Expand Down Expand Up @@ -301,6 +304,6 @@ nupkg
*.runsettings
cmake-build-*
*gmodel_dump_dir*

*.ipynb_checkpoints*
# Auto generated files
# generated/
17 changes: 14 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,23 @@ endif()

if(NOT DEFINED NNCASE_VERSION_SUFFIX)
find_package (Git)

execute_process(
COMMAND ${GIT_EXECUTABLE} describe --always --dirty
COMMAND ${GIT_EXECUTABLE} describe --always --dirty --tag
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
OUTPUT_VARIABLE GIT_DESC
OUTPUT_VARIABLE GIT_TAG
OUTPUT_STRIP_TRAILING_WHITESPACE)
set(NNCASE_VERSION_SUFFIX "-${GIT_DESC}")

if ("v${NNCASE_VERSION}" STREQUAL ${GIT_TAG})
set(NNCASE_VERSION_SUFFIX "")
else()
execute_process(
COMMAND ${GIT_EXECUTABLE} describe --always --dirty
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
OUTPUT_VARIABLE GIT_DESC
OUTPUT_STRIP_TRAILING_WHITESPACE)
set(NNCASE_VERSION_SUFFIX "-${GIT_DESC}")
endif()
endif()

if (NOT PACKAGE_VERSION)
Expand Down
12 changes: 6 additions & 6 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -49,20 +49,20 @@
<PackageVersion Include="OrtKISharp" Version="0.0.2" />
<PackageVersion Include="RazorLight" Version="2.3.0" />
<PackageVersion Include="Singulink.Collections.Weak" Version="1.0.2" />
<PackageVersion Include="StyleCop.Analyzers" Version="1.2.0-beta.435" />
<PackageVersion Include="StyleCop.Analyzers" Version="1.2.0-beta.507" />
<PackageVersion Include="System.CommandLine.Hosting" Version="0.3.0-alpha.21216.1" />
<PackageVersion Include="System.Linq.Async" Version="6.0.1" />
<PackageVersion Include="System.Reactive" Version="5.0.0" />
<PackageVersion Include="Tomlyn.Extensions.Configuration" Version="1.0.5" />
<PackageVersion Include="xunit" Version="2.4.1" />
<PackageVersion Include="xunit.analyzers" Version="1.1.0" />
<PackageVersion Include="xunit.assert" Version="2.4.1" />
<PackageVersion Include="xunit" Version="2.5.0" />
<PackageVersion Include="xunit.analyzers" Version="1.2.0" />
<PackageVersion Include="xunit.assert" Version="2.5.0" />
<PackageVersion Include="Xunit.Combinatorial">
<Version>1.5.25</Version>
</PackageVersion>
<PackageVersion Include="xunit.core" Version="2.4.2" />
<PackageVersion Include="xunit.core" Version="2.5.0" />
<PackageVersion Include="Xunit.DependencyInjection" Version="8.3.0" />
<PackageVersion Include="xunit.runner.visualstudio" Version="2.4.3" />
<PackageVersion Include="xunit.runner.visualstudio" Version="2.5.0" />
<PackageVersion Include="xunit.v3.assert" Version="0.1.1-pre.239" />
</ItemGroup>
<ItemGroup>
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ Download prebuilt binaries from [Release](https://github.com/kendryte/nncase/rel
- [使用说明](./docs/USAGE_v2.md)
- [常见问题](./docs/FAQ_ZH.md)
- [示例](./examples/user_guide/k230_simulate-ZH.ipynb)
- [Colab run](https://colab.research.google.com/drive/1m8TTree096m5VHmq-Uc60gXyltVCgnRb?usp=sharing)

## Resources

Expand Down
19 changes: 19 additions & 0 deletions docs/ncnn_ops.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
## Supported ncnn ops

## 支持的 ncnn 算子

| Operator | Is Supported |
|-------|------------------ |
| Input ||
| Clip ||
| Concat ||
| Convolution ||
| ConvolutionDepthWise ||
| HardSigmoid ||
| HardSwish ||
| Innerproduct ||
| Pooling ||
| ReLU ||
| Sigmoid ||
| Softmax ||
| Split ||
33 changes: 33 additions & 0 deletions examples/user_guide/test.param
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
7767517
31 31
Input data 0 1 data -23330=4,3,224,224,3 0=224 1=224 2=3
Convolution conv1 1 1 data conv1_relu1 -23330=4,3,112,112,32 0=32 1=3 3=2 4=1 5=1 6=864 9=1
ConvolutionDepthWise conv2_1/dw 1 1 conv1_relu1 conv2_1/dw_relu2_1/dw -23330=4,3,112,112,32 0=32 1=3 4=1 5=1 6=288 7=32 9=1
Convolution conv2_1/sep 1 1 conv2_1/dw_relu2_1/dw conv2_1/sep_relu2_1/sep -23330=4,3,112,112,64 0=64 1=1 5=1 6=2048 9=1
ConvolutionDepthWise conv2_2/dw 1 1 conv2_1/sep_relu2_1/sep conv2_2/dw_relu2_2/dw -23330=4,3,56,56,64 0=64 1=3 3=2 4=1 5=1 6=576 7=64 9=1
Convolution conv2_2/sep 1 1 conv2_2/dw_relu2_2/dw conv2_2/sep_relu2_2/sep -23330=4,3,56,56,128 0=128 1=1 5=1 6=8192 9=1
ConvolutionDepthWise conv3_1/dw 1 1 conv2_2/sep_relu2_2/sep conv3_1/dw_relu3_1/dw -23330=4,3,56,56,128 0=128 1=3 4=1 5=1 6=1152 7=128 9=1
Convolution conv3_1/sep 1 1 conv3_1/dw_relu3_1/dw conv3_1/sep_relu3_1/sep -23330=4,3,56,56,128 0=128 1=1 5=1 6=16384 9=1
ConvolutionDepthWise conv3_2/dw 1 1 conv3_1/sep_relu3_1/sep conv3_2/dw_relu3_2/dw -23330=4,3,28,28,128 0=128 1=3 3=2 4=1 5=1 6=1152 7=128 9=1
Convolution conv3_2/sep 1 1 conv3_2/dw_relu3_2/dw conv3_2/sep_relu3_2/sep -23330=4,3,28,28,256 0=256 1=1 5=1 6=32768 9=1
ConvolutionDepthWise conv4_1/dw 1 1 conv3_2/sep_relu3_2/sep conv4_1/dw_relu4_1/dw -23330=4,3,28,28,256 0=256 1=3 4=1 5=1 6=2304 7=256 9=1
Convolution conv4_1/sep 1 1 conv4_1/dw_relu4_1/dw conv4_1/sep_relu4_1/sep -23330=4,3,28,28,256 0=256 1=1 5=1 6=65536 9=1
ConvolutionDepthWise conv4_2/dw 1 1 conv4_1/sep_relu4_1/sep conv4_2/dw_relu4_2/dw -23330=4,3,14,14,256 0=256 1=3 3=2 4=1 5=1 6=2304 7=256 9=1
Convolution conv4_2/sep 1 1 conv4_2/dw_relu4_2/dw conv4_2/sep_relu4_2/sep -23330=4,3,14,14,512 0=512 1=1 5=1 6=131072 9=1
ConvolutionDepthWise conv5_1/dw 1 1 conv4_2/sep_relu4_2/sep conv5_1/dw_relu5_1/dw -23330=4,3,14,14,512 0=512 1=3 4=1 5=1 6=4608 7=512 9=1
Convolution conv5_1/sep 1 1 conv5_1/dw_relu5_1/dw conv5_1/sep_relu5_1/sep -23330=4,3,14,14,512 0=512 1=1 5=1 6=262144 9=1
ConvolutionDepthWise conv5_2/dw 1 1 conv5_1/sep_relu5_1/sep conv5_2/dw_relu5_2/dw -23330=4,3,14,14,512 0=512 1=3 4=1 5=1 6=4608 7=512 9=1
Convolution conv5_2/sep 1 1 conv5_2/dw_relu5_2/dw conv5_2/sep_relu5_2/sep -23330=4,3,14,14,512 0=512 1=1 5=1 6=262144 9=1
ConvolutionDepthWise conv5_3/dw 1 1 conv5_2/sep_relu5_2/sep conv5_3/dw_relu5_3/dw -23330=4,3,14,14,512 0=512 1=3 4=1 5=1 6=4608 7=512 9=1
Convolution conv5_3/sep 1 1 conv5_3/dw_relu5_3/dw conv5_3/sep_relu5_3/sep -23330=4,3,14,14,512 0=512 1=1 5=1 6=262144 9=1
ConvolutionDepthWise conv5_4/dw 1 1 conv5_3/sep_relu5_3/sep conv5_4/dw_relu5_4/dw -23330=4,3,14,14,512 0=512 1=3 4=1 5=1 6=4608 7=512 9=1
Convolution conv5_4/sep 1 1 conv5_4/dw_relu5_4/dw conv5_4/sep_relu5_4/sep -23330=4,3,14,14,512 0=512 1=1 5=1 6=262144 9=1
ConvolutionDepthWise conv5_5/dw 1 1 conv5_4/sep_relu5_4/sep conv5_5/dw_relu5_5/dw -23330=4,3,14,14,512 0=512 1=3 4=1 5=1 6=4608 7=512 9=1
Convolution conv5_5/sep 1 1 conv5_5/dw_relu5_5/dw conv5_5/sep_relu5_5/sep -23330=4,3,14,14,512 0=512 1=1 5=1 6=262144 9=1
ConvolutionDepthWise conv5_6/dw 1 1 conv5_5/sep_relu5_5/sep conv5_6/dw_relu5_6/dw -23330=4,3,7,7,512 0=512 1=3 3=2 4=1 5=1 6=4608 7=512 9=1
Convolution conv5_6/sep 1 1 conv5_6/dw_relu5_6/dw conv5_6/sep_relu5_6/sep -23330=4,3,7,7,1024 0=1024 1=1 5=1 6=524288 9=1
ConvolutionDepthWise conv6/dw 1 1 conv5_6/sep_relu5_6/sep conv6/dw_relu6/dw -23330=4,3,7,7,1024 0=1024 1=3 4=1 5=1 6=9216 7=1024 9=1
Convolution conv6/sep 1 1 conv6/dw_relu6/dw conv6/sep_relu6/sep -23330=4,3,7,7,1024 0=1024 1=1 5=1 6=1048576 9=1
Pooling pool6 1 1 conv6/sep_relu6/sep pool6 -23330=4,1,1024,1,1 0=1 4=1
InnerProduct fc7 1 1 pool6 fc7 -23330=4,1,1000,1,1 0=1000 1=1 2=1024000
Softmax prob 1 1 fc7 output -23330=4,1,1000,1,1
Loading

0 comments on commit c853e3d

Please sign in to comment.