Skip to content

Commit

Permalink
Merge branch 'master' into VK_EXT_pageable_device_local_memory
Browse files Browse the repository at this point in the history
  • Loading branch information
nihui authored Apr 1, 2024
2 parents 091c609 + 6872cca commit 70c6f49
Show file tree
Hide file tree
Showing 703 changed files with 16,246 additions and 6,919 deletions.
12 changes: 9 additions & 3 deletions .ci/pnnx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ jobs:
torchvision-version: 0.16.0
torchvision-cache-key: '0_16_0'

- torch-version: 2.2.1
torchvision-version: 0.17.1
torchvision-cache-key: '0_17_1'

runs-on:
pool-name: docker
container:
Expand Down Expand Up @@ -122,6 +126,7 @@ jobs:
- name: test
run: |
export PYTHONUSERBASE=${{ci.workspace}}/torch-${{matrix.torch-version}}
export LD_LIBRARY_PATH=${{ci.workspace}}/torchvision-${{matrix.torchvision-version}}-install/lib
export OMP_NUM_THREADS=1
export MKL_NUM_THREADS=1
export MKL_ENABLE_INSTRUCTIONS=SSE4_2
Expand All @@ -131,8 +136,9 @@ jobs:
- name: python-pnnx
run: |
export PYTHONUSERBASE=${{ci.workspace}}/torch-${{matrix.torch-version}}
export LD_LIBRARY_PATH=${{ci.workspace}}/torchvision-${{matrix.torchvision-version}}-install/lib
export PNNX_WHEEL_WITHOUT_BUILD=ON
cd tools/pnnx
cp build/src/pnnx python/pnnx/
cd tools/pnnx/python
cp ../build/src/pnnx pnnx/
python3 setup.py install --user
pytest python/tests/
pytest tests
8 changes: 4 additions & 4 deletions .github/workflows/android-armv7-cpu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@ jobs:
run: |
mkdir build && cd build
cmake -DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK_LATEST_HOME/build/cmake/android.toolchain.cmake -DANDROID_ABI="armeabi-v7a" -DANDROID_ARM_NEON=ON -DANDROID_PLATFORM=android-14 ..
cmake --build . -j 2
cmake --build . -j $(nproc)
- name: build-shared
run: |
mkdir build-shared && cd build-shared
cmake -DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK_LATEST_HOME/build/cmake/android.toolchain.cmake -DANDROID_ABI="armeabi-v7a" -DANDROID_ARM_NEON=ON -DANDROID_PLATFORM=android-14 -DNCNN_SHARED_LIB=ON -DNCNN_ENABLE_LTO=OFF ..
cmake --build . -j 2
cmake --build . -j $(nproc)
- name: ndk-r16b
run: |
Expand All @@ -48,9 +48,9 @@ jobs:
run: |
mkdir build-noneon && cd build-noneon
cmake -DCMAKE_TOOLCHAIN_FILE=$GITHUB_WORKSPACE/android-ndk-r16b/build/cmake/android.toolchain.cmake -DANDROID_ABI="armeabi-v7a" -DANDROID_ARM_NEON=OFF -DANDROID_PLATFORM=android-14 ..
cmake --build . -j 2
cmake --build . -j $(nproc)
- name: build-noneon-shared
run: |
mkdir build-noneon-shared && cd build-noneon-shared
cmake -DCMAKE_TOOLCHAIN_FILE=$GITHUB_WORKSPACE/android-ndk-r16b/build/cmake/android.toolchain.cmake -DANDROID_ABI="armeabi-v7a" -DANDROID_ARM_NEON=OFF -DANDROID_PLATFORM=android-14 -DNCNN_SHARED_LIB=ON -DNCNN_ENABLE_LTO=OFF ..
cmake --build . -j 2
cmake --build . -j $(nproc)
4 changes: 2 additions & 2 deletions .github/workflows/android-armv7-gpu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ jobs:
run: |
mkdir build && cd build
cmake -DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK_LATEST_HOME/build/cmake/android.toolchain.cmake -DANDROID_ABI="armeabi-v7a" -DANDROID_ARM_NEON=ON -DANDROID_PLATFORM=android-21 -DNCNN_VULKAN=ON ..
cmake --build . -j 2
cmake --build . -j $(nproc)
- name: build-shared
run: |
mkdir build-shared && cd build-shared
cmake -DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK_LATEST_HOME/build/cmake/android.toolchain.cmake -DANDROID_ABI="armeabi-v7a" -DANDROID_ARM_NEON=ON -DANDROID_PLATFORM=android-21 -DNCNN_VULKAN=ON -DNCNN_SHARED_LIB=ON -DNCNN_ENABLE_LTO=OFF ..
cmake --build . -j 2
cmake --build . -j $(nproc)
4 changes: 2 additions & 2 deletions .github/workflows/android-armv8-cpu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ jobs:
run: |
mkdir build && cd build
cmake -DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK_LATEST_HOME/build/cmake/android.toolchain.cmake -DANDROID_ABI="arm64-v8a" -DANDROID_PLATFORM=android-21 ..
cmake --build . -j 2
cmake --build . -j $(nproc)
- name: build-shared
run: |
mkdir build-shared && cd build-shared
cmake -DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK_LATEST_HOME/build/cmake/android.toolchain.cmake -DANDROID_ABI="arm64-v8a" -DANDROID_PLATFORM=android-21 -DNCNN_SHARED_LIB=ON ..
cmake --build . -j 2
cmake --build . -j $(nproc)
12 changes: 6 additions & 6 deletions .github/workflows/android-armv8-gpu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,27 +37,27 @@ jobs:
run: |
mkdir build && cd build
cmake -DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK_LATEST_HOME/build/cmake/android.toolchain.cmake -DANDROID_ABI="arm64-v8a" -DANDROID_PLATFORM=android-21 -DNCNN_VULKAN=ON ..
cmake --build . -j 2
cmake --build . -j $(nproc)
- name: build-shared
run: |
mkdir build-shared && cd build-shared
cmake -DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK_LATEST_HOME/build/cmake/android.toolchain.cmake -DANDROID_ABI="arm64-v8a" -DANDROID_PLATFORM=android-21 -DNCNN_VULKAN=ON -DNCNN_SHARED_LIB=ON ..
cmake --build . -j 2
cmake --build . -j $(nproc)
- name: build-termux
run: |
mkdir build-termux && cd build-termux
cmake -DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK_LATEST_HOME/build/cmake/android.toolchain.cmake -DANDROID_ABI="arm64-v8a" -DANDROID_PLATFORM=android-21 -DNCNN_VULKAN=ON -DNCNN_PLATFORM_API=OFF ..
cmake --build . -j 2
cmake --build . -j $(nproc)
- name: build-android-29
run: |
mkdir build-android-29 && cd build-android-29
cmake -DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK_LATEST_HOME/build/cmake/android.toolchain.cmake -DANDROID_ABI="arm64-v8a" -DANDROID_PLATFORM=android-29 -DNCNN_VULKAN=ON ..
cmake --build . -j 2
cmake --build . -j $(nproc)
- name: build-android-29-shared
run: |
mkdir build-android-29-shared && cd build-android-29-shared
cmake -DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK_LATEST_HOME/build/cmake/android.toolchain.cmake -DANDROID_ABI="arm64-v8a" -DANDROID_PLATFORM=android-29 -DNCNN_VULKAN=ON -DNCNN_SHARED_LIB=ON ..
cmake --build . -j 2
cmake --build . -j $(nproc)
android-aarch64-gpu-ndk-r16b:
runs-on: ubuntu-20.04
Expand All @@ -72,4 +72,4 @@ jobs:
- name: configure
run: mkdir build && cd build && cmake -DCMAKE_TOOLCHAIN_FILE=$GITHUB_WORKSPACE/android-ndk-r16b/build/cmake/android.toolchain.cmake -DANDROID_ABI="arm64-v8a" -DANDROID_PLATFORM=android-21 -DNCNN_VULKAN=ON ..
- name: build
run: cmake --build build -j 2
run: cmake --build build -j $(nproc)
4 changes: 2 additions & 2 deletions .github/workflows/android-x64-cpu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ jobs:
run: |
mkdir build && cd build
cmake -DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK_LATEST_HOME/build/cmake/android.toolchain.cmake -DANDROID_ABI="x86_64" -DANDROID_PLATFORM=android-21 ..
cmake --build . -j 2
cmake --build . -j $(nproc)
- name: build-shared
run: |
mkdir build-shared && cd build-shared
cmake -DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK_LATEST_HOME/build/cmake/android.toolchain.cmake -DANDROID_ABI="x86_64" -DANDROID_PLATFORM=android-21 -DNCNN_SHARED_LIB=ON ..
cmake --build . -j 2
cmake --build . -j $(nproc)
4 changes: 2 additions & 2 deletions .github/workflows/android-x64-gpu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ jobs:
run: |
mkdir build && cd build
cmake -DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK_LATEST_HOME/build/cmake/android.toolchain.cmake -DANDROID_ABI="x86_64" -DANDROID_PLATFORM=android-21 -DNCNN_VULKAN=ON ..
cmake --build . -j 2
cmake --build . -j $(nproc)
- name: build-shared
run: |
mkdir build-shared && cd build-shared
cmake -DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK_LATEST_HOME/build/cmake/android.toolchain.cmake -DANDROID_ABI="x86_64" -DANDROID_PLATFORM=android-21 -DNCNN_VULKAN=ON -DNCNN_SHARED_LIB=ON ..
cmake --build . -j 2
cmake --build . -j $(nproc)
4 changes: 2 additions & 2 deletions .github/workflows/android-x86-cpu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ jobs:
run: |
mkdir build && cd build
cmake -DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK_LATEST_HOME/build/cmake/android.toolchain.cmake -DANDROID_ABI="x86" -DANDROID_PLATFORM=android-14 ..
cmake --build . -j 2
cmake --build . -j $(nproc)
- name: build-shared
run: |
mkdir build-shared && cd build-shared
cmake -DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK_LATEST_HOME/build/cmake/android.toolchain.cmake -DANDROID_ABI="x86" -DANDROID_PLATFORM=android-14 -DNCNN_SHARED_LIB=ON ..
cmake --build . -j 2
cmake --build . -j $(nproc)
4 changes: 2 additions & 2 deletions .github/workflows/android-x86-gpu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ jobs:
run: |
mkdir build && cd build
cmake -DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK_LATEST_HOME/build/cmake/android.toolchain.cmake -DANDROID_ABI="x86" -DANDROID_PLATFORM=android-21 -DNCNN_VULKAN=ON ..
cmake --build . -j 2
cmake --build . -j $(nproc)
- name: build-shared
run: |
mkdir build-shared && cd build-shared
cmake -DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK_LATEST_HOME/build/cmake/android.toolchain.cmake -DANDROID_ABI="x86" -DANDROID_PLATFORM=android-21 -DNCNN_VULKAN=ON -DNCNN_SHARED_LIB=ON ..
cmake --build . -j 2
cmake --build . -j $(nproc)
2 changes: 1 addition & 1 deletion .github/workflows/code-format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:

- name: cache-clang-format
id: cache-clang-format
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: clang-format-install
key: clang-format-install-4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ios-arm64-gpu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:

- name: cache-openmp
id: cache-openmp
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: openmp-install
key: openmp-ios-install-20230504
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ios-cpu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:

- name: cache-openmp
id: cache-openmp
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: openmp-install
key: openmp-ios-install-20230504
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ios-simulator-gpu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:

- name: cache-openmp
id: cache-openmp
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: openmp-install
key: openmp-ios-simulator-install-20230504
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ios-simulator.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:

- name: cache-openmp
id: cache-openmp
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: openmp-install
key: openmp-ios-simulator-install-20230504
Expand Down
36 changes: 18 additions & 18 deletions .github/workflows/linux-aarch64-cpu-gcc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:

- name: cache-qemu
id: cache-qemu
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: qemu-install
key: qemu-aarch64-install-20220502-ubuntu-2004-2
Expand All @@ -57,7 +57,7 @@ jobs:
run: |
cd qemu
./configure --prefix=$GITHUB_WORKSPACE/qemu-install --target-list=aarch64-linux-user --disable-system
make -j2
make -j$(nproc)
make install
- name: aarch64-gnu-toolchain
Expand All @@ -69,34 +69,34 @@ jobs:
run: |
mkdir build && cd build
cmake -DCMAKE_TOOLCHAIN_FILE=../toolchains/aarch64-linux-gnu.toolchain.cmake -DNCNN_ARM82=OFF -DNCNN_ARM82DOT=OFF -DNCNN_BUILD_TOOLS=OFF -DNCNN_BUILD_EXAMPLES=OFF -DNCNN_BUILD_TESTS=ON ..
cmake --build . -j 2
cmake --build . -j $(nproc)
- name: test
run: |
export PATH=$GITHUB_WORKSPACE/qemu-install/bin:$PATH
cd build
TESTS_EXECUTABLE_LOADER=qemu-aarch64 TESTS_EXECUTABLE_LOADER_ARGUMENTS="-L;/usr/aarch64-linux-gnu" ctest --output-on-failure -j 2
TESTS_EXECUTABLE_LOADER=qemu-aarch64 TESTS_EXECUTABLE_LOADER_ARGUMENTS="-L;/usr/aarch64-linux-gnu" ctest --output-on-failure -j $(nproc)
- name: build-noint8
run: |
mkdir build-noint8 && cd build-noint8
cmake -DCMAKE_TOOLCHAIN_FILE=../toolchains/aarch64-linux-gnu.toolchain.cmake -DNCNN_ARM82=OFF -DNCNN_ARM82DOT=OFF -DNCNN_BUILD_TOOLS=OFF -DNCNN_BUILD_EXAMPLES=OFF -DNCNN_BUILD_TESTS=ON ..
cmake --build . -j 2
cmake --build . -j $(nproc)
- name: test-noint8
run: |
export PATH=$GITHUB_WORKSPACE/qemu-install/bin:$PATH
cd build-noint8
TESTS_EXECUTABLE_LOADER=qemu-aarch64 TESTS_EXECUTABLE_LOADER_ARGUMENTS="-L;/usr/aarch64-linux-gnu" ctest --output-on-failure -j 2
TESTS_EXECUTABLE_LOADER=qemu-aarch64 TESTS_EXECUTABLE_LOADER_ARGUMENTS="-L;/usr/aarch64-linux-gnu" ctest --output-on-failure -j $(nproc)
- name: build-simplestl-simplemath
run: |
mkdir build-simplestl-simplemath && cd build-simplestl-simplemath
cmake -DCMAKE_TOOLCHAIN_FILE=../toolchains/aarch64-linux-gnu-c.toolchain.cmake -DNCNN_STDIO=ON -DNCNN_STRING=ON -DNCNN_SIMPLESTL=ON -DNCNN_SIMPLEMATH=ON -DNCNN_BUILD_TESTS=ON -DNCNN_BUILD_BENCHMARK=OFF -DNCNN_BUILD_TOOLS=OFF -DNCNN_BUILD_EXAMPLES=OFF ..
cmake --build . -j 2
cmake --build . -j $(nproc)
- name: test-simplestl-simplemath
run: |
export PATH=$GITHUB_WORKSPACE/qemu-install/bin:$PATH
cd build-simplestl-simplemath
TESTS_EXECUTABLE_LOADER=qemu-aarch64 TESTS_EXECUTABLE_LOADER_ARGUMENTS="-L;/usr/aarch64-linux-gnu" ctest --output-on-failure -j 2
TESTS_EXECUTABLE_LOADER=qemu-aarch64 TESTS_EXECUTABLE_LOADER_ARGUMENTS="-L;/usr/aarch64-linux-gnu" ctest --output-on-failure -j $(nproc)
linux-gcc-arm82:
runs-on: ubuntu-20.04
Expand All @@ -105,7 +105,7 @@ jobs:

- name: cache-qemu
id: cache-qemu
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: qemu-install
key: qemu-aarch64-install-20220502-ubuntu-2004-2
Expand All @@ -126,7 +126,7 @@ jobs:
run: |
cd qemu
./configure --prefix=$GITHUB_WORKSPACE/qemu-install --target-list=aarch64-linux-user --disable-system
make -j2
make -j$(nproc)
make install
- name: aarch64-gnu-toolchain
Expand All @@ -138,23 +138,23 @@ jobs:
run: |
mkdir build && cd build
cmake -DCMAKE_TOOLCHAIN_FILE=../toolchains/aarch64-linux-gnu.toolchain.cmake -DNCNN_ARM82=ON -DNCNN_ARM82DOT=ON -DNCNN_BUILD_TOOLS=OFF -DNCNN_BUILD_EXAMPLES=OFF -DNCNN_BUILD_TESTS=ON ..
cmake --build . -j 2
cmake --build . -j $(nproc)
- name: test
run: |
export PATH=$GITHUB_WORKSPACE/qemu-install/bin:$PATH
cd build
TESTS_EXECUTABLE_LOADER=qemu-aarch64 TESTS_EXECUTABLE_LOADER_ARGUMENTS="-L;/usr/aarch64-linux-gnu" ctest --output-on-failure -j 2
TESTS_EXECUTABLE_LOADER=qemu-aarch64 TESTS_EXECUTABLE_LOADER_ARGUMENTS="-L;/usr/aarch64-linux-gnu" ctest --output-on-failure -j $(nproc)
- name: build-noint8
run: |
mkdir build-noint8 && cd build-noint8
cmake -DCMAKE_TOOLCHAIN_FILE=../toolchains/aarch64-linux-gnu.toolchain.cmake -DNCNN_ARM82=ON -DNCNN_ARM82DOT=ON -DNCNN_BUILD_TOOLS=OFF -DNCNN_BUILD_EXAMPLES=OFF -DNCNN_BUILD_TESTS=ON -DNCNN_INT8=OFF ..
cmake --build . -j 2
cmake --build . -j $(nproc)
- name: test-noint8
run: |
export PATH=$GITHUB_WORKSPACE/qemu-install/bin:$PATH
cd build-noint8
TESTS_EXECUTABLE_LOADER=qemu-aarch64 TESTS_EXECUTABLE_LOADER_ARGUMENTS="-L;/usr/aarch64-linux-gnu" ctest --output-on-failure -j 2
TESTS_EXECUTABLE_LOADER=qemu-aarch64 TESTS_EXECUTABLE_LOADER_ARGUMENTS="-L;/usr/aarch64-linux-gnu" ctest --output-on-failure -j $(nproc)
linux-gcc-arm86:
runs-on: ubuntu-22.04
Expand All @@ -163,7 +163,7 @@ jobs:

- name: cache-qemu
id: cache-qemu
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: qemu-install
key: qemu-aarch64-install-20230717
Expand All @@ -184,7 +184,7 @@ jobs:
run: |
cd qemu
./configure --prefix=$GITHUB_WORKSPACE/qemu-install --target-list=aarch64-linux-user --disable-system
make -j2
make -j$(nproc)
make install
- name: aarch64-gnu-toolchain
Expand All @@ -196,9 +196,9 @@ jobs:
run: |
mkdir build && cd build
cmake -DCMAKE_TOOLCHAIN_FILE=../toolchains/aarch64-linux-gnu.toolchain.cmake -DNCNN_ARM82=ON -DNCNN_ARM82DOT=ON -DNCNN_BUILD_TOOLS=OFF -DNCNN_BUILD_EXAMPLES=OFF -DNCNN_BUILD_TESTS=ON ..
cmake --build . -j 2
cmake --build . -j $(nproc)
- name: test
run: |
export PATH=$GITHUB_WORKSPACE/qemu-install/bin:$PATH
cd build
TESTS_EXECUTABLE_LOADER=qemu-aarch64 TESTS_EXECUTABLE_LOADER_ARGUMENTS="-L;/usr/aarch64-linux-gnu" ctest --output-on-failure -j 2
TESTS_EXECUTABLE_LOADER=qemu-aarch64 TESTS_EXECUTABLE_LOADER_ARGUMENTS="-L;/usr/aarch64-linux-gnu" ctest --output-on-failure -j $(nproc)
Loading

0 comments on commit 70c6f49

Please sign in to comment.