Skip to content

Commit 166ba3a

Browse files
authored
[CICD] Add CI workflow for symmetric memory tests (#472)
1 parent ba930de commit 166ba3a

2 files changed

Lines changed: 84 additions & 0 deletions

File tree

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: "Unit Tests: symmem"
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- main
10+
11+
jobs:
12+
unittest-symmem:
13+
runs-on: [self-hosted, cx-build]
14+
container:
15+
image: localhost:5000/flagscale:cuda12.8.1-cudnn9.7.1-python3.12-torch2.7.0-time2507111538
16+
options: --gpus all --privileged --ipc=host --ulimit memlock=-1 --ulimit stack=67108864
17+
steps:
18+
- name: Checkout Code
19+
uses: actions/checkout@v6
20+
with:
21+
repository: ${{ github.event.pull_request.head.repo.full_name }}
22+
ref: ${{ github.event.pull_request.head.ref }}
23+
ssh-strict: true
24+
ssh-user: git
25+
persist-credentials: true
26+
clean: true
27+
sparse-checkout-cone-mode: true
28+
fetch-tags: false
29+
show-progress: true
30+
lfs: false
31+
submodules: true
32+
set-safe-directory: true
33+
34+
- name: Build Google Test
35+
run: |
36+
cd /__w/FlagCX/FlagCX/third-party/googletest
37+
mkdir -p build
38+
cd build
39+
cmake ..
40+
make -j$(nproc)
41+
42+
- name: Build FlagCX
43+
run: |
44+
cd /__w/FlagCX/FlagCX
45+
export MPI_HOME=/usr/local/mpi
46+
make -j$(nproc) USE_NVIDIA=1
47+
48+
- name: Build symmem tests
49+
run: |
50+
cd /__w/FlagCX/FlagCX/test/unittest/symmem
51+
export MPI_HOME=/usr/local/mpi
52+
make -j$(nproc)
53+
54+
- name: Run symmem tests
55+
run: |
56+
cd /__w/FlagCX/FlagCX
57+
bash test/script/symmem_test.sh

test/script/symmem_test.sh

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#!/bin/bash
2+
set -euo pipefail
3+
4+
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
5+
PROJECT_ROOT="$(cd "$SCRIPT_DIR/../.." && pwd)"
6+
SYMMEM_DIR="$PROJECT_ROOT/test/unittest/symmem"
7+
BUILD_BIN="$SYMMEM_DIR/build/bin"
8+
9+
export MPI_HOME="${MPI_HOME:-/usr/local/mpi}"
10+
export PATH="$MPI_HOME/bin:$PATH"
11+
export LD_LIBRARY_PATH="$PROJECT_ROOT/build/lib:${LD_LIBRARY_PATH:-}"
12+
13+
NP="${NP:-8}"
14+
15+
echo "=== Running symmem unit tests (no MPI/GPU) ==="
16+
"$BUILD_BIN/symmem_unit_tests"
17+
18+
echo ""
19+
echo "=== Running symmem MPI tests (np=$NP) ==="
20+
mpirun -np "$NP" --allow-run-as-root \
21+
-x FLAGCX_USE_HETERO_COMM=1 \
22+
-x FLAGCX_CLUSTER_SPLIT_LIST=2 \
23+
-x FLAGCX_MEM_ENABLE=1 \
24+
"$BUILD_BIN/symmem_mpi_tests"
25+
26+
echo ""
27+
echo "All symmem tests passed."

0 commit comments

Comments
 (0)