Skip to content

Commit c2001b2

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

File tree

1 file changed

+37
-1
lines changed

1 file changed

+37
-1
lines changed

.github/workflows/pull.yml

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,43 @@ 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+
dnf -y install libatomic
51+
52+
# On some Linux aarch64 systems, the "atomic" library is not found during linking.
53+
# To work around this, replace "atomic" with the literal ${ATOMIC_LIB} so the
54+
# build system uses the full path to the atomic library.
55+
file="third-party/sentencepiece/src/CMakeLists.txt"
56+
sed 's/list(APPEND SPM_LIBS "atomic")/list(APPEND SPM_LIBS ${ATOMIC_LIB})/' \
57+
"$file" > "${file}.tmp" && mv "${file}.tmp" "$file"
58+
59+
grep -n 'list(APPEND SPM_LIBS ${ATOMIC_LIB})' "$file" && \
60+
echo "the file $file has been modified for atomic to use full path"
61+
62+
63+
cmake -DCMAKE_BUILD_TYPE=Debug test -Bbuild/test
64+
cmake --build build/test -j9 --config Debug
65+
pushd build/test && ctest && popd
66+
67+
# Install tokenizers
68+
pip install . -v
69+
pip install pytest blobfile transformers>=4.53.1
70+
71+
# Run tests
72+
pytest
73+
3874
unittest-windows:
3975
uses: pytorch/test-infra/.github/workflows/windows_job.yml@main
4076
with:

0 commit comments

Comments
 (0)