Compare commits

...

9 Commits

Author SHA1 Message Date
huochenghai a0ecf2bedf fix onnx test runner 2024-05-06 19:14:50 +08:00
huochenghai 2ad15afdfd
Merge branch 'master' into feature/ndsbp 2024-05-06 16:10:37 +08:00
huochenghai 83ca3fbb11 restore SwapBinaryArgs 2024-05-06 16:02:46 +08:00
huochenghai f452b5ac6b imgnore .mono in git 2024-05-06 16:01:26 +08:00
huochenghai f520ebe825 do not pre-preprocess onnx with external data 2024-05-06 15:58:43 +08:00
huochenghai 68a761db2e update setup.py 2024-05-06 15:58:00 +08:00
huochenghai 8e922609e8 do not swap binary args 2024-04-29 15:11:49 +08:00
zhangyang2057 b17e5b22b6
Fix macos-latest doesn't support python 3.7 issue. (#1194)
* Fix macos-latest doesn't support python 3.7 issue.

* Set macos version to 12(13 uses Xcode 15).
2024-04-26 17:03:38 +08:00
huochenghai 91ea4df975
fix fold binary (#1182) 2024-04-12 12:26:50 +08:00
8 changed files with 19 additions and 14 deletions

View File

@ -17,7 +17,7 @@ jobs:
strategy:
matrix:
config:
- {name: x86_64-macos, os: macos-latest, cmakeArgs: -DENABLE_X86SIMD=OFF, buildType: Release}
- {name: x86_64-macos, os: macos-12, cmakeArgs: -DENABLE_X86SIMD=OFF, 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}
@ -79,7 +79,7 @@ jobs:
matrix:
dotnet-version: ['7.0']
config:
- {name: x86_64-macos, os: macos-latest, shell: bash, rid: osx-x64, buildType: Release}
- {name: x86_64-macos, os: macos-12, shell: bash, rid: osx-x64, 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}
@ -168,7 +168,7 @@ jobs:
matrix:
dotnet-version: ['7.0']
config:
- {name: x86_64-macos, os: macos-latest, shell: bash}
- {name: x86_64-macos, os: macos-12, shell: bash}
- {name: x86_64-linux, os: ubuntu-latest, shell: bash}
- {name: x86_64-windows, os: windows-latest, shell: bash}
@ -245,7 +245,7 @@ jobs:
cache-dependency-path: '**/requirements.test.txt'
- name: Install Python Packages
run:
run:
python -m pip install --upgrade pip
pip install -r requirements.test.txt

View File

@ -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: x86_64-macos, os: macos-12, shell: bash, rid: osx-x64, 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}
@ -53,7 +53,7 @@ jobs:
matrix:
dotnet-version: ['7.0']
config:
- {name: x86_64-macos, os: macos-latest}
- {name: x86_64-macos, os: macos-12}
- {name: x86_64-linux, os: ubuntu-latest}
- {name: x86_64-windows, os: windows-latest, arch: x64}

View File

@ -10,7 +10,7 @@ jobs:
strategy:
matrix:
config:
- {name: x86_64-macos, os: macos-latest}
- {name: x86_64-macos, os: macos-12}
- {name: x86_64-linux, os: ubuntu-latest}
- {name: x86_64-windows, os: windows-latest}

View File

@ -13,7 +13,7 @@ jobs:
strategy:
matrix:
config:
- { name: x86_64-macos, os: macos-latest, cmakeArgs: '', buildType: Release }
- { name: x86_64-macos, os: macos-12, 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 }
@ -109,7 +109,7 @@ jobs:
wget https://dav.sunnycase.moe/d/ci/nncase/${{matrix.config.toolchain_file}}.tar.xz -O toolchain.tar.xz
sudo tar xf toolchain.tar.xz -C $GITHUB_WORKSPACE
echo "${{matrix.config.toolchain_env}}=$GITHUB_WORKSPACE/${{matrix.config.toolchain_file}}" >> $GITHUB_ENV
wget https://dav.sunnycase.moe/d/ci/nncase/${{matrix.config.qemu}}.tgz -O qemu.tgz
sudo tar xf qemu.tgz -C /usr/local/bin
echo "TESTS_EXECUTABLE_LOADER=${{matrix.config.qemu}}" >> $GITHUB_ENV

3
.gitignore vendored
View File

@ -307,3 +307,6 @@ cmake-build-*
*.ipynb_checkpoints*
# Auto generated files
# generated/
.mono/
.history/

View File

@ -54,7 +54,7 @@ class nncaseConan(ConanFile):
self.requires('rapidjson/1.1.x')
if self.options.python:
self.requires('pybind11/2.6.1')
self.requires('pybind11/2.12.0')
if not self.options.runtime:
self.requires('abseil/20220623.1')

View File

@ -83,8 +83,7 @@ class InstallCMakeLibs(install_lib):
os.walk(os.path.join(bin_dir, 'sharplibs')) for _lib in files if
os.path.isfile(os.path.join(root, _lib)) and
(os.path.splitext(_lib)[-1] in [".dll", ".so", ".dylib", ".json"] or
_lib.startswith("lib"))
and not _lib.endswith(".deps.json")]
_lib.startswith("lib"))]
for lib in sharp_libs:
shutil.move(lib, os.path.join(self.build_dir,
@ -204,7 +203,7 @@ class BuildCMakeExt(build_ext):
extdir += os.path.sep
bin_dir = os.path.abspath(os.path.join(self.build_temp, 'install'))
cmake_args = ['-G', 'Ninja', '-DDOTNET_INIT_FOR_CONFIG=ON']
cmake_args = ['-G', 'Ninja', '-DDOTNET_INIT_FOR_CONFIG=OFF']
if platform.system() == 'Windows':
cmake_args += ['-DCMAKE_C_COMPILER=clang-cl']
cmake_args += ['-DCMAKE_CXX_COMPILER=clang-cl']

View File

@ -58,11 +58,13 @@ class OnnxTestRunner(TestRunner):
elif model_file.startswith('onnx-models'):
model_file = os.path.join(os.getenv('ONNX_MODELS_DIR'),
model_file[len('onnx-models/'):])
has_external_data = False
if self.case_dir != os.path.dirname(model_file):
new_file = os.path.join(self.case_dir, 'test.onnx')
shutil.copy(model_file, new_file)
for tensor in external_data_helper._get_all_tensors(onnx.load(model_file, load_external_data=False)):
if external_data_helper.uses_external_data(tensor):
has_external_data = True
info = external_data_helper.ExternalDataInfo(tensor)
file_location = external_data_helper._sanitize_path(info.location)
external_data_src_path = os.path.join(
@ -76,7 +78,8 @@ class OnnxTestRunner(TestRunner):
if not self.inputs:
self.parse_model(model_file)
model_file = self.do_preprocess(model_file)
if not has_external_data:
model_file = self.do_preprocess(model_file)
super().run(model_file)