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.8.1-cudnn9.7.1-python3.12-torch2.7.0-time2507111538
16+ # localhost:5000/flagscale:cuda12.4.1-cudnn9.5.0-python3.12-torch2.6.0-time2505241715
17+ options : --gpus all --shm-size=500g --privileged --ipc=host --ulimit memlock=-1 --ulimit stack=67108864 --ulimit nofile=65535:65535 --user root
18+ steps :
19+ - name : Checkout Code
20+ uses : actions/checkout@v4
21+ with :
22+ repository : ${{ github.event.pull_request.head.repo.full_name }}
23+ ref : ${{ github.event.pull_request.head.ref }}
24+ ssh-strict : true
25+ ssh-user : git
26+ persist-credentials : true
27+ clean : true
28+ sparse-checkout-cone-mode : true
29+ fetch-tags : false
30+ show-progress : true
31+ lfs : false
32+ submodules : false
33+ set-safe-directory : true
34+
35+ - name : Set up Install Dependencies
36+ run : |
37+ export PATH=/root/miniconda3/bin:$PATH
38+ eval "$(/root/miniconda3/bin/conda shell.bash hook)" && conda activate flagscale-train && conda env list
39+ apt update -y && apt-get install -y git rdma-core ibverbs-utils perftest infiniband-diags libibverbs-dev librdmacm-dev clang-format
40+ pip list | grep torch && which python
41+ pip install pre-commit -i https://pypi.tuna.tsinghua.edu.cn/simple
42+ cd /__w/FlagCX/FlagCX
43+ git config --global --add safe.directory /__w/FlagCX/FlagCX && git status
44+ pre-commit install
45+
46+ - name : Run Code Format Check with pre-commit
47+ run : |
48+ cd /__w/FlagCX/FlagCX
49+ git fetch --all
50+ from_ref=${GITHUB_HEAD_REF}
51+ to_ref=${GITHUB_BASE_REF}
52+
53+ echo "From branch: $from_ref, To branch: $to_ref"
54+
55+ pre-commit run --from-ref "origin/$from_ref" --to-ref "origin/$to_ref"
56+ continue-on-error : false
57+
58+ - name : Run `make` to build the project
59+ run : |
60+ cd /__w/FlagCX/FlagCX
61+ export MPI_HOME=/usr/local/mpi
62+ make USE_NVIDIA=1 -j$(nproc)
63+
64+ - name : Enter plugin/torch and install FlagCX PyTorch Plugin
65+ run : |
66+ export PATH=/root/miniconda3/bin:$PATH
67+ eval "$(/root/miniconda3/bin/conda shell.bash hook)" && conda activate flagscale-train && conda env list
68+ pip uninstall -y setuptools && pip install setuptools==77.0.1 -i https://pypi.tuna.tsinghua.edu.cn/simple
69+ cd /__w/FlagCX/FlagCX/plugin/torch
70+ python setup.py develop --adaptor nvidia
71+
72+ - name : Run PyTorch API tests
73+ run : |
74+ export PATH=/root/miniconda3/bin:$PATH
75+ eval "$(/root/miniconda3/bin/conda shell.bash hook)" && conda activate flagscale-train && conda env list
76+ cd /__w/FlagCX/FlagCX/test/script/
77+ bash torch_api_test.sh
0 commit comments