Skip to content

Commit 372aa43

Browse files
committed
Add CI workflow for unittest on linux-aarch64 with atomic library fix
1 parent 348c748 commit 372aa43

File tree

1 file changed

+36
-1
lines changed

1 file changed

+36
-1
lines changed

.github/workflows/pull.yml

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,42 @@ jobs:
3434
3535
# Run tests
3636
pytest
37-
37+
38+
unittest-linux-aarch64:
39+
name: unittest-linux-aarch64
40+
uses: pytorch/test-infra/.github/workflows/linux_job_v2.yml@main
41+
strategy:
42+
fail-fast: false
43+
with:
44+
runner: linux.arm64.2xlarge
45+
submodules: 'true'
46+
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
47+
timeout: 90
48+
script: |
49+
set -ex
50+
51+
# On some Linux aarch64 systems, the "atomic" library is not found during linking.
52+
# To work around this, replace "atomic" with the literal ${ATOMIC_LIB} so the
53+
# build system uses the full path to the atomic library.
54+
file="third-party/sentencepiece/src/CMakeLists.txt"
55+
sed 's/list(APPEND SPM_LIBS "atomic")/list(APPEND SPM_LIBS ${ATOMIC_LIB})/' \
56+
"$file" > "${file}.tmp" && mv "${file}.tmp" "$file"
57+
58+
grep -n 'list(APPEND SPM_LIBS ${ATOMIC_LIB})' "$file" && \
59+
echo "the file $file has been modified for atomic to use full path"
60+
61+
62+
cmake -DCMAKE_BUILD_TYPE=Debug test -Bbuild/test
63+
cmake --build build/test -j9 --config Debug
64+
pushd build/test && ctest && popd
65+
66+
# Install tokenizers
67+
pip install . -v
68+
pip install pytest blobfile transformers>=4.53.1
69+
70+
# Run tests
71+
pytest
72+
3873
unittest-windows:
3974
uses: pytorch/test-infra/.github/workflows/windows_job.yml@main
4075
with:

0 commit comments

Comments
 (0)