Skip to content

Commit

Permalink
Merge branch 'feature/ncnn-backend' of https://github.com/kendryte/nn…
Browse files Browse the repository at this point in the history
…case into feature/ncnn-backend
  • Loading branch information
curioyang committed Jun 7, 2024
2 parents 7fd4286 + dac19f2 commit fa74f42
Show file tree
Hide file tree
Showing 778 changed files with 63,070 additions and 4,852 deletions.
1 change: 1 addition & 0 deletions .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ UseTab: Never
PointerAlignment: Right
AllowShortLambdasOnASingleLine: All
IndentWidth: 4
ColumnLimit: 80
73 changes: 35 additions & 38 deletions .github/workflows/compiler-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,34 +17,29 @@ jobs:
strategy:
matrix:
config:
- {name: x86_64-macos, os: macos-latest, cmakeArgs: -DENABLE_X86SIMD=OFF, buildType: Release}
- {name: aarch64-macos, os: macos-14, cmakeArgs: '', buildType: Release}
- {name: x86_64-linux, os: ubuntu-latest, cmakeArgs: '', buildType: Release}
- {name: x86_64-windows, os: windows-latest, arch: x64, cmakeArgs: -DCMAKE_C_COMPILER=clang-cl -DCMAKE_CXX_COMPILER=clang-cl, buildType: Release}

steps:
- uses: actions/checkout@v3
- uses: seanmiddleditch/gha-setup-ninja@master

- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.10'

- name: Set up build environment (Windows, Visual Studio)
uses: ilammy/msvc-dev-cmd@v1
with:
arch: ${{matrix.config.arch}}
if: runner.os == 'Windows'

- name: Set up build environment (Macos)
run: |
brew install sunnycase/core/[email protected]
if: runner.os == 'Macos'

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

- name: Install Conan
shell: bash
run: |
pip install conan==1.58
pip install conan==1.64
- name: Configure Conan (Linux)
run: |
Expand All @@ -54,6 +49,13 @@ jobs:
echo "CXX=g++-10" >> $GITHUB_ENV
if: runner.os == 'Linux'

- name: Configure Conan (Macos)
run: |
conan config init
sed -i '' 's/xtensalx7]/xtensalx7, arm64]/g' ~/.conan/settings.yml
sed -i '' 's/"14.0"]/"14.0", "15"]/g' ~/.conan/settings.yml
if: runner.os == 'Macos'

- name: Configure CMake
shell: bash
run: |
Expand All @@ -79,12 +81,14 @@ jobs:
matrix:
dotnet-version: ['7.0']
config:
- {name: x86_64-macos, os: macos-latest, shell: bash, rid: osx-x64, buildType: Release}
- {name: aarch64-macos, os: macos-14, shell: bash, rid: osx-arm64, buildType: Release}
- {name: x86_64-linux, os: ubuntu-latest, shell: bash, rid: linux-x64, buildType: Release}
- {name: x86_64-windows, os: windows-latest, shell: bash, rid: win-x64, buildType: Release}
- {name: x86_64-windows, os: windows-latest, arch: x64, shell: bash, rid: win-x64, buildType: Release}

steps:
- uses: actions/checkout@v2
- uses: seanmiddleditch/gha-setup-ninja@master

- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
Expand All @@ -104,11 +108,6 @@ jobs:
name: nncase-native-${{matrix.config.name}}
path: ${{github.workspace}}/install

- name: Set up build environment (Macos)
run: |
brew install sunnycase/core/[email protected]
if: runner.os == 'Macos'

- name: Build
run: |
dotnet restore -r ${{matrix.config.rid}}
Expand Down Expand Up @@ -142,7 +141,7 @@ jobs:
working-directory: ${{github.workspace}}
run: |
dotnet tool install --global dotnet-coverage
dotnet-coverage collect -s tools/dotnet_coverage.settings.xml -f cobertura -o coverage/unit.xml "dotnet test -c ${{matrix.config.buildType}} -s test.runsettings --no-build --verbosity normal"
dotnet-coverage collect -s tools/dotnet_coverage.settings.xml -f cobertura -o coverage/unit.xml "dotnet test -c ${{matrix.config.buildType}} -s test.runsettings --no-build --verbosity normal --blame"
dotnet-coverage merge -o coverage.unit.xml -f cobertura -r coverage/*.xml
- name: Upload Coverage
Expand All @@ -168,20 +167,29 @@ jobs:
matrix:
dotnet-version: ['7.0']
config:
- {name: x86_64-macos, os: macos-latest, shell: bash}
- {name: aarch64-macos, os: macos-14, shell: bash}
- {name: x86_64-linux, os: ubuntu-latest, shell: bash}
- {name: x86_64-windows, os: windows-latest, shell: bash}
- {name: x86_64-windows, os: windows-latest, arch: x64, shell: bash}

env:
VULKANSDK_VER: 1.3.268.0
VULKANSDK_VER: 1.3.280.0

steps:
- uses: actions/checkout@v3
- uses: seanmiddleditch/gha-setup-ninja@master

- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: ${{matrix.dotnet-version}}

- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
cache: 'pip'
cache-dependency-path: '**/requirements.test.txt'

- name: Install nncase native Artifact
uses: actions/download-artifact@v3
with:
Expand All @@ -196,16 +204,11 @@ jobs:

- name: Set up test environment (macOS)
run: |
brew install sunnycase/core/[email protected]
aria2c --parameterized-uri=true https://{sdk.lunarg.com/sdk/download/${VULKANSDK_VER}/mac,distfiles.macports.org/MoltenVK}/vulkansdk-macos-${VULKANSDK_VER}.dmg
aria2c --parameterized-uri=true https://sdk.lunarg.com/sdk/download/${VULKANSDK_VER}/mac/vulkansdk-macos-${VULKANSDK_VER}.dmg
hdiutil attach ./vulkansdk-macos-*.dmg
sudo /Volumes/vulkansdk-macos-*/InstallVulkan.app/Contents/MacOS/InstallVulkan --root $HOME/VulkanSDK --accept-licenses --default-answer --confirm-command install
hdiutil detach /Volumes/vulkansdk-macos-*
echo "VULKAN_SDK=$HOME/VulkanSDK/macOS" >> $GITHUB_ENV
wget https://github.com/sunnycase/swiftshader/releases/download/v1.0/swiftshader-macos-10.15-x86_64.zip -O swiftshader.zip
unzip swiftshader.zip
sudo cmake -E make_directory /usr/local/share/vulkan/icd.d
sudo cp lib/* /usr/local/share/vulkan/icd.d
cp install/lib/*.dylib install/
echo "PYTHONPATH=$GITHUB_WORKSPACE/install/lib:$GITHUB_WORKSPACE/install/python:$GITHUB_WORKSPACE/tests" >> $GITHUB_ENV
if: runner.os == 'macOS'
Expand All @@ -232,18 +235,12 @@ jobs:
Expand-Archive swiftshader.zip
Copy-Item swiftshader\lib\vk_swiftshader_icd.json swiftshader\bin\
Copy-Item install/bin/*.dll install/
Copy-Item install/bin/*.dll install/lib/
echo "VK_ICD_FILENAMES=${env:GITHUB_WORKSPACE}/swiftshader/bin/vk_swiftshader_icd.json" >> $env:GITHUB_ENV
echo "PYTHONPATH=${env:GITHUB_WORKSPACE}/install/lib;${env:GITHUB_WORKSPACE}/install/python;${env:GITHUB_WORKSPACE}/tests" >> $env:GITHUB_ENV
echo "PATH=${env:PATH};${env:GITHUB_WORKSPACE}/install/bin" >> $env:GITHUB_ENV
if: runner.os == 'Windows'

- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: 3.7
cache: 'pip'
cache-dependency-path: '**/requirements.test.txt'

- name: Install Python Packages
run:
python -m pip install --upgrade pip
Expand All @@ -263,7 +260,7 @@ jobs:
dotnet-coverage collect -s tools/dotnet_coverage.settings.xml -f cobertura -o coverage/onnx_combine.xml pytest tests/importer/onnx_/combine/ --doctest-modules --junitxml=test_results/onnx_combine.xml
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/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
Expand Down Expand Up @@ -327,4 +324,4 @@ jobs:
with:
name: nncase-coverage-report
path: coveragereport
if-no-files-found: error
if-no-files-found: error
6 changes: 3 additions & 3 deletions .github/workflows/compiler-python-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
matrix:
dotnet-version: ['7.0']
config:
- {name: x86_64-macos, os: macos-latest, shell: bash, rid: osx-x64, buildType: Release}
# - {name: aarch64-macos, os: macos-14, shell: bash, rid: osx-arm64, buildType: Release}
- {name: x86_64-linux, os: ubuntu-latest, shell: bash, rid: linux-x64, buildType: Release}
- {name: x86_64-windows, os: windows-latest, shell: bash, rid: win-x64, buildType: Release}

Expand Down Expand Up @@ -53,7 +53,7 @@ jobs:
matrix:
dotnet-version: ['7.0']
config:
- {name: x86_64-macos, os: macos-latest}
# - {name: aarch64-macos, os: macos-14}
- {name: x86_64-linux, os: ubuntu-latest}
- {name: x86_64-windows, os: windows-latest, arch: x64}

Expand Down Expand Up @@ -88,7 +88,7 @@ jobs:
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: 3.7
python-version: '3.10'

- name: Install cibuildwheel
run: pip install cibuildwheel
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/jupyter-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
strategy:
matrix:
config:
- {name: x86_64-macos, os: macos-latest}
- {name: aarch64-macos, os: macos-14}
- {name: x86_64-linux, os: ubuntu-latest}
- {name: x86_64-windows, os: windows-latest}

Expand All @@ -20,7 +20,7 @@ jobs:
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: 3.7
python-version: '3.10'

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

0 comments on commit fa74f42

Please sign in to comment.