-
Notifications
You must be signed in to change notification settings - Fork 181
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'feature/ncnn-backend' of https://github.com/kendryte/nn…
…case into feature/ncnn-backend
- Loading branch information
Showing
778 changed files
with
63,070 additions
and
4,852 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,3 +5,4 @@ UseTab: Never | |
PointerAlignment: Right | ||
AllowShortLambdasOnASingleLine: All | ||
IndentWidth: 4 | ||
ColumnLimit: 80 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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: | | ||
|
@@ -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: | | ||
|
@@ -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: | ||
|
@@ -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}} | ||
|
@@ -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 | ||
|
@@ -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: | ||
|
@@ -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' | ||
|
@@ -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 | ||
|
@@ -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 | ||
|
@@ -327,4 +324,4 @@ jobs: | |
with: | ||
name: nncase-coverage-report | ||
path: coveragereport | ||
if-no-files-found: error | ||
if-no-files-found: error |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.