1+ name : Torch API Tests in Container
2+
3+ on :
4+ push :
5+ branches :
6+ - main
7+ pull_request :
8+ branches :
9+ - main
10+
11+ jobs :
12+ torch-api-test :
13+ runs-on : self-hosted
14+ container :
15+ image : localhost:5000/flagscale:cuda12.4.1-cudnn9.5.0-python3.12-torch2.6.0-time2505241715
16+ options : --gpus all --privileged --ipc=host --ulimit memlock=-1 --ulimit stack=67108864
17+ steps :
18+ - name : Checkout Code
19+ uses : actions/checkout@v4
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 : false
32+ set-safe-directory : true
33+
34+ - name : Set up Install Dependencies
35+ run : |
36+ /root/miniconda3/bin/conda init bash
37+ source /root/.bashrc
38+ /root/miniconda3/bin/conda activate flagscale-train
39+ apt update -y
40+ apt-get install -y git rdma-core ibverbs-utils perftest infiniband-diags libibverbs-dev librdmacm-dev
41+ cd /__w/FlagCX/FlagCX
42+ git config --global --add safe.directory /__w/FlagCX/FlagCX
43+ git status
44+ pip install setuptools==77.0.1 pre-commit -i https://pypi.tuna.tsinghua.edu.cn/simple
45+ pre-commit install
46+
47+ - name : Run Code Format Check with pre-commit
48+ run : |
49+ cd /__w/FlagCX/FlagCX
50+ apt update -y
51+ apt-get install clang-format -y
52+ git fetch --all
53+ from_ref=${GITHUB_HEAD_REF}
54+ to_ref=${GITHUB_BASE_REF}
55+
56+ echo "From branch: $from_ref, To branch: $to_ref"
57+
58+ pre-commit run --from-ref "origin/$from_ref" --to-ref "origin/$to_ref"
59+ continue-on-error : false
60+
61+ - name : Run `make` to build the project
62+ run : |
63+ cd /__w/FlagCX/FlagCX
64+ export MPI_HOME=/usr/local/mpi
65+ make USE_NVIDIA=1
66+
67+ - name : Enter plugin/torch and install FlagCX PyTorch Plugin
68+ run : |
69+ cd /__w/FlagCX/FlagCX/plugin/torch
70+ python setup.py develop --adaptor nvidia
71+
72+ - name : Run PyTorch API tests
73+ run : |
74+ cd /__w/FlagCX/FlagCX/test/script/
75+ bash torch_api_test.sh
0 commit comments