diff --git a/.ci/linux-x64-cpu-gcc.yml b/.ci/linux-x64-cpu-gcc.yml index 813d4ce4829..2f970f37c12 100644 --- a/.ci/linux-x64-cpu-gcc.yml +++ b/.ci/linux-x64-cpu-gcc.yml @@ -27,10 +27,20 @@ on: - '!tools/pnnx/**' - 'examples/**' concurrency: - group: linux-x64-cpu-gcc-${{ ci.base_ref }} + group: linux-x64-cpu-gcc-${{ ci.head_ref }} jobs: linux-gcc: + name: linux-gcc + strategy: + matrix: + include: + - { SSE2: 'OFF', AVX: 'OFF', AVX2: 'OFF', AVX512: 'OFF' } + - { SSE2: 'ON', AVX: 'OFF', AVX2: 'OFF', AVX512: 'OFF' } + - { SSE2: 'ON', AVX: 'ON', AVX2: 'OFF', AVX512: 'OFF' } + - { SSE2: 'ON', AVX: 'ON', AVX2: 'ON', AVX512: 'OFF' } + - { SSE2: 'ON', AVX: 'ON', AVX2: 'ON', AVX512: 'ON' } + runs-on: pool-name: docker container: @@ -46,43 +56,22 @@ jobs: apt-get update apt-get install -y libprotobuf-dev protobuf-compiler libopencv-dev - - name: build-sse2 - run: | - mkdir build-sse2 && cd build-sse2 - cmake -DNCNN_AVX=OFF -DNCNN_BUILD_TESTS=ON .. - cmake --build . -j $(nproc) - - name: test-sse2 - run: cd build-sse2 && ctest --output-on-failure -j $(nproc) - - name: build-avx - run: | - mkdir build-avx && cd build-avx - cmake -DNCNN_AVX2=OFF -DNCNN_BUILD_TESTS=ON .. - cmake --build . -j $(nproc) - - name: test-avx - run: cd build-avx && ctest --output-on-failure -j $(nproc) - - name: build-avx2 - run: | - mkdir build-avx2 && cd build-avx2 - cmake -DNCNN_AVX512=OFF -DNCNN_BUILD_TESTS=ON .. - cmake --build . -j $(nproc) - - name: test-avx2 - run: cd build-avx2 && ctest --output-on-failure -j $(nproc) - - name: build-avx512 + - name: build run: | - mkdir build-avx512 && cd build-avx512 - cmake -DNCNN_BUILD_TESTS=ON .. + mkdir build && cd build + cmake -DNCNN_SSE2=${{matrix.SSE2}} -DNCNN_AVX=${{matrix.AVX}} -DNCNN_AVX2=${{matrix.AVX2}} -DNCNN_AVX512=${{matrix.AVX512}} -DNCNN_BUILD_TESTS=ON .. cmake --build . -j $(nproc) - - name: test-avx512 - run: cd build-avx512 && ctest --output-on-failure -j $(nproc) + - name: test + run: cd build && ctest --output-on-failure -j $(nproc) - name: build-shared run: | mkdir build-shared && cd build-shared - cmake -DNCNN_SHARED_LIB=ON .. + cmake -DNCNN_SSE2=${{matrix.SSE2}} -DNCNN_AVX=${{matrix.AVX}} -DNCNN_AVX2=${{matrix.AVX2}} -DNCNN_AVX512=${{matrix.AVX512}} -DNCNN_SHARED_LIB=ON .. cmake --build . -j $(nproc) - name: build-noint8 run: | mkdir build-noint8 && cd build-noint8 - cmake -DNCNN_INT8=OFF -DNCNN_BUILD_TESTS=ON .. + cmake -DNCNN_SSE2=${{matrix.SSE2}} -DNCNN_AVX=${{matrix.AVX}} -DNCNN_AVX2=${{matrix.AVX2}} -DNCNN_AVX512=${{matrix.AVX512}} -DNCNN_INT8=OFF -DNCNN_BUILD_TESTS=ON .. cmake --build . -j $(nproc) - name: test-noint8 run: cd build-noint8 && ctest --output-on-failure -j $(nproc) diff --git a/.ci/pnnx.yml b/.ci/pnnx.yml new file mode 100644 index 00000000000..b13ac08f5b2 --- /dev/null +++ b/.ci/pnnx.yml @@ -0,0 +1,121 @@ +name: pnnx +on: + push: + branches: [master] + paths: + - '.ci/pnnx.yml' + - 'tools/pnnx/**' + - '!tools/pnnx/README.md' + mr: + target-branches: [master] + paths: + - '.ci/pnnx.yml' + - 'tools/pnnx/**' + - '!tools/pnnx/README.md' +concurrency: + group: pnnx-${{ ci.head_ref }} + +jobs: + ubuntu: + strategy: + matrix: + include: + - torch-version: 1.8.1 + torchvision-version: 0.9.1 + torchvision-cache-key: '0_9_1' + + - torch-version: 1.9.1 + torchvision-version: 0.10.1 + torchvision-cache-key: '0_10_1' + + - torch-version: 1.10.0 + torchvision-version: 0.11.1 + torchvision-cache-key: '0_11_1' + + - torch-version: 1.11.0 + torchvision-version: 0.12.0 + torchvision-cache-key: '0_12_0' + + - torch-version: 1.12.0 + torchvision-version: 0.13.0 + torchvision-cache-key: '0_13_0' + + - torch-version: 1.13.0 + torchvision-version: 0.14.0 + torchvision-cache-key: '0_14_0' + + runs-on: + pool-name: docker + container: + image: bkci/ci:ubuntu + steps: + - name: checkout + checkout: self + with: + enableGitLfs: false + + - name: install-deps + run: | + apt-get update + apt-get install -y python3-pip + python3 -m pip install --upgrade pip + pip3 uninstall -y setuptools + pip3 install -U pytest setuptools wheel twine distribute requests + + - name: setup pytorch + run: | + export PYTHONUSERBASE=${{ci.workspace}}/torch-${{matrix.torch-version}} + pip3 install --user torch==${{matrix.torch-version}}+cpu torchvision==${{matrix.torchvision-version}}+cpu -f https://download.pytorch.org/whl/torch_stable.html + + - name: cache-torchvision + id: cache-torchvision + uses: cache@1.* + with: + cachePaths: torchvision-${{matrix.torchvision-version}}-install + cacheKey: torchvision-${{matrix.torchvision-cache-key}}-linux-install-20211228 + - name: checkout-torchvision + if: steps.cache-torchvision.outputs.cacheHit != 'true' + checkout: https://github.com/pytorch/vision.git + with: + pullType: TAG + refName: v${{matrix.torchvision-version}} + localPath: vision + enableSubmodule: false + enableGitLfs: false + - name: torchvision + if: steps.cache-torchvision.outputs.cacheHit != 'true' + run: | + apt-get update + apt-get install -y libjpeg-dev libpng-dev + cd vision + mkdir -p build; cd build + cmake -DCMAKE_INSTALL_PREFIX=${{ci.workspace}}/torchvision-${{matrix.torchvision-version}}-install -DTorch_DIR=${{ci.workspace}}/torch-${{matrix.torch-version}}/lib/python3.9/site-packages/torch/share/cmake/Torch -DCMAKE_BUILD_TYPE=Release .. + cmake --build . -j $(nproc) + cmake --build . --target install + + - name: build-ncnn + run: | + export PYTHONUSERBASE=${{ci.workspace}}/torch-${{matrix.torch-version}} + mkdir build && cd build + cmake -DCMAKE_BUILD_TYPE=Release -DNCNN_PYTHON=ON -DNCNN_BUILD_TOOLS=OFF -DNCNN_BUILD_EXAMPLES=OFF .. + cmake --build . -j $(nproc) + cd .. + export CMAKE_BUILD_PARALLEL_LEVEL=$(nproc) + pip3 install --user . + + - name: build-pnnx + run: | + export PYTHONUSERBASE=${{ci.workspace}}/torch-${{matrix.torch-version}} + cd tools/pnnx + mkdir build && cd build + cmake -DCMAKE_BUILD_TYPE=Release -DTorchVision_INSTALL_DIR=${{ci.workspace}}/torchvision-${{matrix.torchvision-version}}-install .. + cmake --build . -j $(nproc) + + - name: test + run: | + export PYTHONUSERBASE=${{ci.workspace}}/torch-${{matrix.torch-version}} + export OMP_NUM_THREADS=1 + export MKL_NUM_THREADS=1 + export MKL_ENABLE_INSTRUCTIONS=SSE4_2 + cd tools/pnnx + cd build && ctest --output-on-failure -j $(nproc) diff --git a/.ci/test-coverage.yml b/.ci/test-coverage.yml new file mode 100644 index 00000000000..e3ed988df6d --- /dev/null +++ b/.ci/test-coverage.yml @@ -0,0 +1,792 @@ +name: test-coverage +on: + push: + branches: [master] + paths: + - '.ci/test-coverage.yml' + - 'CMakeLists.txt' + - 'cmake/**' + - 'src/**' + - 'tests/**' + - 'toolchains/**' + mr: + target-branches: [master] + paths: + - '.ci/test-coverage.yml' + - 'CMakeLists.txt' + - 'cmake/**' + - 'src/**' + - 'tests/**' + - 'toolchains/**' +concurrency: + group: test-coverage-${{ ci.head_ref }} + +jobs: + linux-gcc-gpu: + name: linux-gcc-gpu + runs-on: + pool-name: docker + container: + image: bkci/ci:ubuntu + steps: + - name: checkout + checkout: self + with: + enableGitLfs: false + + - name: install-deps + run: | + apt-get update + apt-get install -y lcov libvulkan-dev + curl https://uploader.codecov.io/verification.gpg | gpg --no-default-keyring --keyring trustedkeys.gpg --import + curl -Os https://uploader.codecov.io/latest/linux/codecov + curl -Os https://uploader.codecov.io/latest/linux/codecov.SHA256SUM + curl -Os https://uploader.codecov.io/latest/linux/codecov.SHA256SUM.sig + gpgv codecov.SHA256SUM.sig codecov.SHA256SUM + shasum -a 256 -c codecov.SHA256SUM + chmod +x codecov + + - name: cache-swiftshader + id: cache-swiftshader + uses: cache@1.* + with: + cachePaths: swiftshader-install + cacheKey: swiftshader-linux-install-20221026 + + - name: checkout-swiftshader + if: steps.cache-swiftshader.outputs.cacheHit != 'true' + checkout: https://github.com/google/swiftshader.git + with: + pullType: COMMIT_ID + refName: 04d007924c2d33ea1ac4be78ae423507a0b08b61 + localPath: swiftshader + enableSubmodule: false + enableGitLfs: false + + - name: swiftshader + if: steps.cache-swiftshader.outputs.cacheHit != 'true' + run: | + cd swiftshader + git -c submodule."third_party/git-hooks".update=none submodule update --init --recursive + mkdir -p build; cd build + cmake -DCMAKE_INSTALL_PREFIX=install -DSWIFTSHADER_BUILD_PVR=FALSE -DSWIFTSHADER_BUILD_TESTS=FALSE -DSWIFTSHADER_ENABLE_ASTC=FALSE -DSWIFTSHADER_WARNINGS_AS_ERRORS=FALSE -DREACTOR_BACKEND=Subzero -DREACTOR_DEFAULT_OPT_LEVEL=Default -DCMAKE_BUILD_TYPE=Release .. + cmake --build . -j $(nproc) + mkdir ${{ci.workspace}}/swiftshader-install + cp Linux/* ${{ci.workspace}}/swiftshader-install + + - name: build + run: | + mkdir build && cd build + cmake -DCMAKE_BUILD_TYPE=debug -DNCNN_COVERAGE=ON -DNCNN_RUNTIME_CPU=OFF -DNCNN_AVX2=ON -DNCNN_AVX512=OFF -DNCNN_XOP=OFF -DNCNN_OPENMP=OFF -DNCNN_VULKAN=ON -DNCNN_BUILD_TOOLS=OFF -DNCNN_BUILD_EXAMPLES=OFF -DNCNN_BUILD_TESTS=ON .. + cmake --build . -j $(nproc) + - name: test + run: | + printf "[Processor]\nThreadCount=4\n" > build/tests/SwiftShader.ini + export VK_ICD_FILENAMES="${{ci.workspace}}/swiftshader-install/vk_swiftshader_icd.json" + cd build && ctest --output-on-failure -j 4 + - name: lcov-collect + run: | + cd build + lcov -d ./src -c -o lcov.info + lcov -r lcov.info '/usr/*' -o lcov.info + lcov -r lcov.info '*/build/*' -o lcov.info + lcov -r lcov.info '*/glslang/*' -o lcov.info + lcov --list lcov.info + - name: codecov + run: ./codecov -t ${{settings.CODECOV_TOKEN.access_token}} -C ${{ ci.sha }} -B ${{ ci.head_ref }} -f build/lcov.info + + linux-gcc-gpu-lavapipe: + name: linux-gcc-gpu-lavapipe + runs-on: + pool-name: docker + container: + image: bkci/ci:ubuntu + steps: + - name: checkout + checkout: self + with: + enableGitLfs: false + + - name: install-deps + run: | + apt-get update + apt-get install -y lcov libvulkan-dev libxcb-shm0 + curl https://uploader.codecov.io/verification.gpg | gpg --no-default-keyring --keyring trustedkeys.gpg --import + curl -Os https://uploader.codecov.io/latest/linux/codecov + curl -Os https://uploader.codecov.io/latest/linux/codecov.SHA256SUM + curl -Os https://uploader.codecov.io/latest/linux/codecov.SHA256SUM.sig + gpgv codecov.SHA256SUM.sig codecov.SHA256SUM + shasum -a 256 -c codecov.SHA256SUM + chmod +x codecov + + - name: cache-lavapipe + id: cache-lavapipe + uses: cache@1.* + with: + cachePaths: lavapipe-install + cacheKey: lavapipe-linux-install-20211127-3 + + - name: checkout-lavapipe + if: steps.cache-lavapipe.outputs.cacheHit != 'true' + checkout: https://github.com/mesa3d/mesa.git + with: + pullType: COMMIT_ID + refName: cd39180cfab20734744b379b085cc3b5c2cecd3a + localPath: mesa + enableSubmodule: false + enableGitLfs: false + + - name: lavapipe + if: steps.cache-lavapipe.outputs.cacheHit != 'true' + run: | + echo 'deb-src http://mirrors.cloud.tencent.com/debian bullseye main' | tee -a /etc/apt/sources.list + echo 'deb-src http://mirrors.cloud.tencent.com/debian bullseye-updates main' | tee -a /etc/apt/sources.list + apt-get update + apt-get build-dep -y mesa + mkdir -p "${{ci.workspace}}/lavapipe-install" + cd mesa + mkdir build + cd build + meson -Dprefix="${{ci.workspace}}/lavapipe-install" -Dbuildtype=release -Db_lto=true -Db_ndebug=true -Dplatforms="x11" -Ddri3=enabled -Ddri-drivers="" -Dgallium-drivers=swrast -Dgallium-vdpau=disabled -Dgallium-xvmc=disabled -Dgallium-omx=disabled -Dgallium-va=disabled -Dgallium-xa=disabled -Dgallium-opencl=disabled -Dopencl-native=false -Dvulkan-drivers=swrast -Dshader-cache=disabled -Dgles1=disabled -Dgles2=disabled -Dopengl=false -Dgbm=disabled -Dglx=disabled -Degl=disabled -Dllvm=enabled -Dvalgrind=disabled -Dlibunwind=disabled -Dlmsensors=disabled .. + ninja -j$(nproc) + ninja install + find ${{ci.workspace}}/lavapipe-install + cat ${{ci.workspace}}/lavapipe-install/share/vulkan/icd.d/lvp_icd.x86_64.json + + - name: build + run: | + mkdir build && cd build + cmake -DCMAKE_BUILD_TYPE=debug -DNCNN_COVERAGE=ON -DNCNN_RUNTIME_CPU=OFF -DNCNN_AVX2=ON -DNCNN_AVX512=OFF -DNCNN_XOP=OFF -DNCNN_OPENMP=OFF -DNCNN_VULKAN=ON -DNCNN_BUILD_TOOLS=OFF -DNCNN_BUILD_EXAMPLES=OFF -DNCNN_BUILD_TESTS=ON .. + cmake --build . -j $(nproc) + - name: test + run: | + export LP_NUM_THREADS=4 + export VK_ICD_FILENAMES="${{ci.workspace}}/lavapipe-install/share/vulkan/icd.d/lvp_icd.x86_64.json" + cd build + ctest --output-on-failure -j 4 + - name: lcov-collect + run: | + cd build + lcov -d ./src -c -o lcov.info + lcov -r lcov.info '/usr/*' -o lcov.info + lcov -r lcov.info '*/build/*' -o lcov.info + lcov -r lcov.info '*/glslang/*' -o lcov.info + lcov --list lcov.info + - name: codecov + run: ./codecov -t ${{settings.CODECOV_TOKEN.access_token}} -C ${{ ci.sha }} -B ${{ ci.head_ref }} -f build/lcov.info + + linux-gcc-x64: + name: linux-gcc-x64 + strategy: + matrix: + # openmp: ['OFF', 'ON'] + include: + - { SSE2: 'OFF', AVX: 'OFF', XOP: 'OFF', F16C: 'OFF', FMA: 'OFF', AVX2: 'OFF', AVX512: 'OFF', AVX512VNNI: 'OFF', AVXVNNI: 'OFF', AVX512BF16: 'OFF', AVX512FP16: 'OFF'} + - { SSE2: 'ON', AVX: 'OFF', XOP: 'OFF', F16C: 'OFF', FMA: 'OFF', AVX2: 'OFF', AVX512: 'OFF', AVX512VNNI: 'OFF', AVXVNNI: 'OFF', AVX512BF16: 'OFF', AVX512FP16: 'OFF'} + - { SSE2: 'ON', AVX: 'ON', XOP: 'OFF', F16C: 'OFF', FMA: 'OFF', AVX2: 'OFF', AVX512: 'OFF', AVX512VNNI: 'OFF', AVXVNNI: 'OFF', AVX512BF16: 'OFF', AVX512FP16: 'OFF'} + - { SSE2: 'ON', AVX: 'ON', XOP: 'OFF', F16C: 'ON', FMA: 'ON', AVX2: 'ON', AVX512: 'OFF', AVX512VNNI: 'OFF', AVXVNNI: 'OFF', AVX512BF16: 'OFF', AVX512FP16: 'OFF'} + - { SSE2: 'ON', AVX: 'ON', XOP: 'OFF', F16C: 'ON', FMA: 'ON', AVX2: 'ON', AVX512: 'ON', AVX512VNNI: 'ON', AVXVNNI: 'OFF', AVX512BF16: 'OFF', AVX512FP16: 'OFF'} + + runs-on: + pool-name: docker + container: + image: bkci/ci:ubuntu + steps: + - name: checkout + checkout: self + with: + enableGitLfs: false + + - name: install-deps + run: | + apt-get update + apt-get install -y lcov + curl https://uploader.codecov.io/verification.gpg | gpg --no-default-keyring --keyring trustedkeys.gpg --import + curl -Os https://uploader.codecov.io/latest/linux/codecov + curl -Os https://uploader.codecov.io/latest/linux/codecov.SHA256SUM + curl -Os https://uploader.codecov.io/latest/linux/codecov.SHA256SUM.sig + gpgv codecov.SHA256SUM.sig codecov.SHA256SUM + shasum -a 256 -c codecov.SHA256SUM + chmod +x codecov + + - name: build + run: | + mkdir build && cd build + cmake -DCMAKE_BUILD_TYPE=debug -DNCNN_COVERAGE=ON -DNCNN_RUNTIME_CPU=OFF -DNCNN_OPENMP=OFF -DNCNN_BUILD_TOOLS=OFF -DNCNN_BUILD_EXAMPLES=OFF -DNCNN_BUILD_TESTS=ON \ + -DNCNN_SSE2=${{matrix.SSE2}} \ + -DNCNN_AVX=${{matrix.AVX}} \ + -DNCNN_XOP=${{matrix.XOP}} \ + -DNCNN_F16C=${{matrix.F16C}} \ + -DNCNN_FMA=${{matrix.FMA}} \ + -DNCNN_AVX2=${{matrix.AVX2}} \ + -DNCNN_AVX512=${{matrix.AVX512}} \ + -DNCNN_AVXVNNI=${{matrix.AVXVNNI}} \ + -DNCNN_AVX512VNNI=${{matrix.AVX512VNNI}} \ + -DNCNN_AVX512BF16=${{matrix.AVX512BF16}} \ + -DNCNN_AVX512FP16=${{matrix.AVX512FP16}} \ + .. + cmake --build . -j $(nproc) + - name: test + run: cd build && ctest --output-on-failure -j $(nproc) + - name: lcov-collect + run: | + cd build + lcov -d ./src -c -o lcov.info + lcov -r lcov.info '/usr/*' -o lcov.info + lcov -r lcov.info '*/build/*' -o lcov.info + lcov --list lcov.info + - name: codecov + run: ./codecov -t ${{settings.CODECOV_TOKEN.access_token}} -C ${{ ci.sha }} -B ${{ ci.head_ref }} -f build/lcov.info + + linux-gcc-arm: + name: linux-gcc-arm + runs-on: + pool-name: docker + container: + image: bkci/ci:ubuntu + steps: + - name: checkout + checkout: self + with: + enableGitLfs: false + + - name: install-deps + run: | + apt-get update + apt-get install -y lcov g++-arm-linux-gnueabi g++-arm-linux-gnueabihf libcapstone4 libglib2.0-0 + curl https://uploader.codecov.io/verification.gpg | gpg --no-default-keyring --keyring trustedkeys.gpg --import + curl -Os https://uploader.codecov.io/latest/linux/codecov + curl -Os https://uploader.codecov.io/latest/linux/codecov.SHA256SUM + curl -Os https://uploader.codecov.io/latest/linux/codecov.SHA256SUM.sig + gpgv codecov.SHA256SUM.sig codecov.SHA256SUM + shasum -a 256 -c codecov.SHA256SUM + chmod +x codecov + + - name: cache-qemu + id: cache-qemu + uses: cache@1.* + with: + cachePaths: qemu-install + cacheKey: qemu-arm-install-20220831 + + - name: checkout-qemu + if: steps.cache-qemu.outputs.cacheHit != 'true' + checkout: https://github.com/qemu/qemu.git + with: + pullType: COMMIT_ID + refName: 621da7789083b80d6f1ff1c0fb499334007b4f51 + localPath: qemu + enableSubmodule: false + enableGitLfs: false + + - name: qemu + if: steps.cache-qemu.outputs.cacheHit != 'true' + run: | + echo 'deb-src http://mirrors.cloud.tencent.com/debian bullseye main' | tee -a /etc/apt/sources.list + echo 'deb-src http://mirrors.cloud.tencent.com/debian bullseye-updates main' | tee -a /etc/apt/sources.list + apt-get update + apt-get build-dep -y qemu + cd qemu + ./configure --prefix=${{ci.workspace}}/qemu-install --target-list=arm-linux-user --disable-system + make -j$(nproc) + make install + + - name: build + run: | + mkdir build && cd build + cmake -DCMAKE_TOOLCHAIN_FILE=../toolchains/arm-linux-gnueabi.toolchain.cmake -DCMAKE_BUILD_TYPE=debug -DNCNN_COVERAGE=ON -DNCNN_RUNTIME_CPU=OFF -DNCNN_VFPV4=ON -DNCNN_ARM82=OFF -DNCNN_OPENMP=OFF -DNCNN_BUILD_TOOLS=OFF -DNCNN_BUILD_EXAMPLES=OFF -DNCNN_BUILD_TESTS=ON .. + cmake --build . -j $(nproc) + - name: test + run: | + export PATH=${{ci.workspace}}/qemu-install/bin:$PATH + cd build + TESTS_EXECUTABLE_LOADER=qemu-arm TESTS_EXECUTABLE_LOADER_ARGUMENTS="-L;/usr/arm-linux-gnueabi" ctest --output-on-failure -j $(nproc) + - name: lcov-collect + run: | + cd build + lcov -d ./src -c -o lcov.info + lcov -r lcov.info '/usr/*' -o lcov.info + lcov -r lcov.info '*/build/*' -o lcov.info + lcov --list lcov.info + + - name: build-armhf-vfpv3-d16 + run: | + mkdir build-armhf-vfpv3-d16 && cd build-armhf-vfpv3-d16 + cmake -DCMAKE_TOOLCHAIN_FILE=../toolchains/arm-linux-gnueabihf-vfpv3-d16.toolchain.cmake -DCMAKE_BUILD_TYPE=debug -DNCNN_COVERAGE=ON -DNCNN_RUNTIME_CPU=OFF -DNCNN_VFPV4=OFF -DNCNN_ARM82=OFF -DNCNN_OPENMP=OFF -DNCNN_BUILD_TOOLS=OFF -DNCNN_BUILD_EXAMPLES=OFF -DNCNN_BUILD_TESTS=ON .. + cmake --build . -j $(nproc) + - name: test-armhf-vfpv3-d16 + run: | + export PATH=${{ci.workspace}}/qemu-install/bin:$PATH + cd build-armhf-vfpv3-d16 + TESTS_EXECUTABLE_LOADER=qemu-arm TESTS_EXECUTABLE_LOADER_ARGUMENTS="-L;/usr/arm-linux-gnueabihf" ctest --output-on-failure -j $(nproc) + - name: lcov-collect-armhf-vfpv3-d16 + run: | + cd build-armhf-vfpv3-d16 + lcov -d ./src -c -o lcov.info + lcov -r lcov.info '/usr/*' -o lcov.info + lcov -r lcov.info '*/build-armhf-vfpv3-d16/*' -o lcov.info + lcov --list lcov.info + + - name: codecov + run: | + ./codecov -t ${{settings.CODECOV_TOKEN.access_token}} -C ${{ ci.sha }} -B ${{ ci.head_ref }} -f build/lcov.info + ./codecov -t ${{settings.CODECOV_TOKEN.access_token}} -C ${{ ci.sha }} -B ${{ ci.head_ref }} -f build-armhf-vfpv3-d16/lcov.info + + linux-gcc-aarch64: + name: linux-gcc-aarch64 + strategy: + matrix: + # openmp: ['OFF', 'ON'] + include: + - { ARM82: 'OFF', ARM82DOT: 'OFF', ARM82FP16FML: 'OFF', ARM84BF16: 'OFF', ARM84I8MM: 'OFF', ARM86SVE: 'OFF'} + - { ARM82: 'ON', ARM82DOT: 'OFF', ARM82FP16FML: 'OFF', ARM84BF16: 'OFF', ARM84I8MM: 'OFF', ARM86SVE: 'OFF'} + - { ARM82: 'ON', ARM82DOT: 'ON', ARM82FP16FML: 'ON', ARM84BF16: 'OFF', ARM84I8MM: 'OFF', ARM86SVE: 'OFF'} + - { ARM82: 'ON', ARM82DOT: 'ON', ARM82FP16FML: 'ON', ARM84BF16: 'ON', ARM84I8MM: 'ON', ARM86SVE: 'OFF'} + + runs-on: + pool-name: docker + container: + image: bkci/ci:ubuntu + steps: + - name: checkout + checkout: self + with: + enableGitLfs: false + + - name: install-deps + run: | + apt-get update + apt-get install -y lcov g++-aarch64-linux-gnu libcapstone4 libglib2.0-0 + curl https://uploader.codecov.io/verification.gpg | gpg --no-default-keyring --keyring trustedkeys.gpg --import + curl -Os https://uploader.codecov.io/latest/linux/codecov + curl -Os https://uploader.codecov.io/latest/linux/codecov.SHA256SUM + curl -Os https://uploader.codecov.io/latest/linux/codecov.SHA256SUM.sig + gpgv codecov.SHA256SUM.sig codecov.SHA256SUM + shasum -a 256 -c codecov.SHA256SUM + chmod +x codecov + + - name: cache-qemu + id: cache-qemu + uses: cache@1.* + with: + cachePaths: qemu-install + cacheKey: qemu-aarch64-install-20220831 + + - name: checkout-qemu + if: steps.cache-qemu.outputs.cacheHit != 'true' + checkout: https://github.com/qemu/qemu.git + with: + pullType: COMMIT_ID + refName: 621da7789083b80d6f1ff1c0fb499334007b4f51 + localPath: qemu + enableSubmodule: false + enableGitLfs: false + + - name: qemu + if: steps.cache-qemu.outputs.cacheHit != 'true' + run: | + echo 'deb-src http://mirrors.cloud.tencent.com/debian bullseye main' | tee -a /etc/apt/sources.list + echo 'deb-src http://mirrors.cloud.tencent.com/debian bullseye-updates main' | tee -a /etc/apt/sources.list + apt-get update + apt-get build-dep -y qemu + cd qemu + ./configure --prefix=${{ci.workspace}}/qemu-install --target-list=aarch64-linux-user --disable-system + make -j$(nproc) + make install + + - name: build + run: | + mkdir build && cd build + cmake -DCMAKE_TOOLCHAIN_FILE=../toolchains/aarch64-linux-gnu.toolchain.cmake \ + -DCMAKE_BUILD_TYPE=debug -DNCNN_COVERAGE=ON -DNCNN_RUNTIME_CPU=OFF -DNCNN_OPENMP=OFF -DNCNN_BUILD_TOOLS=OFF -DNCNN_BUILD_EXAMPLES=OFF -DNCNN_BUILD_TESTS=ON \ + -DNCNN_ARM82=${{matrix.ARM82}} \ + -DNCNN_ARM82DOT=${{matrix.ARM82DOT}} \ + -DNCNN_ARM82FP16FML=${{matrix.ARM82FP16FML}} \ + -DNCNN_ARM84BF16=${{matrix.ARM84BF16}} \ + -DNCNN_ARM84I8MM=${{matrix.ARM84I8MM}} \ + .. + cmake --build . -j $(nproc) + - name: test + run: | + export PATH=${{ci.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 $(nproc) + - name: lcov-collect + run: | + cd build + lcov -d ./src -c -o lcov.info + lcov -r lcov.info '/usr/*' -o lcov.info + lcov -r lcov.info '*/build/*' -o lcov.info + lcov --list lcov.info + - name: codecov + run: ./codecov -t ${{settings.CODECOV_TOKEN.access_token}} -C ${{ ci.sha }} -B ${{ ci.head_ref }} -f build/lcov.info + + linux-gcc-mipsisa32r6el: + name: linux-gcc-mipsisa32r6el + strategy: + matrix: + OPENMP: ['OFF', 'ON'] + + runs-on: + pool-name: docker + container: + image: bkci/ci:ubuntu + steps: + - name: checkout + checkout: self + with: + enableGitLfs: false + + - name: install-deps + run: | + apt-get update + apt-get install -y lcov g++-mipsisa32r6el-linux-gnu libcapstone4 libglib2.0-0 + curl https://uploader.codecov.io/verification.gpg | gpg --no-default-keyring --keyring trustedkeys.gpg --import + curl -Os https://uploader.codecov.io/latest/linux/codecov + curl -Os https://uploader.codecov.io/latest/linux/codecov.SHA256SUM + curl -Os https://uploader.codecov.io/latest/linux/codecov.SHA256SUM.sig + gpgv codecov.SHA256SUM.sig codecov.SHA256SUM + shasum -a 256 -c codecov.SHA256SUM + chmod +x codecov + + - name: cache-qemu + id: cache-qemu + uses: cache@1.* + with: + cachePaths: qemu-install + cacheKey: qemu-mipsel-install-20220831 + + - name: checkout-qemu + if: steps.cache-qemu.outputs.cacheHit != 'true' + checkout: https://github.com/qemu/qemu.git + with: + pullType: COMMIT_ID + refName: 621da7789083b80d6f1ff1c0fb499334007b4f51 + localPath: qemu + enableSubmodule: false + enableGitLfs: false + + - name: qemu + if: steps.cache-qemu.outputs.cacheHit != 'true' + run: | + echo 'deb-src http://mirrors.cloud.tencent.com/debian bullseye main' | tee -a /etc/apt/sources.list + echo 'deb-src http://mirrors.cloud.tencent.com/debian bullseye-updates main' | tee -a /etc/apt/sources.list + apt-get update + apt-get build-dep -y qemu + cd qemu + ./configure --prefix=${{ci.workspace}}/qemu-install --target-list=mipsel-linux-user --disable-system + make -j$(nproc) + make install + + - name: build + run: | + mkdir build && cd build + cmake -DCMAKE_TOOLCHAIN_FILE=../toolchains/mipsisa32r6el-linux-gnu.toolchain.cmake -DCMAKE_BUILD_TYPE=debug -DNCNN_COVERAGE=ON -DNCNN_RUNTIME_CPU=OFF -DNCNN_MSA=OFF -DNCNN_MMI=OFF -DNCNN_OPENMP=${{matrix.OPENMP}} -DNCNN_BUILD_TOOLS=OFF -DNCNN_BUILD_EXAMPLES=OFF -DNCNN_BUILD_TESTS=ON .. + cmake --build . -j $(nproc) + - name: test + run: | + export PATH=${{ci.workspace}}/qemu-install/bin:$PATH + cd build + TESTS_EXECUTABLE_LOADER=qemu-mipsel TESTS_EXECUTABLE_LOADER_ARGUMENTS="-L;/usr/mipsisa32r6el-linux-gnu" ctest --output-on-failure -j $(nproc) + - name: lcov-collect + run: | + cd build + lcov -d ./src -c -o lcov.info + lcov -r lcov.info '/usr/*' -o lcov.info + lcov -r lcov.info '*/build/*' -o lcov.info + lcov --list lcov.info + - name: codecov + run: ./codecov -t ${{settings.CODECOV_TOKEN.access_token}} -C ${{ ci.sha }} -B ${{ ci.head_ref }} -f build/lcov.info + + linux-gcc-mipsisa64r6el: + name: linux-gcc-mipsisa64r6el + strategy: + matrix: + OPENMP: ['OFF', 'ON'] + + runs-on: + pool-name: docker + container: + image: bkci/ci:ubuntu + steps: + - name: checkout + checkout: self + with: + enableGitLfs: false + + - name: install-deps + run: | + apt-get update + apt-get install -y lcov g++-mipsisa64r6el-linux-gnuabi64 libcapstone4 libglib2.0-0 + curl https://uploader.codecov.io/verification.gpg | gpg --no-default-keyring --keyring trustedkeys.gpg --import + curl -Os https://uploader.codecov.io/latest/linux/codecov + curl -Os https://uploader.codecov.io/latest/linux/codecov.SHA256SUM + curl -Os https://uploader.codecov.io/latest/linux/codecov.SHA256SUM.sig + gpgv codecov.SHA256SUM.sig codecov.SHA256SUM + shasum -a 256 -c codecov.SHA256SUM + chmod +x codecov + + - name: cache-qemu + id: cache-qemu + uses: cache@1.* + with: + cachePaths: qemu-install + cacheKey: qemu-mips64el-install-20220831 + + - name: checkout-qemu + if: steps.cache-qemu.outputs.cacheHit != 'true' + checkout: https://github.com/qemu/qemu.git + with: + pullType: COMMIT_ID + refName: 621da7789083b80d6f1ff1c0fb499334007b4f51 + localPath: qemu + enableSubmodule: false + enableGitLfs: false + + - name: qemu + if: steps.cache-qemu.outputs.cacheHit != 'true' + run: | + echo 'deb-src http://mirrors.cloud.tencent.com/debian bullseye main' | tee -a /etc/apt/sources.list + echo 'deb-src http://mirrors.cloud.tencent.com/debian bullseye-updates main' | tee -a /etc/apt/sources.list + apt-get update + apt-get build-dep -y qemu + cd qemu + ./configure --prefix=${{ci.workspace}}/qemu-install --target-list=mips64el-linux-user --disable-system + make -j$(nproc) + make install + + - name: build + run: | + mkdir build && cd build + cmake -DCMAKE_TOOLCHAIN_FILE=../toolchains/mipsisa64r6el-linux-gnuabi64.toolchain.cmake -DCMAKE_BUILD_TYPE=debug -DNCNN_COVERAGE=ON -DNCNN_RUNTIME_CPU=OFF -DNCNN_MSA=ON -DNCNN_MMI=OFF -DNCNN_OPENMP=${{matrix.OPENMP}} -DNCNN_BUILD_TOOLS=OFF -DNCNN_BUILD_EXAMPLES=OFF -DNCNN_BUILD_TESTS=ON .. + cmake --build . -j $(nproc) + - name: test + run: | + export PATH=${{ci.workspace}}/qemu-install/bin:$PATH + cd build + TESTS_EXECUTABLE_LOADER=qemu-mips64el TESTS_EXECUTABLE_LOADER_ARGUMENTS="-L;/usr/mipsisa64r6el-linux-gnuabi64" ctest --output-on-failure -j $(nproc) + - name: lcov-collect + run: | + cd build + lcov -d ./src -c -o lcov.info + lcov -r lcov.info '/usr/*' -o lcov.info + lcov -r lcov.info '*/build/*' -o lcov.info + lcov --list lcov.info + - name: codecov + run: ./codecov -t ${{settings.CODECOV_TOKEN.access_token}} -C ${{ ci.sha }} -B ${{ ci.head_ref }} -f build/lcov.info + + linux-gcc-riscv64: + name: linux-gcc-riscv64 + strategy: + matrix: + OPENMP: ['OFF', 'ON'] + + runs-on: + pool-name: docker + container: + image: bkci/ci:ubuntu + steps: + - name: checkout + checkout: self + with: + enableGitLfs: false + + - name: install-deps + run: | + apt-get update + apt-get install -y lcov g++-riscv64-linux-gnu libcapstone4 libglib2.0-0 + curl https://uploader.codecov.io/verification.gpg | gpg --no-default-keyring --keyring trustedkeys.gpg --import + curl -Os https://uploader.codecov.io/latest/linux/codecov + curl -Os https://uploader.codecov.io/latest/linux/codecov.SHA256SUM + curl -Os https://uploader.codecov.io/latest/linux/codecov.SHA256SUM.sig + gpgv codecov.SHA256SUM.sig codecov.SHA256SUM + shasum -a 256 -c codecov.SHA256SUM + chmod +x codecov + + - name: cache-qemu + id: cache-qemu + uses: cache@1.* + with: + cachePaths: qemu-install + cacheKey: qemu-riscv64-install-20220831 + + - name: checkout-qemu + if: steps.cache-qemu.outputs.cacheHit != 'true' + checkout: https://github.com/qemu/qemu.git + with: + pullType: COMMIT_ID + refName: 621da7789083b80d6f1ff1c0fb499334007b4f51 + localPath: qemu + enableSubmodule: false + enableGitLfs: false + + - name: qemu + if: steps.cache-qemu.outputs.cacheHit != 'true' + run: | + echo 'deb-src http://mirrors.cloud.tencent.com/debian bullseye main' | tee -a /etc/apt/sources.list + echo 'deb-src http://mirrors.cloud.tencent.com/debian bullseye-updates main' | tee -a /etc/apt/sources.list + apt-get update + apt-get build-dep -y qemu + cd qemu + wget https://raw.githubusercontent.com/nihui/ncnn-assets/master/qemu-patches/0007-linux-user-Expose-risc-v-V-isa-bit-in-get_elf_hwcap.patch + patch -p1 -i 0007-linux-user-Expose-risc-v-V-isa-bit-in-get_elf_hwcap.patch + ./configure --prefix=${{ci.workspace}}/qemu-install --target-list=riscv64-linux-user --disable-system + make -j$(nproc) + make install + + - name: build + run: | + mkdir build && cd build + cmake -DCMAKE_TOOLCHAIN_FILE=../toolchains/riscv64-linux-gnu.toolchain.cmake -DCMAKE_BUILD_TYPE=debug -DNCNN_COVERAGE=ON -DNCNN_RUNTIME_CPU=OFF -DNCNN_OPENMP=${{matrix.OPENMP}} -DNCNN_BUILD_TOOLS=OFF -DNCNN_BUILD_EXAMPLES=OFF -DNCNN_BUILD_TESTS=ON .. + cmake --build . -j $(nproc) + - name: test + run: | + export PATH=${{ci.workspace}}/qemu-install/bin:$PATH + cd build + TESTS_EXECUTABLE_LOADER=qemu-riscv64 TESTS_EXECUTABLE_LOADER_ARGUMENTS="-L;/usr/riscv64-linux-gnu" ctest --output-on-failure -j $(nproc) + - name: lcov-collect + run: | + cd build + lcov -d ./src -c -o lcov.info + lcov -r lcov.info '/usr/*' -o lcov.info + lcov -r lcov.info '*/build/*' -o lcov.info + lcov --list lcov.info + - name: codecov + run: ./codecov -t ${{settings.CODECOV_TOKEN.access_token}} -C ${{ ci.sha }} -B ${{ ci.head_ref }} -f build/lcov.info + + linux-gcc-riscv64-rvv: + name: linux-gcc-riscv64-rvv + strategy: + matrix: + OPENMP: ['OFF', 'ON'] + + runs-on: + pool-name: docker + container: + image: bkci/ci:ubuntu + steps: + - name: checkout + checkout: self + with: + enableGitLfs: false + + - name: install-deps + run: | + apt-get update + apt-get install -y lcov libcapstone4 libglib2.0-0 + curl https://uploader.codecov.io/verification.gpg | gpg --no-default-keyring --keyring trustedkeys.gpg --import + curl -Os https://uploader.codecov.io/latest/linux/codecov + curl -Os https://uploader.codecov.io/latest/linux/codecov.SHA256SUM + curl -Os https://uploader.codecov.io/latest/linux/codecov.SHA256SUM.sig + gpgv codecov.SHA256SUM.sig codecov.SHA256SUM + shasum -a 256 -c codecov.SHA256SUM + chmod +x codecov + + - name: cache-qemu + id: cache-qemu + uses: cache@1.* + with: + cachePaths: qemu-install + cacheKey: qemu-riscv64-install-20220831 + + - name: checkout-qemu + if: steps.cache-qemu.outputs.cacheHit != 'true' + checkout: https://github.com/qemu/qemu.git + with: + pullType: COMMIT_ID + refName: 621da7789083b80d6f1ff1c0fb499334007b4f51 + localPath: qemu + enableSubmodule: false + enableGitLfs: false + + - name: qemu + if: steps.cache-qemu.outputs.cacheHit != 'true' + run: | + echo 'deb-src http://mirrors.cloud.tencent.com/debian bullseye main' | tee -a /etc/apt/sources.list + echo 'deb-src http://mirrors.cloud.tencent.com/debian bullseye-updates main' | tee -a /etc/apt/sources.list + apt-get update + apt-get build-dep -y qemu + cd qemu + wget https://raw.githubusercontent.com/nihui/ncnn-assets/master/qemu-patches/0007-linux-user-Expose-risc-v-V-isa-bit-in-get_elf_hwcap.patch + patch -p1 -i 0007-linux-user-Expose-risc-v-V-isa-bit-in-get_elf_hwcap.patch + ./configure --prefix=${{ci.workspace}}/qemu-install --target-list=riscv64-linux-user --disable-system + make -j$(nproc) + make install + + - name: cache-rv64gcv + id: cache-rv64gcv + uses: cache@1.* + with: + cachePaths: rv64gcv-install + cacheKey: rv64gcv-linux-install-20221029 + + - name: checkout-riscv-gnu-toolchain + if: steps.cache-rv64gcv.outputs.cacheHit != 'true' + checkout: https://github.com/riscv/riscv-gnu-toolchain.git + with: + pullType: COMMIT_ID + refName: da01ba455ce3802ffa84fdca3a089079996dbfc3 + localPath: riscv-gnu-toolchain + enableSubmodule: false + enableGitLfs: false + + - name: riscv-gnu-toolchain + if: steps.cache-rv64gcv.outputs.cacheHit != 'true' + run: | + apt-get update + apt-get install -y autoconf automake autotools-dev curl python3 libmpc-dev libmpfr-dev libgmp-dev gawk build-essential bison flex texinfo gperf libtool patchutils bc zlib1g-dev libexpat-dev device-tree-compiler + cd riscv-gnu-toolchain + git submodule update --init --recursive --depth 1 glibc + git submodule update --init --recursive --depth 1 newlib + #git submodule update --init --recursive --depth 1 riscv-binutils + #git submodule update --init --recursive --depth 1 riscv-gcc + git submodule update --init --recursive --depth 1 riscv-dejagnu + git submodule update --init --recursive --depth 1 riscv-gdb + rm -rf riscv-binutils + git clone -b binutils-2_39-branch https://sourceware.org/git/binutils-gdb.git riscv-binutils + rm -rf riscv-gcc + git clone -b riscv-gcc-rvv-next https://github.com/riscv-collab/riscv-gcc.git riscv-gcc + cd riscv-gcc + git checkout 8a0c1b106f01c455a8fb478cfe52d859a69020fd + cd .. + sed -i '/__OBSOLETE_MATH/d' newlib/newlib/libm/common/math_errf.c + ./configure --prefix=${{ci.workspace}}/rv64gcv-install --with-arch=rv64gcv_zfh + make linux -j$(nproc) + find ${{ci.workspace}}/rv64gcv-install -type f | xargs -i strip -g {} || true + + - name: build + run: | + export RISCV_ROOT_PATH=${{ci.workspace}}/rv64gcv-install + mkdir build && cd build + cmake -DCMAKE_TOOLCHAIN_FILE=../toolchains/riscv64-unknown-linux-gnu.toolchain.cmake -DCMAKE_BUILD_TYPE=debug -DCMAKE_C_FLAGS="-O1" -DCMAKE_CXX_FLAGS="-O1" -DNCNN_COVERAGE=ON -DNCNN_RUNTIME_CPU=OFF -DNCNN_RVV=ON -DNCNN_OPENMP=${{matrix.OPENMP}} -DNCNN_BUILD_TOOLS=OFF -DNCNN_BUILD_EXAMPLES=OFF -DNCNN_BUILD_TESTS=ON .. + cmake --build . -j $(nproc) + - name: test-vlen128 + run: | + export PATH=${{ci.workspace}}/qemu-install/bin:$PATH + cd build + TESTS_EXECUTABLE_LOADER=qemu-riscv64 TESTS_EXECUTABLE_LOADER_ARGUMENTS="-cpu;rv64,v=true,Zfh=true,vlen=128,elen=64,vext_spec=v1.0;-L;${{ci.workspace}}/rv64gcv-install/sysroot" ctest --output-on-failure -j $(nproc) + - name: lcov-collect-vlen128 + run: | + cd build + lcov --gcov-tool ${{ci.workspace}}/rv64gcv-install/bin/riscv64-unknown-linux-gnu-gcov -d ./src -c -o lcov.info + lcov -r lcov.info '/usr/*' -o lcov.info + lcov -r lcov.info '*/build/*' -o lcov.info + lcov -r lcov.info '*/rv64gcv-install/*' -o lcov.info + lcov --list lcov.info + - name: codecov-vlen128 + run: ./codecov -t ${{settings.CODECOV_TOKEN.access_token}} -C ${{ ci.sha }} -B ${{ ci.head_ref }} -f build/lcov.info + - name: test-vlen256 + run: | + export PATH=${{ci.workspace}}/qemu-install/bin:$PATH + cd build + TESTS_EXECUTABLE_LOADER=qemu-riscv64 TESTS_EXECUTABLE_LOADER_ARGUMENTS="-cpu;rv64,v=true,Zfh=true,vlen=256,elen=64,vext_spec=v1.0;-L;${{ci.workspace}}/rv64gcv-install/sysroot" ctest --output-on-failure -j $(nproc) + - name: lcov-collect-vlen256 + run: | + cd build + lcov --gcov-tool ${{ci.workspace}}/rv64gcv-install/bin/riscv64-unknown-linux-gnu-gcov -d ./src -c -o lcov.info + lcov -r lcov.info '/usr/*' -o lcov.info + lcov -r lcov.info '*/build/*' -o lcov.info + lcov -r lcov.info '*/rv64gcv-install/*' -o lcov.info + lcov --list lcov.info + - name: codecov-vlen256 + run: ./codecov -t ${{settings.CODECOV_TOKEN.access_token}} -C ${{ ci.sha }} -B ${{ ci.head_ref }} -f build/lcov.info diff --git a/.github/workflows/pnnx.yml b/.github/workflows/pnnx.yml deleted file mode 100644 index 040f3e3d738..00000000000 --- a/.github/workflows/pnnx.yml +++ /dev/null @@ -1,105 +0,0 @@ -name: pnnx -on: - push: - branches: [master] - paths: - - '.github/workflows/pnnx.yml' - - 'tools/pnnx/**' - - '!tools/pnnx/README.md' - pull_request: - branches: [master] - paths: - - '.github/workflows/pnnx.yml' - - 'tools/pnnx/**' - - '!tools/pnnx/README.md' -concurrency: - group: pnnx-${{ github.ref }} - cancel-in-progress: true -permissions: - contents: read - -jobs: - ubuntu: - runs-on: [self-hosted, linux, centos] - - strategy: - fail-fast: false - matrix: - include: - - torch-version: 1.8.1 - torchvision-version: 0.9.1 - - - torch-version: 1.9.1 - torchvision-version: 0.10.1 - - - torch-version: 1.10.0 - torchvision-version: 0.11.1 - - - torch-version: 1.11.0 - torchvision-version: 0.12.0 - - - torch-version: 1.12.0 - torchvision-version: 0.13.0 - - - torch-version: 1.13.0 - torchvision-version: 0.14.0 - - steps: - - uses: actions/checkout@v3 - with: - submodules: true - - - name: setup pytorch-${{ matrix.torch-version }} - run: | - export PYTHONUSERBASE=$GITHUB_WORKSPACE/torch-${{ matrix.torch-version }} - pip install --user torch==${{ matrix.torch-version }}+cpu torchvision==${{ matrix.torchvision-version }}+cpu -f https://download.pytorch.org/whl/torch_stable.html - - - name: cache-torchvision-${{ matrix.torchvision-version }} - id: cache-torchvision - uses: actions/cache@v3 - with: - path: torchvision-${{ matrix.torchvision-version }}-install - key: torchvision-${{ matrix.torchvision-version }}-linux-install-20211228 - - name: checkout-torchvision-${{ matrix.torchvision-version }} - if: steps.cache-torchvision.outputs.cache-hit != 'true' - uses: actions/checkout@v3 - with: - repository: pytorch/vision - path: vision - ref: v${{ matrix.torchvision-version }} - - name: torchvision-${{ matrix.torchvision-version }} - if: steps.cache-torchvision.outputs.cache-hit != 'true' - run: | - cd vision - mkdir -p build; cd build - cmake -DCMAKE_INSTALL_PREFIX=$GITHUB_WORKSPACE/torchvision-${{ matrix.torchvision-version }}-install -DTorch_DIR=$GITHUB_WORKSPACE/torch-${{ matrix.torch-version }}/lib/python3.8/site-packages/torch/share/cmake/Torch -DCMAKE_BUILD_TYPE=Release .. - cmake --build . -j 4 - cmake --build . --target install - - - name: build-ncnn - run: | - export PYTHONUSERBASE=$GITHUB_WORKSPACE/torch-${{ matrix.torch-version }} - pip install --user pytest setuptools wheel twine - mkdir build && cd build - cmake -DCMAKE_BUILD_TYPE=Release -DNCNN_PYTHON=ON -DNCNN_BUILD_TOOLS=OFF -DNCNN_BUILD_EXAMPLES=OFF .. - cmake --build . -j 4 - cd .. - pip install --user . - - - name: build-pnnx - run: | - export PYTHONUSERBASE=$GITHUB_WORKSPACE/torch-${{ matrix.torch-version }} - cd tools/pnnx - mkdir build && cd build - cmake -DCMAKE_BUILD_TYPE=Release -DTorchVision_INSTALL_DIR=$GITHUB_WORKSPACE/torchvision-${{ matrix.torchvision-version }}-install .. - cmake --build . -j 4 - - - name: test - run: | - export PYTHONUSERBASE=$GITHUB_WORKSPACE/torch-${{ matrix.torch-version }} - export OMP_NUM_THREADS=1 - export MKL_NUM_THREADS=1 - export MKL_ENABLE_INSTRUCTIONS=SSE4_2 - pip install --upgrade requests - cd tools/pnnx - cd build && ctest --output-on-failure -j 4 diff --git a/.github/workflows/test-coverage.yml b/.github/workflows/test-coverage.yml index bc6b0097b70..87401acd00f 100644 --- a/.github/workflows/test-coverage.yml +++ b/.github/workflows/test-coverage.yml @@ -25,112 +25,6 @@ permissions: contents: read jobs: - linux-gcc-gpu: - runs-on: [self-hosted, linux, cvm] - steps: - - uses: actions/checkout@v3 - with: - submodules: true - - name: cache-swiftshader - id: cache-swiftshader - uses: actions/cache@v3 - with: - path: swiftshader-install - key: swiftshader-linux-install-20220211 - - name: checkout-swiftshader - if: steps.cache-swiftshader.outputs.cache-hit != 'true' - uses: actions/checkout@v3 - with: - repository: google/swiftshader - path: swiftshader - ref: 0863290dc7f6cc1649bab1858790e812b8aef02a - - name: checkout-swiftshader-submodules - if: steps.cache-swiftshader.outputs.cache-hit != 'true' - run: | - cd swiftshader - git -c submodule."third_party/git-hooks".update=none submodule update --init --recursive - - name: swiftshader - if: steps.cache-swiftshader.outputs.cache-hit != 'true' - run: | - cd swiftshader - mkdir -p build; cd build - cmake -DCMAKE_INSTALL_PREFIX=install -DSWIFTSHADER_BUILD_EGL=FALSE -DSWIFTSHADER_BUILD_GLESv2=FALSE -DSWIFTSHADER_BUILD_GLES_CM=FALSE -DSWIFTSHADER_BUILD_VULKAN=TRUE -DSWIFTSHADER_BUILD_PVR=FALSE -DSWIFTSHADER_BUILD_TESTS=FALSE -DSWIFTSHADER_ENABLE_ASTC=FALSE -DSWIFTSHADER_WARNINGS_AS_ERRORS=FALSE -DREACTOR_BACKEND=Subzero -DREACTOR_DEFAULT_OPT_LEVEL=Default -DCMAKE_BUILD_TYPE=Release .. - cmake --build . -j 4 - mkdir $GITHUB_WORKSPACE/swiftshader-install - cp Linux/* $GITHUB_WORKSPACE/swiftshader-install - - name: configure - run: mkdir build && cd build && cmake -DCMAKE_BUILD_TYPE=debug -DNCNN_COVERAGE=ON -DNCNN_RUNTIME_CPU=OFF -DNCNN_AVX2=ON -DNCNN_AVX512=OFF -DNCNN_XOP=OFF -DNCNN_OPENMP=OFF -DNCNN_VULKAN=ON -DNCNN_BUILD_TOOLS=OFF -DNCNN_BUILD_EXAMPLES=OFF -DNCNN_BUILD_TESTS=ON .. - - name: build - run: cmake --build build -j 4 - - name: test - run: | - printf "[Processor]\nThreadCount=1\n" > build/tests/SwiftShader.ini - export VK_ICD_FILENAMES="$GITHUB_WORKSPACE/swiftshader-install/vk_swiftshader_icd.json" - cd build && ctest --output-on-failure -j 4 - - name: lcov-collect - run: | - cd build - lcov -d ./src -c -o lcov.info - lcov -r lcov.info '/usr/*' -o lcov.info - lcov -r lcov.info '*/build/*' -o lcov.info - lcov -r lcov.info '*/glslang/*' -o lcov.info - lcov --list lcov.info - - name: codecov - id: codecov - continue-on-error: true - uses: codecov/codecov-action@v3 - with: - token: ${{ secrets.CODECOV_TOKEN }} - file: build/lcov.info - - name: codecov-vlen256-retry-1 - continue-on-error: true - id: codecov-vlen256-retry-1 - if: steps.codecov.outcome=='failure' - uses: codecov/codecov-action@v3 - with: - token: ${{ secrets.CODECOV_TOKEN }} - file: build/lcov.info - - name: codecov-vlen256-retry-2 - continue-on-error: true - id: codecov-vlen256-retry-2 - if: steps.codecov-vlen256-retry-1.outcome=='failure' - uses: codecov/codecov-action@v3 - with: - token: ${{ secrets.CODECOV_TOKEN }} - file: build/lcov.info - - name: codecov-vlen256-retry-3 - continue-on-error: true - id: codecov-vlen256-retry-3 - if: steps.codecov-vlen256-retry-2.outcome=='failure' - uses: codecov/codecov-action@v3 - with: - token: ${{ secrets.CODECOV_TOKEN }} - file: build/lcov.info - - name: codecov-vlen256-retry-4 - continue-on-error: true - id: codecov-vlen256-retry-4 - if: steps.codecov-vlen256-retry-3.outcome=='failure' - uses: codecov/codecov-action@v3 - with: - token: ${{ secrets.CODECOV_TOKEN }} - file: build/lcov.info - - name: codecov-vlen256-retry-5 - continue-on-error: true - id: codecov-vlen256-retry-5 - if: steps.codecov-vlen256-retry-4.outcome=='failure' - uses: codecov/codecov-action@v3 - with: - token: ${{ secrets.CODECOV_TOKEN }} - file: build/lcov.info - - name: set the status - if: always() - run: | - if ${{ steps.codecov.outcome=='success' || steps.codecov-vlen256-retry-1.outcome=='success' || steps.codecov-vlen256-retry-2.outcome=='success' || steps.codecov-vlen256-retry-3.outcome=='success' || steps.codecov-vlen256-retry-4.outcome=='success' || steps.codecov-vlen256-retry-5.outcome=='success' }}; then - echo fine - else - exit 1 - fi - linux-gcc-gpu-t4: runs-on: [self-hosted, linux, t4] steps: @@ -215,1144 +109,39 @@ jobs: exit 1 fi - linux-gcc-gpu-lavapipe: - runs-on: [self-hosted, linux, cvm] - steps: - - uses: actions/checkout@v3 - with: - submodules: true - - - name: cache-lavapipe - id: cache-lavapipe - uses: actions/cache@v3 - with: - path: lavapipe-install - key: lavapipe-linux-install-20211127-3 - - name: checkout-lavapipe - if: steps.cache-lavapipe.outputs.cache-hit != 'true' - uses: actions/checkout@v3 - with: - repository: mesa3d/mesa - path: mesa - ref: cd39180cfab20734744b379b085cc3b5c2cecd3a - - name: lavapipe - if: steps.cache-lavapipe.outputs.cache-hit != 'true' - run: | - mkdir -p "$GITHUB_WORKSPACE/lavapipe-install" - cd mesa - mkdir build - cd build - meson -Dprefix="$GITHUB_WORKSPACE/lavapipe-install" -Dbuildtype=release -Db_lto=true -Db_ndebug=true -Dplatforms="x11" -Ddri3=enabled -Ddri-drivers="" -Dgallium-drivers=swrast -Dgallium-vdpau=disabled -Dgallium-xvmc=disabled -Dgallium-omx=disabled -Dgallium-va=disabled -Dgallium-xa=disabled -Dgallium-opencl=disabled -Dopencl-native=false -Dvulkan-drivers=swrast -Dshader-cache=disabled -Dgles1=disabled -Dgles2=disabled -Dopengl=false -Dgbm=disabled -Dglx=disabled -Degl=disabled -Dllvm=enabled -Dvalgrind=disabled -Dlibunwind=disabled -Dlmsensors=disabled .. - ninja -j4 - ninja install - sed -ie "s@$GITHUB_WORKSPACE/lavapipe-install/lib/x86_64-linux-gnu/libvulkan_lvp.so@../../../lib/x86_64-linux-gnu/libvulkan_lvp.so@g" $GITHUB_WORKSPACE/lavapipe-install/share/vulkan/icd.d/lvp_icd.x86_64.json - - - name: configure - run: mkdir build && cd build && cmake -DCMAKE_BUILD_TYPE=debug -DNCNN_COVERAGE=ON -DNCNN_RUNTIME_CPU=OFF -DNCNN_AVX2=ON -DNCNN_AVX512=OFF -DNCNN_XOP=OFF -DNCNN_OPENMP=OFF -DNCNN_VULKAN=ON -DNCNN_BUILD_TOOLS=OFF -DNCNN_BUILD_EXAMPLES=OFF -DNCNN_BUILD_TESTS=ON .. - - name: build - run: cmake --build build -j 4 - - name: test - run: | - export VK_ICD_FILENAMES="$GITHUB_WORKSPACE/lavapipe-install/share/vulkan/icd.d/lvp_icd.x86_64.json" - cd build && ctest --output-on-failure -j 4 - - name: lcov-collect - run: | - cd build - lcov -d ./src -c -o lcov.info - lcov -r lcov.info '/usr/*' -o lcov.info - lcov -r lcov.info '*/build/*' -o lcov.info - lcov -r lcov.info '*/glslang/*' -o lcov.info - lcov --list lcov.info - - name: codecov - id: codecov - continue-on-error: true - uses: codecov/codecov-action@v3 - with: - token: ${{ secrets.CODECOV_TOKEN }} - file: build/lcov.info - - name: codecov-vlen256-retry-1 - continue-on-error: true - id: codecov-vlen256-retry-1 - if: steps.codecov.outcome=='failure' - uses: codecov/codecov-action@v3 - with: - token: ${{ secrets.CODECOV_TOKEN }} - file: build/lcov.info - - name: codecov-vlen256-retry-2 - continue-on-error: true - id: codecov-vlen256-retry-2 - if: steps.codecov-vlen256-retry-1.outcome=='failure' - uses: codecov/codecov-action@v3 - with: - token: ${{ secrets.CODECOV_TOKEN }} - file: build/lcov.info - - name: codecov-vlen256-retry-3 - continue-on-error: true - id: codecov-vlen256-retry-3 - if: steps.codecov-vlen256-retry-2.outcome=='failure' - uses: codecov/codecov-action@v3 - with: - token: ${{ secrets.CODECOV_TOKEN }} - file: build/lcov.info - - name: codecov-vlen256-retry-4 - continue-on-error: true - id: codecov-vlen256-retry-4 - if: steps.codecov-vlen256-retry-3.outcome=='failure' - uses: codecov/codecov-action@v3 - with: - token: ${{ secrets.CODECOV_TOKEN }} - file: build/lcov.info - - name: codecov-vlen256-retry-5 - continue-on-error: true - id: codecov-vlen256-retry-5 - if: steps.codecov-vlen256-retry-4.outcome=='failure' - uses: codecov/codecov-action@v3 - with: - token: ${{ secrets.CODECOV_TOKEN }} - file: build/lcov.info - - name: set the status - if: always() - run: | - if ${{ steps.codecov.outcome=='success' || steps.codecov-vlen256-retry-1.outcome=='success' || steps.codecov-vlen256-retry-2.outcome=='success' || steps.codecov-vlen256-retry-3.outcome=='success' || steps.codecov-vlen256-retry-4.outcome=='success' || steps.codecov-vlen256-retry-5.outcome=='success' }}; then - echo fine - else - exit 1 - fi - - linux-gcc-x64: - runs-on: ubuntu-latest + linux-gcc-x64-avx512-spr: + runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v3 + - name: update + run: sudo apt-get update + - name: gcc12 + run: sudo apt-get install gcc-12 g++-12 - name: lcov run: sudo apt-get install lcov - - name: build-sse2 - run: | - mkdir build-sse2 && cd build-sse2 - cmake -DCMAKE_BUILD_TYPE=debug -DNCNN_COVERAGE=ON -DNCNN_RUNTIME_CPU=OFF -DNCNN_AVX=OFF -DNCNN_AVX2=OFF -DNCNN_AVX512=OFF -DNCNN_XOP=OFF -DNCNN_OPENMP=OFF -DNCNN_BUILD_TOOLS=OFF -DNCNN_BUILD_EXAMPLES=OFF -DNCNN_BUILD_TESTS=ON .. - cmake --build . -j 2 - - name: test-sse2 - run: cd build-sse2 && ctest --output-on-failure -j 2 - - name: lcov-collect - run: | - cd build-sse2 - lcov -d ./src -c -o lcov.info - lcov -r lcov.info '/usr/*' -o lcov.info - lcov -r lcov.info '*/build-sse2/*' -o lcov.info - lcov --list lcov.info - - name: codecov-sse2 - uses: codecov/codecov-action@v3 - with: - token: ${{ secrets.CODECOV_TOKEN }} - file: build-sse2/lcov.info - - - name: build-avx - run: | - mkdir build-avx && cd build-avx - cmake -DCMAKE_BUILD_TYPE=debug -DNCNN_COVERAGE=ON -DNCNN_RUNTIME_CPU=OFF -DNCNN_AVX2=OFF -DNCNN_AVX=ON -DNCNN_AVX512=OFF -DNCNN_XOP=OFF -DNCNN_OPENMP=ON -DNCNN_BUILD_TOOLS=OFF -DNCNN_BUILD_EXAMPLES=OFF -DNCNN_BUILD_TESTS=ON .. - cmake --build . -j 2 - - name: test-avx - run: cd build-avx && ctest --output-on-failure -j 2 - - name: lcov-collect - run: | - cd build-avx - lcov -d ./src -c -o lcov.info - lcov -r lcov.info '/usr/*' -o lcov.info - lcov -r lcov.info '*/build-avx/*' -o lcov.info - lcov --list lcov.info - - name: codecov-avx - uses: codecov/codecov-action@v3 - with: - token: ${{ secrets.CODECOV_TOKEN }} - file: build-avx/lcov.info - - - name: build-avx2 + - name: Setup SDE binaries + uses: petarpetrovt/setup-sde@v2 + - name: build-avx512-spr + env: + CC: gcc-12 + CXX: g++-12 run: | - mkdir build-avx2 && cd build-avx2 - cmake -DCMAKE_BUILD_TYPE=debug -DNCNN_COVERAGE=ON -DNCNN_RUNTIME_CPU=OFF -DNCNN_AVX2=ON -DNCNN_AVX512=OFF -DNCNN_XOP=OFF -DNCNN_OPENMP=ON -DNCNN_BUILD_TOOLS=OFF -DNCNN_BUILD_EXAMPLES=OFF -DNCNN_BUILD_TESTS=ON .. + mkdir build-avx512-spr && cd build-avx512-spr + cmake -DCMAKE_BUILD_TYPE=debug -DNCNN_COVERAGE=ON -DNCNN_RUNTIME_CPU=OFF -DNCNN_AVX2=ON -DNCNN_AVX512=ON -DNCNN_AVX512VNNI=ON -DNCNN_AVX512BF16=ON -DNCNN_AVX512FP16=ON -DNCNN_XOP=OFF -DNCNN_OPENMP=OFF -DNCNN_BUILD_TOOLS=OFF -DNCNN_BUILD_EXAMPLES=OFF -DNCNN_BUILD_TESTS=ON .. cmake --build . -j 2 - - name: test-avx2 - run: cd build-avx2 && ctest --output-on-failure -j 2 - - name: lcov-collect - run: | - cd build-avx2 - lcov -d ./src -c -o lcov.info - lcov -r lcov.info '/usr/*' -o lcov.info - lcov -r lcov.info '*/build-avx2/*' -o lcov.info - lcov --list lcov.info - - name: codecov-avx2 - uses: codecov/codecov-action@v3 - with: - token: ${{ secrets.CODECOV_TOKEN }} - file: build-avx2/lcov.info - - linux-gcc-x64-avx512: - runs-on: [self-hosted, linux, t4] - steps: - - uses: actions/checkout@v3 - - name: build - env: - CC: gcc - CXX: g++ - LD_LIBRARY_PATH: /data/action/install/lib64 + - name: test-avx512-spr run: | - mkdir build && cd build - cmake -DCMAKE_BUILD_TYPE=debug -DNCNN_COVERAGE=ON -DNCNN_RUNTIME_CPU=OFF -DNCNN_AVX2=ON -DNCNN_XOP=OFF -DNCNN_AVXVNNI=OFF -DNCNN_AVX512=ON -DNCNN_AVX512VNNI=ON -DNCNN_OPENMP=OFF -DNCNN_BUILD_TOOLS=OFF -DNCNN_BUILD_EXAMPLES=OFF -DNCNN_BUILD_TESTS=ON .. - cmake --build . -j 4 - - name: test - env: - LD_LIBRARY_PATH: /data/action/install/lib64 - run: cd build && ctest --output-on-failure -j 4 + cd build-avx512-spr + TESTS_EXECUTABLE_LOADER=$SDE_PATH/sde64 TESTS_EXECUTABLE_LOADER_ARGUMENTS="-spr;--" ctest --output-on-failure -j 2 - name: lcov-collect run: | - cd build - lcov -d ./src -c -o lcov.info + cd build-avx512-spr + lcov --gcov-tool gcov-12 -d ./src -c -o lcov.info lcov -r lcov.info '/usr/*' -o lcov.info - lcov -r lcov.info '*/install/*' -o lcov.info - lcov -r lcov.info '*/build/*' -o lcov.info + lcov -r lcov.info '*/build-avx512-spr/*' -o lcov.info lcov --list lcov.info - - name: codecov - id: codecov - continue-on-error: true - uses: codecov/codecov-action@v3 - with: - token: ${{ secrets.CODECOV_TOKEN }} - file: build/lcov.info - - name: codecov-vlen256-retry-1 - continue-on-error: true - id: codecov-vlen256-retry-1 - if: steps.codecov.outcome=='failure' - uses: codecov/codecov-action@v3 - with: - token: ${{ secrets.CODECOV_TOKEN }} - file: build/lcov.info - - name: codecov-vlen256-retry-2 - continue-on-error: true - id: codecov-vlen256-retry-2 - if: steps.codecov-vlen256-retry-1.outcome=='failure' - uses: codecov/codecov-action@v3 - with: - token: ${{ secrets.CODECOV_TOKEN }} - file: build/lcov.info - - name: codecov-vlen256-retry-3 - continue-on-error: true - id: codecov-vlen256-retry-3 - if: steps.codecov-vlen256-retry-2.outcome=='failure' - uses: codecov/codecov-action@v3 - with: - token: ${{ secrets.CODECOV_TOKEN }} - file: build/lcov.info - - name: codecov-vlen256-retry-4 - continue-on-error: true - id: codecov-vlen256-retry-4 - if: steps.codecov-vlen256-retry-3.outcome=='failure' - uses: codecov/codecov-action@v3 - with: - token: ${{ secrets.CODECOV_TOKEN }} - file: build/lcov.info - - name: codecov-vlen256-retry-5 - continue-on-error: true - id: codecov-vlen256-retry-5 - if: steps.codecov-vlen256-retry-4.outcome=='failure' - uses: codecov/codecov-action@v3 - with: - token: ${{ secrets.CODECOV_TOKEN }} - file: build/lcov.info - - name: set the status - if: always() - run: | - if ${{ steps.codecov.outcome=='success' || steps.codecov-vlen256-retry-1.outcome=='success' || steps.codecov-vlen256-retry-2.outcome=='success' || steps.codecov-vlen256-retry-3.outcome=='success' || steps.codecov-vlen256-retry-4.outcome=='success' || steps.codecov-vlen256-retry-5.outcome=='success' }}; then - echo fine - else - exit 1 - fi - - linux-gcc-x64-avx512-spr: - runs-on: ubuntu-22.04 - steps: - - uses: actions/checkout@v3 - - name: update - run: sudo apt-get update - - name: gcc12 - run: sudo apt-get install gcc-12 g++-12 - - name: lcov - run: sudo apt-get install lcov - - name: Setup SDE binaries - uses: petarpetrovt/setup-sde@v2 - - name: build-avx512-spr - env: - CC: gcc-12 - CXX: g++-12 - run: | - mkdir build-avx512-spr && cd build-avx512-spr - cmake -DCMAKE_BUILD_TYPE=debug -DNCNN_COVERAGE=ON -DNCNN_RUNTIME_CPU=OFF -DNCNN_AVX2=ON -DNCNN_AVX512=ON -DNCNN_AVX512VNNI=ON -DNCNN_AVX512BF16=ON -DNCNN_AVX512FP16=ON -DNCNN_XOP=OFF -DNCNN_OPENMP=OFF -DNCNN_BUILD_TOOLS=OFF -DNCNN_BUILD_EXAMPLES=OFF -DNCNN_BUILD_TESTS=ON .. - cmake --build . -j 2 - - name: test-avx512-spr - run: | - cd build-avx512-spr - TESTS_EXECUTABLE_LOADER=$SDE_PATH/sde64 TESTS_EXECUTABLE_LOADER_ARGUMENTS="-spr;--" ctest --output-on-failure -j 2 - - name: lcov-collect - run: | - cd build-avx512-spr - lcov --gcov-tool gcov-12 -d ./src -c -o lcov.info - lcov -r lcov.info '/usr/*' -o lcov.info - lcov -r lcov.info '*/build-avx512-spr/*' -o lcov.info - lcov --list lcov.info - - name: codecov-avx512-spr + - name: codecov-avx512-spr uses: codecov/codecov-action@v3 with: token: ${{ secrets.CODECOV_TOKEN }} file: build-avx512-spr/lcov.info - - linux-gcc-armhf-vfpv3-d16: - runs-on: ubuntu-20.04 - steps: - - uses: actions/checkout@v3 - - name: lcov - run: sudo apt-get install lcov - - - name: cache-qemu - id: cache-qemu - uses: actions/cache@v3 - with: - path: qemu-install - key: qemu-arm-install-20220502 - - name: install-qemu-build-deps - if: steps.cache-qemu.outputs.cache-hit != 'true' - run: | - sudo apt-get update - sudo apt-get install autoconf automake autotools-dev ninja-build - - name: checkout-qemu - if: steps.cache-qemu.outputs.cache-hit != 'true' - uses: actions/checkout@v3 - with: - repository: qemu/qemu - path: qemu - ref: f5643914a9e8f79c606a76e6a9d7ea82a3fc3e65 - - name: qemu - if: steps.cache-qemu.outputs.cache-hit != 'true' - run: | - cd qemu - ./configure --prefix=$GITHUB_WORKSPACE/qemu-install --target-list=arm-linux-user --disable-system - make -j2 - make install - - - name: arm-gnu-toolchain - run: | - sudo apt-get update - sudo apt-get install g++-arm-linux-gnueabihf - - - name: configure - run: mkdir build && cd build && cmake -DCMAKE_TOOLCHAIN_FILE=../toolchains/arm-linux-gnueabihf-vfpv3-d16.toolchain.cmake -DCMAKE_BUILD_TYPE=debug -DNCNN_COVERAGE=ON -DNCNN_RUNTIME_CPU=OFF -DNCNN_VFPV4=OFF -DNCNN_ARM82=OFF -DNCNN_OPENMP=OFF -DNCNN_BUILD_TOOLS=OFF -DNCNN_BUILD_EXAMPLES=OFF -DNCNN_BUILD_TESTS=ON .. - - name: build - run: cmake --build build -j 2 - - - name: test - run: | - export PATH=$GITHUB_WORKSPACE/qemu-install/bin:$PATH - cd build - TESTS_EXECUTABLE_LOADER=qemu-arm TESTS_EXECUTABLE_LOADER_ARGUMENTS="-L;/usr/arm-linux-gnueabihf" ctest --output-on-failure -j 2 - - - name: lcov-collect - run: | - cd build - lcov -d ./src -c -o lcov.info - lcov -r lcov.info '/usr/*' -o lcov.info - lcov -r lcov.info '*/build/*' -o lcov.info - lcov --list lcov.info - - name: codecov - uses: codecov/codecov-action@v3 - with: - token: ${{ secrets.CODECOV_TOKEN }} - file: build/lcov.info - - linux-gcc-arm: - runs-on: ubuntu-20.04 - steps: - - uses: actions/checkout@v3 - - name: lcov - run: sudo apt-get install lcov - - - name: cache-qemu - id: cache-qemu - uses: actions/cache@v3 - with: - path: qemu-install - key: qemu-arm-install-20220502 - - name: install-qemu-build-deps - if: steps.cache-qemu.outputs.cache-hit != 'true' - run: | - sudo apt-get update - sudo apt-get install autoconf automake autotools-dev ninja-build - - name: checkout-qemu - if: steps.cache-qemu.outputs.cache-hit != 'true' - uses: actions/checkout@v3 - with: - repository: qemu/qemu - path: qemu - ref: f5643914a9e8f79c606a76e6a9d7ea82a3fc3e65 - - name: qemu - if: steps.cache-qemu.outputs.cache-hit != 'true' - run: | - cd qemu - ./configure --prefix=$GITHUB_WORKSPACE/qemu-install --target-list=arm-linux-user --disable-system - make -j2 - make install - - - name: arm-gnu-toolchain - run: | - sudo apt-get update - sudo apt-get install g++-arm-linux-gnueabi - - - name: configure - run: mkdir build && cd build && cmake -DCMAKE_TOOLCHAIN_FILE=../toolchains/arm-linux-gnueabi.toolchain.cmake -DCMAKE_BUILD_TYPE=debug -DNCNN_COVERAGE=ON -DNCNN_RUNTIME_CPU=OFF -DNCNN_VFPV4=ON -DNCNN_ARM82=OFF -DNCNN_OPENMP=OFF -DNCNN_BUILD_TOOLS=OFF -DNCNN_BUILD_EXAMPLES=OFF -DNCNN_BUILD_TESTS=ON .. - - name: build - run: cmake --build build -j 2 - - - name: test - run: | - export PATH=$GITHUB_WORKSPACE/qemu-install/bin:$PATH - cd build - TESTS_EXECUTABLE_LOADER=qemu-arm TESTS_EXECUTABLE_LOADER_ARGUMENTS="-L;/usr/arm-linux-gnueabi" ctest --output-on-failure -j 2 - - - name: lcov-collect - run: | - cd build - lcov -d ./src -c -o lcov.info - lcov -r lcov.info '/usr/*' -o lcov.info - lcov -r lcov.info '*/build/*' -o lcov.info - lcov --list lcov.info - - name: codecov - uses: codecov/codecov-action@v3 - with: - token: ${{ secrets.CODECOV_TOKEN }} - file: build/lcov.info - - linux-gcc-aarch64: - runs-on: ubuntu-20.04 - steps: - - uses: actions/checkout@v3 - - name: lcov - run: sudo apt-get install lcov - - - name: cache-qemu - id: cache-qemu - uses: actions/cache@v3 - with: - path: qemu-install - key: qemu-aarch64-install-20220502 - - name: install-qemu-build-deps - if: steps.cache-qemu.outputs.cache-hit != 'true' - run: | - sudo apt-get update - sudo apt-get install autoconf automake autotools-dev ninja-build - - name: checkout-qemu - if: steps.cache-qemu.outputs.cache-hit != 'true' - uses: actions/checkout@v3 - with: - repository: qemu/qemu - path: qemu - ref: f5643914a9e8f79c606a76e6a9d7ea82a3fc3e65 - - name: qemu - if: steps.cache-qemu.outputs.cache-hit != 'true' - run: | - cd qemu - ./configure --prefix=$GITHUB_WORKSPACE/qemu-install --target-list=aarch64-linux-user --disable-system - make -j2 - make install - - - name: aarch64-gnu-toolchain - run: | - sudo apt-get update - sudo apt-get install g++-aarch64-linux-gnu - - - name: configure - run: mkdir build && cd build && cmake -DCMAKE_TOOLCHAIN_FILE=../toolchains/aarch64-linux-gnu.toolchain.cmake -DCMAKE_BUILD_TYPE=debug -DNCNN_COVERAGE=ON -DNCNN_RUNTIME_CPU=OFF -DNCNN_ARM82=OFF -DNCNN_OPENMP=OFF -DNCNN_BUILD_TOOLS=OFF -DNCNN_BUILD_EXAMPLES=OFF -DNCNN_BUILD_TESTS=ON .. - - name: build - run: cmake --build build -j 2 - - - 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 - - - name: lcov-collect - run: | - cd build - lcov -d ./src -c -o lcov.info - lcov -r lcov.info '/usr/*' -o lcov.info - lcov -r lcov.info '*/build/*' -o lcov.info - lcov --list lcov.info - - name: codecov - uses: codecov/codecov-action@v3 - with: - token: ${{ secrets.CODECOV_TOKEN }} - file: build/lcov.info - - linux-gcc-arm82: - runs-on: ubuntu-20.04 - steps: - - uses: actions/checkout@v3 - - - name: lcov - run: sudo apt-get install lcov - - name: cache-qemu - id: cache-qemu - uses: actions/cache@v3 - with: - path: qemu-install - key: qemu-aarch64-install-20220502 - - name: install-qemu-build-deps - if: steps.cache-qemu.outputs.cache-hit != 'true' - run: | - sudo apt-get update - sudo apt-get install autoconf automake autotools-dev ninja-build - - name: checkout-qemu - if: steps.cache-qemu.outputs.cache-hit != 'true' - uses: actions/checkout@v3 - with: - repository: qemu/qemu - path: qemu - ref: f5643914a9e8f79c606a76e6a9d7ea82a3fc3e65 - - name: qemu - if: steps.cache-qemu.outputs.cache-hit != 'true' - run: | - cd qemu - ./configure --prefix=$GITHUB_WORKSPACE/qemu-install --target-list=aarch64-linux-user --disable-system - make -j2 - make install - - - name: aarch64-gnu-toolchain - run: | - sudo apt-get update - sudo apt-get install g++-aarch64-linux-gnu - - - name: build-arm82 - run: | - mkdir build-arm82 && cd build-arm82 - cmake -DCMAKE_TOOLCHAIN_FILE=../toolchains/aarch64-linux-gnu.toolchain.cmake -DCMAKE_BUILD_TYPE=debug -DNCNN_COVERAGE=ON -DNCNN_RUNTIME_CPU=OFF -DNCNN_ARM82=ON -DNCNN_ARM82FP16FML=OFF -DNCNN_ARM84BF16=OFF -DNCNN_ARM84I8MM=OFF -DNCNN_OPENMP=OFF -DNCNN_BUILD_TOOLS=OFF -DNCNN_BUILD_EXAMPLES=OFF -DNCNN_BUILD_TESTS=ON .. - cmake --build . -j 2 - - name: test - run: | - export PATH=$GITHUB_WORKSPACE/qemu-install/bin:$PATH - cd build-arm82 - TESTS_EXECUTABLE_LOADER=qemu-aarch64 TESTS_EXECUTABLE_LOADER_ARGUMENTS="-L;/usr/aarch64-linux-gnu" ctest --output-on-failure -j 2 - - name: lcov-collect - run: | - cd build-arm82 - lcov -d ./src -c -o lcov.info - lcov -r lcov.info '/usr/*' -o lcov.info - lcov -r lcov.info '*/build-arm82/*' -o lcov.info - lcov --list lcov.info - - name: codecov - uses: codecov/codecov-action@v3 - with: - token: ${{ secrets.CODECOV_TOKEN }} - file: build-arm82/lcov.info - - linux-gcc-arm82-omp: - runs-on: ubuntu-20.04 - steps: - - uses: actions/checkout@v3 - - - name: lcov - run: sudo apt-get install lcov - - name: cache-qemu - id: cache-qemu - uses: actions/cache@v3 - with: - path: qemu-install - key: qemu-aarch64-install-20220502 - - name: install-qemu-build-deps - if: steps.cache-qemu.outputs.cache-hit != 'true' - run: | - sudo apt-get update - sudo apt-get install autoconf automake autotools-dev ninja-build - - name: checkout-qemu - if: steps.cache-qemu.outputs.cache-hit != 'true' - uses: actions/checkout@v3 - with: - repository: qemu/qemu - path: qemu - ref: f5643914a9e8f79c606a76e6a9d7ea82a3fc3e65 - - name: qemu - if: steps.cache-qemu.outputs.cache-hit != 'true' - run: | - cd qemu - ./configure --prefix=$GITHUB_WORKSPACE/qemu-install --target-list=aarch64-linux-user --disable-system - make -j2 - make install - - - name: aarch64-gnu-toolchain - run: | - sudo apt-get update - sudo apt-get install g++-aarch64-linux-gnu - - - name: build-arm82-omp - run: | - mkdir build-arm82-omp && cd build-arm82-omp - cmake -DCMAKE_TOOLCHAIN_FILE=../toolchains/aarch64-linux-gnu.toolchain.cmake -DCMAKE_BUILD_TYPE=debug -DNCNN_COVERAGE=ON -DNCNN_RUNTIME_CPU=OFF -DNCNN_ARM82=ON -DNCNN_ARM82FP16FML=OFF -DNCNN_ARM84BF16=OFF -DNCNN_ARM84I8MM=OFF -DNCNN_OPENMP=ON -DNCNN_BUILD_TOOLS=OFF -DNCNN_BUILD_EXAMPLES=OFF -DNCNN_BUILD_TESTS=ON .. - cmake --build . -j 2 - - name: test - run: | - export PATH=$GITHUB_WORKSPACE/qemu-install/bin:$PATH - cd build-arm82-omp - TESTS_EXECUTABLE_LOADER=qemu-aarch64 TESTS_EXECUTABLE_LOADER_ARGUMENTS="-L;/usr/aarch64-linux-gnu" ctest --output-on-failure -j 2 - - name: lcov-collect - run: | - cd build-arm82-omp - lcov -d ./src -c -o lcov.info - lcov -r lcov.info '/usr/*' -o lcov.info - lcov -r lcov.info '*/build-arm82-omp/*' -o lcov.info - lcov --list lcov.info - - name: codecov - uses: codecov/codecov-action@v3 - with: - token: ${{ secrets.CODECOV_TOKEN }} - file: build-arm82-omp/lcov.info - - linux-gcc-arm82dot-omp: - runs-on: ubuntu-20.04 - steps: - - uses: actions/checkout@v3 - - - name: lcov - run: sudo apt-get install lcov - - name: cache-qemu - id: cache-qemu - uses: actions/cache@v3 - with: - path: qemu-install - key: qemu-aarch64-install-20220502 - - name: install-qemu-build-deps - if: steps.cache-qemu.outputs.cache-hit != 'true' - run: | - sudo apt-get update - sudo apt-get install autoconf automake autotools-dev ninja-build - - name: checkout-qemu - if: steps.cache-qemu.outputs.cache-hit != 'true' - uses: actions/checkout@v3 - with: - repository: qemu/qemu - path: qemu - ref: f5643914a9e8f79c606a76e6a9d7ea82a3fc3e65 - - name: qemu - if: steps.cache-qemu.outputs.cache-hit != 'true' - run: | - cd qemu - ./configure --prefix=$GITHUB_WORKSPACE/qemu-install --target-list=aarch64-linux-user --disable-system - make -j2 - make install - - - name: aarch64-gnu-toolchain - run: | - sudo apt-get update - sudo apt-get install g++-aarch64-linux-gnu - - - name: build-arm82dot-omp - run: | - mkdir build-arm82dot-omp && cd build-arm82dot-omp - cmake -DCMAKE_TOOLCHAIN_FILE=../toolchains/aarch64-linux-gnu.toolchain.cmake -DCMAKE_BUILD_TYPE=debug -DNCNN_COVERAGE=ON -DNCNN_RUNTIME_CPU=ON -DNCNN_ARM82=ON -DNCNN_ARM82DOT=ON -DNCNN_ARM82FP16FML=OFF -DNCNN_ARM84BF16=OFF -DNCNN_ARM84I8MM=OFF -DNCNN_OPENMP=ON -DNCNN_BUILD_TOOLS=OFF -DNCNN_BUILD_EXAMPLES=OFF -DNCNN_BUILD_TESTS=ON .. - cmake --build . -j 2 - - name: test - run: | - export PATH=$GITHUB_WORKSPACE/qemu-install/bin:$PATH - cd build-arm82dot-omp - TESTS_EXECUTABLE_LOADER=qemu-aarch64 TESTS_EXECUTABLE_LOADER_ARGUMENTS="-L;/usr/aarch64-linux-gnu" ctest --output-on-failure -j 2 - - name: lcov-collect - run: | - cd build-arm82dot-omp - lcov -d ./src -c -o lcov.info - lcov -r lcov.info '/usr/*' -o lcov.info - lcov -r lcov.info '*/build-arm82dot-omp/*' -o lcov.info - lcov --list lcov.info - - name: codecov - uses: codecov/codecov-action@v3 - with: - token: ${{ secrets.CODECOV_TOKEN }} - file: build-arm82dot-omp/lcov.info - - linux-gcc-arm84: - runs-on: ubuntu-22.04 - steps: - - uses: actions/checkout@v3 - - - name: lcov - run: sudo apt-get install lcov - - name: cache-qemu - id: cache-qemu - uses: actions/cache@v3 - with: - path: qemu-install - key: qemu-aarch64-install-20220502 - - name: install-qemu-build-deps - if: steps.cache-qemu.outputs.cache-hit != 'true' - run: | - sudo apt-get update - sudo apt-get install autoconf automake autotools-dev ninja-build - - name: checkout-qemu - if: steps.cache-qemu.outputs.cache-hit != 'true' - uses: actions/checkout@v3 - with: - repository: qemu/qemu - path: qemu - ref: f5643914a9e8f79c606a76e6a9d7ea82a3fc3e65 - - name: qemu - if: steps.cache-qemu.outputs.cache-hit != 'true' - run: | - cd qemu - ./configure --prefix=$GITHUB_WORKSPACE/qemu-install --target-list=aarch64-linux-user --disable-system - make -j2 - make install - - - name: aarch64-gnu-toolchain - run: | - sudo apt-get update - sudo apt-get install g++-aarch64-linux-gnu - - - name: build-arm84 - run: | - mkdir build-arm84 && cd build-arm84 - cmake -DCMAKE_TOOLCHAIN_FILE=../toolchains/aarch64-linux-gnu.toolchain.cmake -DCMAKE_BUILD_TYPE=debug -DNCNN_COVERAGE=ON -DNCNN_RUNTIME_CPU=ON -DNCNN_ARM82=ON -DNCNN_ARM82DOT=ON -DNCNN_ARM82FP16FML=ON -DNCNN_ARM84BF16=ON -DNCNN_ARM84I8MM=ON -DNCNN_OPENMP=ON -DNCNN_BUILD_TOOLS=OFF -DNCNN_BUILD_EXAMPLES=OFF -DNCNN_BUILD_TESTS=ON .. - cmake --build . -j 2 - - name: test - run: | - export PATH=$GITHUB_WORKSPACE/qemu-install/bin:$PATH - cd build-arm84 - TESTS_EXECUTABLE_LOADER=qemu-aarch64 TESTS_EXECUTABLE_LOADER_ARGUMENTS="-L;/usr/aarch64-linux-gnu" ctest --output-on-failure -j 2 - - name: lcov-collect - run: | - cd build-arm84 - lcov -d ./src -c -o lcov.info - lcov -r lcov.info '/usr/*' -o lcov.info - lcov -r lcov.info '*/build-arm84/*' -o lcov.info - lcov --list lcov.info - - name: codecov - uses: codecov/codecov-action@v3 - with: - token: ${{ secrets.CODECOV_TOKEN }} - file: build-arm84/lcov.info - - linux-gcc-mipsisa32r6el: - runs-on: ubuntu-20.04 - steps: - - uses: actions/checkout@v3 - - - name: lcov - run: sudo apt-get install lcov - - name: cache-qemu - id: cache-qemu - uses: actions/cache@v3 - with: - path: qemu-install - key: qemu-mipsel-install-20220502 - - name: install-qemu-build-deps - if: steps.cache-qemu.outputs.cache-hit != 'true' - run: | - sudo apt-get update - sudo apt-get install autoconf automake autotools-dev ninja-build - - name: checkout-qemu - if: steps.cache-qemu.outputs.cache-hit != 'true' - uses: actions/checkout@v3 - with: - repository: qemu/qemu - path: qemu - ref: f5643914a9e8f79c606a76e6a9d7ea82a3fc3e65 - - name: qemu - if: steps.cache-qemu.outputs.cache-hit != 'true' - run: | - cd qemu - ./configure --prefix=$GITHUB_WORKSPACE/qemu-install --target-list=mipsel-linux-user --disable-system - make -j2 - make install - - - name: mipsisa32r6el-gnu-toolchain - run: | - sudo apt-get update - sudo apt-get install g++-mipsisa32r6el-linux-gnu - - - name: configure - run: mkdir build && cd build && cmake -DCMAKE_TOOLCHAIN_FILE=../toolchains/mipsisa32r6el-linux-gnu.toolchain.cmake -DCMAKE_BUILD_TYPE=debug -DNCNN_COVERAGE=ON -DNCNN_RUNTIME_CPU=OFF -DNCNN_MSA=OFF -DNCNN_MMI=OFF -DNCNN_BUILD_TOOLS=OFF -DNCNN_BUILD_EXAMPLES=OFF -DNCNN_BUILD_TESTS=ON .. - - name: build - run: cmake --build build -j 2 - - - name: test - run: | - export PATH=$GITHUB_WORKSPACE/qemu-install/bin:$PATH - cd build - TESTS_EXECUTABLE_LOADER=qemu-mipsel TESTS_EXECUTABLE_LOADER_ARGUMENTS="-L;/usr/mipsisa32r6el-linux-gnu" ctest --output-on-failure -j 2 - - - name: lcov-collect - run: | - cd build - lcov -d ./src -c -o lcov.info - lcov -r lcov.info '/usr/*' -o lcov.info - lcov -r lcov.info '*/build/*' -o lcov.info - lcov --list lcov.info - - name: codecov - uses: codecov/codecov-action@v3 - with: - token: ${{ secrets.CODECOV_TOKEN }} - file: build/lcov.info - - linux-gcc-mipsisa64r6el: - runs-on: ubuntu-20.04 - steps: - - uses: actions/checkout@v3 - - - name: lcov - run: sudo apt-get install lcov - - name: cache-qemu - id: cache-qemu - uses: actions/cache@v3 - with: - path: qemu-install - key: qemu-mips64el-install-20220502-3 - - name: install-qemu-build-deps - if: steps.cache-qemu.outputs.cache-hit != 'true' - run: | - sudo apt-get update - sudo apt-get install autoconf automake autotools-dev ninja-build - - name: checkout-qemu - if: steps.cache-qemu.outputs.cache-hit != 'true' - uses: actions/checkout@v3 - with: - repository: qemu/qemu - path: qemu - ref: f5643914a9e8f79c606a76e6a9d7ea82a3fc3e65 - - name: qemu - if: steps.cache-qemu.outputs.cache-hit != 'true' - run: | - cd qemu - wget https://raw.githubusercontent.com/nihui/ncnn-assets/master/qemu-patches/0001-target-mips-Fix-SAT_S-trans-helper.patch - wget https://raw.githubusercontent.com/nihui/ncnn-assets/master/qemu-patches/0002-target-mips-Fix-df_extract_val-and-df_extract_df-dfe.patch - wget https://raw.githubusercontent.com/nihui/ncnn-assets/master/qemu-patches/0003-target-mips-Fix-msa-checking-condition-in-trans_msa_.patch - wget https://raw.githubusercontent.com/nihui/ncnn-assets/master/qemu-patches/0004-target-mips-Do-not-treat-msa-INSERT-as-NOP-when-wd-i.patch - wget https://raw.githubusercontent.com/nihui/ncnn-assets/master/qemu-patches/0005-target-mips-Fix-FTRUNC_S-and-FTRUNC_U-trans-helper.patch - wget https://raw.githubusercontent.com/nihui/ncnn-assets/master/qemu-patches/0006-target-mips-Fix-store-adress-of-high-64bit-in-helper.patch - patch -p1 -i 0001-target-mips-Fix-SAT_S-trans-helper.patch - patch -p1 -i 0002-target-mips-Fix-df_extract_val-and-df_extract_df-dfe.patch - patch -p1 -i 0003-target-mips-Fix-msa-checking-condition-in-trans_msa_.patch - patch -p1 -i 0004-target-mips-Do-not-treat-msa-INSERT-as-NOP-when-wd-i.patch - patch -p1 -i 0005-target-mips-Fix-FTRUNC_S-and-FTRUNC_U-trans-helper.patch - patch -p1 -i 0006-target-mips-Fix-store-adress-of-high-64bit-in-helper.patch - ./configure --prefix=$GITHUB_WORKSPACE/qemu-install --target-list=mips64el-linux-user --disable-system - make -j2 - make install - - - name: mipsisa64r6el-gnuabi64-toolchain - run: | - sudo apt-get update - sudo apt-get install g++-mipsisa64r6el-linux-gnuabi64 - - - name: configure - run: mkdir build && cd build && cmake -DCMAKE_TOOLCHAIN_FILE=../toolchains/mipsisa64r6el-linux-gnuabi64.toolchain.cmake -DCMAKE_BUILD_TYPE=debug -DNCNN_COVERAGE=ON -DNCNN_RUNTIME_CPU=OFF -DNCNN_MSA=ON -DNCNN_MMI=OFF -DNCNN_OPENMP=OFF -DNCNN_BUILD_TOOLS=OFF -DNCNN_BUILD_EXAMPLES=OFF -DNCNN_BUILD_TESTS=ON .. - - name: build - run: cmake --build build -j 2 - - - name: test - run: | - export PATH=$GITHUB_WORKSPACE/qemu-install/bin:$PATH - cd build - TESTS_EXECUTABLE_LOADER=qemu-mips64el TESTS_EXECUTABLE_LOADER_ARGUMENTS="-L;/usr/mipsisa64r6el-linux-gnuabi64" ctest --output-on-failure -j 2 - - - name: lcov-collect - run: | - cd build - lcov -d ./src -c -o lcov.info - lcov -r lcov.info '/usr/*' -o lcov.info - lcov -r lcov.info '*/build/*' -o lcov.info - lcov --list lcov.info - - name: codecov - uses: codecov/codecov-action@v3 - with: - token: ${{ secrets.CODECOV_TOKEN }} - file: build/lcov.info - - linux-gcc-riscv64: - runs-on: ubuntu-20.04 - steps: - - uses: actions/checkout@v3 - - - name: lcov - run: sudo apt-get install lcov - - - name: cache-qemu - id: cache-qemu - uses: actions/cache@v3 - with: - path: qemu-install - key: qemu-riscv64-install-20220502-3 - - name: install-qemu-build-deps - if: steps.cache-qemu.outputs.cache-hit != 'true' - run: | - sudo apt-get update - sudo apt-get install autoconf automake autotools-dev ninja-build - - name: checkout-qemu - if: steps.cache-qemu.outputs.cache-hit != 'true' - uses: actions/checkout@v3 - with: - repository: qemu/qemu - path: qemu - ref: f5643914a9e8f79c606a76e6a9d7ea82a3fc3e65 - - name: qemu - if: steps.cache-qemu.outputs.cache-hit != 'true' - run: | - cd qemu - wget https://raw.githubusercontent.com/nihui/ncnn-assets/master/qemu-patches/0007-linux-user-Expose-risc-v-V-isa-bit-in-get_elf_hwcap.patch - patch -p1 -i 0007-linux-user-Expose-risc-v-V-isa-bit-in-get_elf_hwcap.patch - ./configure --prefix=$GITHUB_WORKSPACE/qemu-install --target-list=riscv64-linux-user --disable-system - make -j2 - make install - - - name: riscv64-gnu-toolchain - run: | - sudo apt-get update - sudo apt-get install g++-riscv64-linux-gnu - - - name: configure - run: mkdir build && cd build && cmake -DCMAKE_TOOLCHAIN_FILE=../toolchains/riscv64-linux-gnu.toolchain.cmake -DCMAKE_BUILD_TYPE=debug -DNCNN_COVERAGE=ON -DNCNN_RUNTIME_CPU=OFF -DNCNN_OPENMP=OFF -DNCNN_BUILD_TOOLS=OFF -DNCNN_BUILD_EXAMPLES=OFF -DNCNN_BUILD_TESTS=ON .. - - name: build - run: cmake --build build -j 2 - - - name: test - run: | - export PATH=$GITHUB_WORKSPACE/qemu-install/bin:$PATH - cd build - TESTS_EXECUTABLE_LOADER=qemu-riscv64 TESTS_EXECUTABLE_LOADER_ARGUMENTS="-L;/usr/riscv64-linux-gnu" ctest --output-on-failure -j 2 - - - name: lcov-collect - run: | - cd build - lcov -d ./src -c -o lcov.info - lcov -r lcov.info '/usr/*' -o lcov.info - lcov -r lcov.info '*/build/*' -o lcov.info - lcov --list lcov.info - - name: codecov - uses: codecov/codecov-action@v3 - with: - token: ${{ secrets.CODECOV_TOKEN }} - file: build/lcov.info - - linux-gcc-riscv64-rvv: - runs-on: [self-hosted, linux, centos] - steps: - - uses: actions/checkout@v3 - - #- name: lcov - #run: sudo apt-get install lcov - - #- name: cache-qemu - #id: cache-qemu - #uses: actions/cache@v3 - #with: - #path: qemu-install - #key: qemu-riscv64-install-20220502-3 - #- name: install-qemu-build-deps - #if: steps.cache-qemu.outputs.cache-hit != 'true' - #run: | - #sudo apt-get update - #sudo apt-get install autoconf automake autotools-dev ninja-build - #- name: checkout-qemu - #if: steps.cache-qemu.outputs.cache-hit != 'true' - #uses: actions/checkout@v3 - #with: - #repository: qemu/qemu - #path: qemu - #ref: f5643914a9e8f79c606a76e6a9d7ea82a3fc3e65 - #- name: qemu - #if: steps.cache-qemu.outputs.cache-hit != 'true' - #run: | - #cd qemu - #wget https://raw.githubusercontent.com/nihui/ncnn-assets/master/qemu-patches/0007-linux-user-Expose-risc-v-V-isa-bit-in-get_elf_hwcap.patch - #patch -p1 -i 0007-linux-user-Expose-risc-v-V-isa-bit-in-get_elf_hwcap.patch - #./configure --prefix=$GITHUB_WORKSPACE/qemu-install --target-list=riscv64-linux-user --disable-system - #make -j2 - #make install - - #- name: cache-riscv - #id: cache-riscv - #uses: actions/cache@v3 - #with: - #path: rv64gcv-install - #key: rv64gcv-linux-install-20210504 - - #- name: install-riscv-build-deps - #if: steps.cache-riscv.outputs.cache-hit != 'true' - #run: | - #sudo apt-get update - #sudo apt-get install autoconf automake autotools-dev curl python3 libmpc-dev libmpfr-dev libgmp-dev gawk build-essential bison flex texinfo gperf libtool patchutils bc zlib1g-dev libexpat-dev device-tree-compiler - - #- name: checkout-riscv-gnu-toolchain - #if: steps.cache-riscv.outputs.cache-hit != 'true' - #uses: actions/checkout@v3 - #with: - #repository: riscv/riscv-gnu-toolchain - #path: riscv-gnu-toolchain - #ref: 28271f03bb538d926ad2889dc8ad1b0cb1b3b45c - #- name: checkout-riscv-gnu-toolchain-submodules - #if: steps.cache-riscv.outputs.cache-hit != 'true' - #run: | - #cd riscv-gnu-toolchain - #git submodule update --init --recursive --depth 1 riscv-binutils - #git submodule update --init --recursive --depth 1 riscv-gcc - #git submodule update --init --recursive --depth 1 riscv-glibc - #git submodule update --init --recursive --depth 1 riscv-dejagnu - #git submodule update --init --recursive --depth 1 riscv-newlib - #git submodule update --init --recursive --depth 1 riscv-gdb - #- name: riscv-gnu-toolchain - #if: steps.cache-riscv.outputs.cache-hit != 'true' - #run: | - #cd riscv-gnu-toolchain - #sed -i '/__OBSOLETE_MATH/d' riscv-newlib/newlib/libm/common/math_errf.c - #./configure --prefix=$GITHUB_WORKSPACE/rv64gcv-install --with-arch=rv64gcv_zfh - #make linux - - #- name: riscv-strip-install - #if: steps.cache-riscv.outputs.cache-hit != 'true' - #run: find $GITHUB_WORKSPACE/rv64gcv-install -type f | xargs -i strip -g {} || true - - - name: configure - run: export RISCV_ROOT_PATH=/data/action/osd/rv64gcv-install && mkdir build && cd build && cmake -DCMAKE_TOOLCHAIN_FILE=../toolchains/riscv64-unknown-linux-gnu.toolchain.cmake -DCMAKE_BUILD_TYPE=debug -DCMAKE_C_FLAGS="-O1" -DCMAKE_CXX_FLAGS="-O1" -DNCNN_COVERAGE=ON -DNCNN_RUNTIME_CPU=OFF -DNCNN_RVV=ON -DNCNN_OPENMP=OFF -DNCNN_BUILD_TOOLS=OFF -DNCNN_BUILD_EXAMPLES=OFF -DNCNN_BUILD_TESTS=ON .. - - name: build - run: cmake --build build -j 4 - - - name: test-vlen128 - run: | - export PATH=/data/action/osd/qemu-install/bin:$PATH - cd build - TESTS_EXECUTABLE_LOADER=qemu-riscv64 TESTS_EXECUTABLE_LOADER_ARGUMENTS="-cpu;rv64,v=true,Zfh=true,vlen=128,elen=64,vext_spec=v1.0;-L;/data/action/osd/rv64gcv-install/sysroot" ctest --output-on-failure -j 4 - - - name: lcov-collect-vlen128 - run: | - cd build - lcov --gcov-tool /data/action/osd/rv64gcv-install/bin/riscv64-unknown-linux-gnu-gcov -d ./src -c -o lcov.info - lcov -r lcov.info '/usr/*' -o lcov.info - lcov -r lcov.info '*/build/*' -o lcov.info - lcov -r lcov.info '*/rv64gcv-install/*' -o lcov.info - lcov --list lcov.info - - name: codecov-vlen128 - id: codecov-vlen128 - continue-on-error: true - uses: codecov/codecov-action@v3 - with: - token: ${{ secrets.CODECOV_TOKEN }} - file: build/lcov.info - - name: codecov-vlen128-retry-1 - continue-on-error: true - id: codecov-vlen128-retry-1 - if: steps.codecov-vlen128.outcome=='failure' - uses: codecov/codecov-action@v3 - with: - token: ${{ secrets.CODECOV_TOKEN }} - file: build/lcov.info - - name: codecov-vlen128-retry-2 - continue-on-error: true - id: codecov-vlen128-retry-2 - if: steps.codecov-vlen128-retry-1.outcome=='failure' - uses: codecov/codecov-action@v3 - with: - token: ${{ secrets.CODECOV_TOKEN }} - file: build/lcov.info - - name: codecov-vlen128-retry-3 - continue-on-error: true - id: codecov-vlen128-retry-3 - if: steps.codecov-vlen128-retry-2.outcome=='failure' - uses: codecov/codecov-action@v3 - with: - token: ${{ secrets.CODECOV_TOKEN }} - file: build/lcov.info - - name: codecov-vlen128-retry-4 - continue-on-error: true - id: codecov-vlen128-retry-4 - if: steps.codecov-vlen128-retry-3.outcome=='failure' - uses: codecov/codecov-action@v3 - with: - token: ${{ secrets.CODECOV_TOKEN }} - file: build/lcov.info - - name: codecov-vlen128-retry-5 - continue-on-error: true - id: codecov-vlen128-retry-5 - if: steps.codecov-vlen128-retry-4.outcome=='failure' - uses: codecov/codecov-action@v3 - with: - token: ${{ secrets.CODECOV_TOKEN }} - file: build/lcov.info - - name: set codecov-vlen128 status - if: always() - run: | - if ${{ steps.codecov-vlen128.outcome=='success' || steps.codecov-vlen128-retry-1.outcome=='success' || steps.codecov-vlen128-retry-2.outcome=='success' || steps.codecov-vlen128-retry-3.outcome=='success' || steps.codecov-vlen128-retry-4.outcome=='success' || steps.codecov-vlen128-retry-5.outcome=='success' }}; then - echo fine - else - exit 1 - fi - - - name: test-vlen256 - run: | - export PATH=/data/action/osd/qemu-install/bin:$PATH - cd build - TESTS_EXECUTABLE_LOADER=qemu-riscv64 TESTS_EXECUTABLE_LOADER_ARGUMENTS="-cpu;rv64,v=true,Zfh=true,vlen=256,elen=64,vext_spec=v1.0;-L;/data/action/osd/rv64gcv-install/sysroot" ctest --output-on-failure -j 4 - - - name: lcov-collect-vlen256 - run: | - cd build - lcov --gcov-tool /data/action/osd/rv64gcv-install/bin/riscv64-unknown-linux-gnu-gcov -d ./src -c -o lcov.info - lcov -r lcov.info '/usr/*' -o lcov.info - lcov -r lcov.info '*/build/*' -o lcov.info - lcov -r lcov.info '*/rv64gcv-install/*' -o lcov.info - lcov --list lcov.info - - name: codecov-vlen256 - id: codecov-vlen256 - continue-on-error: true - uses: codecov/codecov-action@v3 - with: - token: ${{ secrets.CODECOV_TOKEN }} - file: build/lcov.info - - name: codecov-vlen256-retry-1 - continue-on-error: true - id: codecov-vlen256-retry-1 - if: steps.codecov-vlen256.outcome=='failure' - uses: codecov/codecov-action@v3 - with: - token: ${{ secrets.CODECOV_TOKEN }} - file: build/lcov.info - - name: codecov-vlen256-retry-2 - continue-on-error: true - id: codecov-vlen256-retry-2 - if: steps.codecov-vlen256-retry-1.outcome=='failure' - uses: codecov/codecov-action@v3 - with: - token: ${{ secrets.CODECOV_TOKEN }} - file: build/lcov.info - - name: codecov-vlen256-retry-3 - continue-on-error: true - id: codecov-vlen256-retry-3 - if: steps.codecov-vlen256-retry-2.outcome=='failure' - uses: codecov/codecov-action@v3 - with: - token: ${{ secrets.CODECOV_TOKEN }} - file: build/lcov.info - - name: codecov-vlen256-retry-4 - continue-on-error: true - id: codecov-vlen256-retry-4 - if: steps.codecov-vlen256-retry-3.outcome=='failure' - uses: codecov/codecov-action@v3 - with: - token: ${{ secrets.CODECOV_TOKEN }} - file: build/lcov.info - - name: codecov-vlen256-retry-5 - continue-on-error: true - id: codecov-vlen256-retry-5 - if: steps.codecov-vlen256-retry-4.outcome=='failure' - uses: codecov/codecov-action@v3 - with: - token: ${{ secrets.CODECOV_TOKEN }} - file: build/lcov.info - - name: set codecov-vlen256 status - if: always() - run: | - if ${{ steps.codecov-vlen256.outcome=='success' || steps.codecov-vlen256-retry-1.outcome=='success' || steps.codecov-vlen256-retry-2.outcome=='success' || steps.codecov-vlen256-retry-3.outcome=='success' || steps.codecov-vlen256-retry-4.outcome=='success' || steps.codecov-vlen256-retry-5.outcome=='success' }}; then - echo fine - else - exit 1 - fi