Skip to content

TL/UCP: select exact allgather radix schedules #4137

TL/UCP: select exact allgather radix schedules

TL/UCP: select exact allgather radix schedules #4137

name: Linter-NVIDIA
on: [push, pull_request]
concurrency:
group: lint-cuda-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
env:
OPEN_UCX_LINK: https://github.com/openucx/ucx
OPEN_UCX_BRANCH: master
HPCX_LINK: https://content.mellanox.com/hpc/hpc-x/v2.25.1_cuda13/hpcx-v2.25.1-gcc-doca_ofed-ubuntu24.04-cuda13-x86_64.tbz
CLANG_VER: 17
MLNX_OFED_VER: 24.10-4.1.4.0
CUDA_VER: 13-1
LIBRARY_PATH: /tmp/ucx/install/lib
LD_LIBRARY_PATH: /tmp/ucx/install/lib
jobs:
clang-tidy:
runs-on: ubuntu-24.04
name: clang-tidy (CUDA)
steps:
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends wget gpg
# Setup LLVM repository
sudo mkdir -p /etc/apt/keyrings
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo gpg --dearmor -o /etc/apt/keyrings/llvm.gpg
echo "deb [signed-by=/etc/apt/keyrings/llvm.gpg] http://apt.llvm.org/noble/ llvm-toolchain-noble-${CLANG_VER} main" | sudo tee /etc/apt/sources.list.d/llvm.list
sudo apt-get update
sudo apt-get install -y --no-install-recommends clang-tidy-${CLANG_VER} bear clang-${CLANG_VER} clang++-${CLANG_VER}
- name: Cache MLNX_OFED tarball
id: cache-ofed
uses: actions/cache@v4
with:
path: MLNX_OFED_LINUX-${{ env.MLNX_OFED_VER }}-ubuntu24.04-x86_64.tgz
key: mlnx-ofed-${{ env.MLNX_OFED_VER }}-ubuntu24.04
- name: Download MLNX_OFED
if: steps.cache-ofed.outputs.cache-hit != 'true'
run: wget --no-verbose http://content.mellanox.com/ofed/MLNX_OFED-${MLNX_OFED_VER}/MLNX_OFED_LINUX-${MLNX_OFED_VER}-ubuntu24.04-x86_64.tgz
- name: Install extra rdma dependencies
run: |
sudo tar -xzf MLNX_OFED_LINUX-${MLNX_OFED_VER}-ubuntu24.04-x86_64.tgz
sudo chmod -R a+rwx MLNX_OFED_LINUX-${MLNX_OFED_VER}-ubuntu24.04-x86_64
sudo MLNX_OFED_LINUX-${MLNX_OFED_VER}-ubuntu24.04-x86_64/mlnxofedinstall --skip-unsupported-devices-check --user-space-only --without-fw-update --force --basic -v
- name: Install extra cuda dependencies
run: |
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2404/x86_64/cuda-keyring_1.1-1_all.deb
sudo dpkg -i cuda-keyring_1.1-1_all.deb
sudo apt-get update
sudo apt-get install -y --no-install-recommends cuda-cudart-dev-${CUDA_VER} cuda-nvcc-${CUDA_VER} cuda-nvml-dev-${CUDA_VER}
- name: Resolve UCX HEAD commit
id: ucx-sha
run: echo "sha=$(git ls-remote ${OPEN_UCX_LINK} refs/heads/${OPEN_UCX_BRANCH} | cut -f1)" >> $GITHUB_OUTPUT
- name: Cache UCX
id: cache-ucx
uses: actions/cache@v4
with:
path: /tmp/ucx/install
key: ucx-nvidia-${{ steps.ucx-sha.outputs.sha }}-${{ hashFiles('.github/workflows/clang-tidy-nvidia.yaml') }}
- name: Get UCX
if: steps.cache-ucx.outputs.cache-hit != 'true'
run: |
rm -rf /tmp/ucx
git clone --depth 1 ${OPEN_UCX_LINK} -b ${OPEN_UCX_BRANCH} /tmp/ucx
- name: Build UCX
if: steps.cache-ucx.outputs.cache-hit != 'true'
run: |
cd /tmp/ucx && ./autogen.sh
CC=clang-${CLANG_VER} CXX=clang++-${CLANG_VER} ./contrib/configure-release --without-java --without-go --disable-numa --prefix $PWD/install
make -j install
- name: Cache HPCX
id: cache-hpcx
uses: actions/cache@v4
with:
path: /tmp/hpcx
key: hpcx-v2.25.1-${{ hashFiles('.github/workflows/clang-tidy-nvidia.yaml') }}
- name: Download HPCX
if: steps.cache-hpcx.outputs.cache-hit != 'true'
run: |
cd /tmp
wget --no-verbose ${HPCX_LINK}
tar xjf hpcx-v2.25.1-gcc-doca_ofed-ubuntu24.04-cuda13-x86_64.tbz
mv hpcx-v2.25.1-gcc-doca_ofed-ubuntu24.04-cuda13-x86_64 hpcx
- uses: actions/checkout@v6
- name: Build UCC
run: |
./autogen.sh
CC=clang-${CLANG_VER} CXX=clang++-${CLANG_VER} ./configure --with-tls=ucp,mlx5,cuda,self,sharp --with-sharp=/tmp/hpcx/sharp --prefix=/tmp/ucc/install --with-ucx=/tmp/ucx/install --with-cuda=/usr/local/cuda --with-nvcc-gencode="-gencode=arch=compute_80,code=sm_80" --enable-assert
bear --output /tmp/compile_commands.json -- make -j
- name: Run clang-tidy
run: |
echo "Workspace: ${GITHUB_WORKSPACE}"
cd ${GITHUB_WORKSPACE}
run-clang-tidy-${CLANG_VER} -p /tmp/ -header-filter='^(?!.*(${GITHUB_WORKSPACE}/src/components/ec/cuda/kernel/.*|${GITHUB_WORKSPACE}/src/components/mc/cuda/kernel/.*)).*$' "^(?!.*\.cu$).*$" 2>&1 | tee /tmp/clang_tidy.log
nerrors=$(grep 'error:' /tmp/clang_tidy.log | wc -l)
if [ $nerrors -ne 0 ]; then
exit 125;
fi