diff --git a/.github/workflows/pull.yml b/.github/workflows/pull.yml index dee3f7e..a32913b 100644 --- a/.github/workflows/pull.yml +++ b/.github/workflows/pull.yml @@ -34,7 +34,42 @@ jobs: # Run tests pytest - + + unittest-linux-aarch64: + name: unittest-linux-aarch64 + uses: pytorch/test-infra/.github/workflows/linux_job_v2.yml@main + strategy: + fail-fast: false + with: + runner: linux.arm64.2xlarge + submodules: 'true' + ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }} + timeout: 90 + script: | + set -ex + + # On some Linux aarch64 systems, the "atomic" library is not found during linking. + # To work around this, replace "atomic" with the literal ${ATOMIC_LIB} so the + # build system uses the full path to the atomic library. + file="third-party/sentencepiece/src/CMakeLists.txt" + sed 's/list(APPEND SPM_LIBS "atomic")/list(APPEND SPM_LIBS ${ATOMIC_LIB})/' \ + "$file" > "${file}.tmp" && mv "${file}.tmp" "$file" + + grep -n 'list(APPEND SPM_LIBS ${ATOMIC_LIB})' "$file" && \ + echo "the file $file has been modified for atomic to use full path" + + + cmake -DCMAKE_BUILD_TYPE=Debug test -Bbuild/test + cmake --build build/test -j9 --config Debug + pushd build/test && ctest && popd + + # Install tokenizers + pip install . -v + pip install pytest blobfile transformers>=4.53.1 + + # Run tests + pytest + unittest-windows: uses: pytorch/test-infra/.github/workflows/windows_job.yml@main with: