recover one note #6
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Torch API Tests in Container | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| branches: | |
| - main | |
| jobs: | |
| torch-api-test: | |
| runs-on: [self-hosted, cx-build] | |
| container: | |
| image: localhost:5000/flagscale:cuda12.8.1-cudnn9.7.1-python3.12-torch2.7.0-time2507111538 | |
| options: --gpus all --shm-size=500g --privileged --ipc=host --ulimit memlock=-1 --ulimit stack=67108864 --ulimit nofile=65535:65535 --user root | |
| steps: | |
| - name: Checkout Code | |
| uses: actions/checkout@v6 | |
| 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 Install Dependencies | |
| run: | | |
| export PATH=/root/miniconda3/bin:$PATH | |
| eval "$(/root/miniconda3/bin/conda shell.bash hook)" && conda activate flagscale-train && conda env list | |
| apt update -y && apt-get install -y git rdma-core ibverbs-utils perftest infiniband-diags libibverbs-dev librdmacm-dev clang-format | |
| pip list | grep torch && which python | |
| pip install pre-commit | |
| cd /__w/FlagCX/FlagCX | |
| git config --global --add safe.directory /__w/FlagCX/FlagCX && git status | |
| pre-commit install | |
| - name: Run Code Format Check with pre-commit | |
| run: | | |
| cd /__w/FlagCX/FlagCX | |
| 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" | |
| echo "From reference: $from_ref; To reference: $to_ref" | |
| pre-commit run --from-ref "$from_ref" --to-ref "$to_ref" | |
| fi | |
| continue-on-error: false | |
| - name: Run `make` to build the project | |
| run: | | |
| cd /__w/FlagCX/FlagCX | |
| export MPI_HOME=/usr/local/mpi | |
| make USE_NVIDIA=1 -j$(nproc) | |
| - name: Install FlagCX PyTorch Plugin | |
| run: | | |
| export PATH=/root/miniconda3/bin:$PATH | |
| eval "$(/root/miniconda3/bin/conda shell.bash hook)" && conda activate flagscale-train && conda env list | |
| pip uninstall -y setuptools && pip install setuptools==77.0.1 --extra-index-url https://pypi.org/simple | |
| cd /__w/FlagCX/FlagCX/plugin/torch | |
| python setup.py develop --adaptor nvidia | |
| - name: Run PyTorch API Tests | |
| run: | | |
| export PATH=/root/miniconda3/bin:$PATH | |
| eval "$(/root/miniconda3/bin/conda shell.bash hook)" && conda activate flagscale-train && conda env list | |
| cd /__w/FlagCX/FlagCX/test/script/ | |
| export FLAGCX_DEBUG=TRACE | |
| export FLAGCX_DEBUG_SUBSYS=ALL | |
| bash torch_api_test.sh |