From 2ef4b1111d8e6440826bf94882f21139508e7890 Mon Sep 17 00:00:00 2001 From: agibsonccc Date: Sat, 6 Mar 2021 10:24:47 +0900 Subject: [PATCH 1/4] Add quick sanity check tests that run every push --- .github/workflows/run-amd64.yaml | 75 ++++++++++++++++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 .github/workflows/run-amd64.yaml diff --git a/.github/workflows/run-amd64.yaml b/.github/workflows/run-amd64.yaml new file mode 100644 index 000000000..745b8a04c --- /dev/null +++ b/.github/workflows/run-amd64.yaml @@ -0,0 +1,75 @@ +on: + push: +jobs: + linux-x86_64: + runs-on: ubuntu-18.04 + steps: + - name: Cancel Previous Runs + uses: styfle/cancel-workflow-action@0.8.0 + with: + access_token: ${{ github.token }} + - uses: actions/checkout@v2 + - uses: ./.github/actions/install-protobuf-linux + - uses: ./.github/actions/download-dl4j-test-resources-linux + - name: Run tests on linux-x86_64 + shell: bash + run: | + mvn --version + cmake --version + protoc --version + cd dl4j-test-resources-master && mvn clean install -DskipTests && cd .. + export OMP_NUM_THREADS=1 + mvn -Ptestresources -pl ":deeplearning4j-modelimport,:deeplearning4j-core,:nd4j-native,:samediff-import,:libnd4j" -Dlibnd4j.buildthreads=1 -Ptest-nd4j-native -Dlibnd4j.chip=cpu clean test + + android-x86_64: + runs-on: ubuntu-18.04 + steps: + - uses: actions/checkout@v2 + - uses: ./.github/actions/install-protobuf-linux + - uses: ./.github/actions/download-dl4j-test-resources-linux + - uses: nttld/setup-ndk@v1 + with: + ndk-version: r21d + - name: Run tests on linux-x86_64 + shell: bash + env: + ANDROID_NDK: /opt/hostedtoolcache/ndk/r21d/x64 + GNUMAKEFLAGS: "-j1" + MAKEFLAGS: "-j1" + run: | + mvn --version + cmake --version + protoc --version + export OMP_NUM_THREADS=1 + mvn -pl ":deeplearning4j-modelimport,:deeplearning4j-core,:nd4j-native,:samediff-import,:libnd4j" -Dlibnd4j.build="Debug" -Dlibnd4j.buildthreads=1 -Ptestresources -Djavacpp.platform=android-x86_64 -libnd4j.platform=android-x86_64 -Ptest-nd4j-native -Dlibnd4j.chip=cpu clean test + + + windows-x86_64: + runs-on: windows-2019 + steps: + - uses: actions/checkout@v2 + - uses: ./.github/actions/msys2-base-setup + - uses: ./.github/actions/download-dl4j-test-resources-windows + - name: Run tests + shell: cmd + run: | + set "PATH=C:\msys64\usr\bin;%PATH%" + export OMP_NUM_THREADS=1 + mvn -pl ":deeplearning4j-modelimport,:deeplearning4j-core,:nd4j-native,:samediff-import,:libnd4j" -Ptestresources -Dlibnd4j.buildthreads=1 -Dlibnd4j.build="Debug" -Djavacpp.platform=windows-x86_64 -libnd4j.platform=windows-x86_64 -Ptest-nd4j-native -Dlibnd4j.chip=cpu clean test + + + + mac-x86_64: + runs-on: macos-10.15 + steps: + - uses: actions/checkout@v2 + - uses: ./.github/actions/download-dl4j-test-resources-linux + - name: Install and run tests + shell: bash + env: + VERBOSE: 1 + run: | + brew install unzip ccache gcc swig autoconf-archive automake cmake libomp libtool libusb ant maven nasm xz pkg-config sdl gpg1 bison flex perl ragel binutils gradle gmp isl libmpc mpfr wget python + export OMP_NUM_THREADS=1 + mvn -pl ":deeplearning4j-modelimport,:deeplearning4j-core,:nd4j-native,:samediff-import,:libnd4j" -Dlibnd4j.build="Debug" -Dlibnd4j.buildthreads=1 -Ptestresources -Djavacpp.platform=macosx-x86_64 -libnd4j.platform=macosx-x86_64 -Ptest-nd4j-native -Dlibnd4j.chip=cpu clean test + From 3722c0552fd21cc10e3c2139d84e11626825e2c9 Mon Sep 17 00:00:00 2001 From: agibsonccc Date: Sat, 6 Mar 2021 10:39:32 +0900 Subject: [PATCH 2/4] Update --- .github/workflows/build-android-x86_64.yml | 1 - .../workflows/{run-amd64.yaml => cpu-sanity-check-tests.yaml} | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) rename .github/workflows/{run-amd64.yaml => cpu-sanity-check-tests.yaml} (97%) diff --git a/.github/workflows/build-android-x86_64.yml b/.github/workflows/build-android-x86_64.yml index fa79452e2..9ae8120a2 100644 --- a/.github/workflows/build-android-x86_64.yml +++ b/.github/workflows/build-android-x86_64.yml @@ -28,7 +28,6 @@ jobs: - name: Build on linux-x86_64 env: ANDROID_NDK: ${{ steps.setup-ndk.outputs.ndk-path }} - OPENBLAS_PATH: "/opt/openblas/" LIBND4J_HOME: "${GITHUB_WORKSPACE}/libnd4j" GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} MAVEN_USERNAME: ${{ secrets.SONATYPE_USER_1 }} diff --git a/.github/workflows/run-amd64.yaml b/.github/workflows/cpu-sanity-check-tests.yaml similarity index 97% rename from .github/workflows/run-amd64.yaml rename to .github/workflows/cpu-sanity-check-tests.yaml index 745b8a04c..79327dd16 100644 --- a/.github/workflows/run-amd64.yaml +++ b/.github/workflows/cpu-sanity-check-tests.yaml @@ -29,11 +29,11 @@ jobs: - uses: ./.github/actions/download-dl4j-test-resources-linux - uses: nttld/setup-ndk@v1 with: - ndk-version: r21d + ndk-version: r18b - name: Run tests on linux-x86_64 shell: bash env: - ANDROID_NDK: /opt/hostedtoolcache/ndk/r21d/x64 + ANDROID_NDK: ${{ steps.setup-ndk.outputs.ndk-path }} GNUMAKEFLAGS: "-j1" MAKEFLAGS: "-j1" run: | From b9830a44b2db05624b47a26ce5791445591240bc Mon Sep 17 00:00:00 2001 From: agibsonccc Date: Sat, 6 Mar 2021 11:13:39 +0900 Subject: [PATCH 3/4] Update cpu-sanity-check-tests.yaml --- .github/workflows/cpu-sanity-check-tests.yaml | 23 ------------------- 1 file changed, 23 deletions(-) diff --git a/.github/workflows/cpu-sanity-check-tests.yaml b/.github/workflows/cpu-sanity-check-tests.yaml index 79327dd16..0fc3120a9 100644 --- a/.github/workflows/cpu-sanity-check-tests.yaml +++ b/.github/workflows/cpu-sanity-check-tests.yaml @@ -21,29 +21,6 @@ jobs: export OMP_NUM_THREADS=1 mvn -Ptestresources -pl ":deeplearning4j-modelimport,:deeplearning4j-core,:nd4j-native,:samediff-import,:libnd4j" -Dlibnd4j.buildthreads=1 -Ptest-nd4j-native -Dlibnd4j.chip=cpu clean test - android-x86_64: - runs-on: ubuntu-18.04 - steps: - - uses: actions/checkout@v2 - - uses: ./.github/actions/install-protobuf-linux - - uses: ./.github/actions/download-dl4j-test-resources-linux - - uses: nttld/setup-ndk@v1 - with: - ndk-version: r18b - - name: Run tests on linux-x86_64 - shell: bash - env: - ANDROID_NDK: ${{ steps.setup-ndk.outputs.ndk-path }} - GNUMAKEFLAGS: "-j1" - MAKEFLAGS: "-j1" - run: | - mvn --version - cmake --version - protoc --version - export OMP_NUM_THREADS=1 - mvn -pl ":deeplearning4j-modelimport,:deeplearning4j-core,:nd4j-native,:samediff-import,:libnd4j" -Dlibnd4j.build="Debug" -Dlibnd4j.buildthreads=1 -Ptestresources -Djavacpp.platform=android-x86_64 -libnd4j.platform=android-x86_64 -Ptest-nd4j-native -Dlibnd4j.chip=cpu clean test - - windows-x86_64: runs-on: windows-2019 steps: From 8689b16fde1fa6eed883765baabd9736504f152d Mon Sep 17 00:00:00 2001 From: agibsonccc Date: Sat, 6 Mar 2021 11:28:53 +0900 Subject: [PATCH 4/4] Update libnd4j build script for windows, add integration tests --- .github/workflows/cpu-integration-tests.yaml | 52 ++++++++++++++++++++ libnd4j/tests_cpu/run_tests.sh | 7 ++- 2 files changed, 58 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/cpu-integration-tests.yaml diff --git a/.github/workflows/cpu-integration-tests.yaml b/.github/workflows/cpu-integration-tests.yaml new file mode 100644 index 000000000..8d57fa2e7 --- /dev/null +++ b/.github/workflows/cpu-integration-tests.yaml @@ -0,0 +1,52 @@ +on: + push: +jobs: + linux-x86_64: + runs-on: ubuntu-18.04 + steps: + - name: Cancel Previous Runs + uses: styfle/cancel-workflow-action@0.8.0 + with: + access_token: ${{ github.token }} + - uses: actions/checkout@v2 + - uses: ./.github/actions/install-protobuf-linux + - uses: ./.github/actions/download-dl4j-test-resources-linux + - name: Run tests on linux-x86_64 + shell: bash + run: | + mvn --version + cmake --version + protoc --version + cd dl4j-test-resources-master && mvn clean install -DskipTests && cd .. + export OMP_NUM_THREADS=1 + mvn -Pintegration-tests -Ptestresources -Dlibnd4j.buildthreads=1 -Ptest-nd4j-native -Dlibnd4j.chip=cpu clean test + + windows-x86_64: + runs-on: windows-2019 + steps: + - uses: actions/checkout@v2 + - uses: ./.github/actions/msys2-base-setup + - uses: ./.github/actions/download-dl4j-test-resources-windows + - name: Run tests + shell: cmd + run: | + set "PATH=C:\msys64\usr\bin;%PATH%" + export OMP_NUM_THREADS=1 + mvn -Pintegration-tests -Ptestresources -Dlibnd4j.buildthreads=1 -Dlibnd4j.build="Debug" -Djavacpp.platform=windows-x86_64 -libnd4j.platform=windows-x86_64 -Ptest-nd4j-native -Dlibnd4j.chip=cpu clean test + + + + mac-x86_64: + runs-on: macos-10.15 + steps: + - uses: actions/checkout@v2 + - uses: ./.github/actions/download-dl4j-test-resources-linux + - name: Install and run tests + shell: bash + env: + VERBOSE: 1 + run: | + brew install unzip ccache gcc swig autoconf-archive automake cmake libomp libtool libusb ant maven nasm xz pkg-config sdl gpg1 bison flex perl ragel binutils gradle gmp isl libmpc mpfr wget python + export OMP_NUM_THREADS=1 + mvn -Pintegration-tests -Dlibnd4j.build="Debug" -Dlibnd4j.buildthreads=1 -Ptestresources -Djavacpp.platform=macosx-x86_64 -libnd4j.platform=macosx-x86_64 -Ptest-nd4j-native -Dlibnd4j.chip=cpu clean test + diff --git a/libnd4j/tests_cpu/run_tests.sh b/libnd4j/tests_cpu/run_tests.sh index 592e643fd..650278752 100755 --- a/libnd4j/tests_cpu/run_tests.sh +++ b/libnd4j/tests_cpu/run_tests.sh @@ -56,7 +56,12 @@ if [ -n "$BUILD_PATH" ]; then export PATH="$PATH:$BUILD_PATH" fi -../blasbuild/${CHIP}/te NdArrayIpcTeststs_cpu/layers_tests/runtests +unameOut="$(uname -s)" +if [[ "$unameOut" == *"MINGW"* ]]; then + ../blasbuild/${CHIP}/tests_cpu/layers_tests/runtests.exe + else + ../blasbuild/${CHIP}/tests_cpu/layers_tests/runtests +fi # Workaround to fix posix path conversion problem on Windows (http://mingw.org/wiki/Posix_path_conversion) [ -f "${GTEST_OUTPUT#*:}" ] && cp -a surefire-reports/ ../target && rm -rf surefire-reports/