Skip to content

[CICD] Configure Gemini #806

[CICD] Configure Gemini

[CICD] Configure Gemini #806

Workflow file for this run

name: Unit Tests in Container
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
unit-test:
runs-on: self-hosted
container:
image: localhost:5000/flagscale:cuda12.4.1-cudnn9.5.0-python3.12-torch2.6.0-time2505241715
options: --gpus all --privileged --ipc=host --ulimit memlock=-1 --ulimit stack=67108864
steps:
- name: Checkout Code
uses: actions/checkout@v4
with:
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.event.pull_request.head.ref }}
ssh-strict: true
ssh-user: git
persist-credentials: true
clean: true
sparse-checkout-cone-mode: true
fetch-tags: false
show-progress: true
lfs: false
submodules: true
set-safe-directory: true
- name: Set up Python and Install Dependencies
run: |
apt update -y
apt-get install -y python3 python3-pip python3-venv git rdma-core ibverbs-utils perftest infiniband-diags libibverbs-dev librdmacm-dev
python3 -m venv venv
cd /__w/FlagCX/FlagCX
. venv/bin/activate
git config --global --add safe.directory /__w/FlagCX/FlagCX
git status
pip install setuptools pre-commit -i https://pypi.tuna.tsinghua.edu.cn/simple
pre-commit install
- name: Run Code Format Check with pre-commit
run: |
cd /__w/FlagCX/FlagCX
. venv/bin/activate
apt update -y
apt-get install clang-format -y
git fetch --all
if [ -n "$GITHUB_HEAD_REF" ] && [ -n "$GITHUB_BASE_REF" ]; then
from_ref="origin/$GITHUB_HEAD_REF"
to_ref="origin/$GITHUB_BASE_REF"
else
from_ref="HEAD^"
to_ref="HEAD"
fi
echo "From reference: $from_ref; To reference: $to_ref"
pre-commit run --from-ref "$from_ref" --to-ref "$to_ref"
continue-on-error: false
- name: Build Google Test
run: |
cd /__w/FlagCX/FlagCX/third-party/googletest
mkdir -p build
cd build
cmake ..
make
- name: Run `make` to build the project
run: |
cd /__w/FlagCX/FlagCX
export MPI_HOME=/usr/local/mpi
make USE_NVIDIA=1
- name: Enter test/unittest and run `make` for unit tests
run: |
cd /__w/FlagCX/FlagCX/test/unittest
export MPI_HOME=/usr/local/mpi
make
- name: Run unit tests with mpirun
run: |
cd /__w/FlagCX/FlagCX/test/unittest
mpirun -np 8 --allow-run-as-root ./build/bin/main
- name: Run clusters tests with mpirun
run: |
cd /__w/FlagCX/FlagCX/test/unittest
mpirun -np 8 --allow-run-as-root -x FLAGCX_CLUSTER_SPLIT_LIST=2 -x FLAGCX_IB_HCA=mlx5 ./build/bin/main