-
Notifications
You must be signed in to change notification settings - Fork 128
CI: GHA workflow & build optimizations #1281
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
ikryukov
wants to merge
1
commit into
openucx:master
Choose a base branch
from
ikryukov:gha_optimizations
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+362
−140
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,13 +1,16 @@ | ||
| #!/bin/bash -eEx | ||
| set -o pipefail | ||
|
|
||
| SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd -P)" | ||
| . "${SCRIPT_DIR}/common.sh" | ||
|
|
||
| echo "INFO: Build UCX" | ||
| cd "${SRC_DIR}/ucx" | ||
| "${SRC_DIR}/ucx/autogen.sh" | ||
| mkdir -p "${SRC_DIR}/ucx/build-${UCX_BUILD_TYPE}" | ||
| cd "${SRC_DIR}/ucx/build-${UCX_BUILD_TYPE}" | ||
| "${SRC_DIR}/ucx/contrib/configure-release-mt" --with-cuda="${CUDA_HOME}" --prefix="${UCX_INSTALL_DIR}" | ||
| make -j install | ||
| make "-j${NPROC}" install | ||
| echo "${UCX_INSTALL_DIR}/lib" > /etc/ld.so.conf.d/ucx.conf | ||
| ldconfig | ||
| ldconfig -p | grep -i ucx |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,22 +1,19 @@ | ||
| # In containers, calculate based on memory limits to avoid OOM | ||
| # Determine number of parallel build jobs based on available system memory if running inside a container/Kubernetes | ||
| # Determine number of parallel build jobs based on available system memory. | ||
| # In containers/Kubernetes, use cgroup memory limits to avoid OOM. | ||
| if [ -f /.dockerenv ] || [ -f /run/.containerenv ] || [ -n "${KUBERNETES_SERVICE_HOST}" ]; then | ||
| # Prefer cgroupv1 path, fall back to cgroupv2 or static default if not found | ||
| if [ -f /sys/fs/cgroup/memory/memory.limit_in_bytes ]; then | ||
| limit=$(cat /sys/fs/cgroup/memory/memory.limit_in_bytes) | ||
| elif [ -f /sys/fs/cgroup/memory.max ]; then | ||
| limit=$(cat /sys/fs/cgroup/memory.max) | ||
| # If cgroupv2 limit is "max", meaning unlimited, set to 4GB to avoid OOM | ||
| [ "$limit" = "max" ] && limit=$((4 * 1024 * 1024 * 1024)) | ||
| else | ||
| # Default to 4GB if no limit is found | ||
| limit=$((4 * 1024 * 1024 * 1024)) | ||
| fi | ||
|
|
||
| # Use 1 build process per GB of memory, clamp in [1,16] | ||
| nproc=$((limit / (1024 * 1024 * 1024))) | ||
| [ "$nproc" -gt 16 ] && nproc=16 | ||
| [ "$nproc" -lt 1 ] && nproc=1 | ||
| export NPROC=$nproc | ||
| NPROC=$((limit / (1024 * 1024 * 1024))) | ||
| [ "$NPROC" -gt 16 ] && NPROC=16 | ||
| [ "$NPROC" -lt 1 ] && NPROC=1 | ||
| else | ||
| NPROC=$(nproc --all) | ||
| fi | ||
| export NPROC | ||
|
|
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| name: Restore artifact permissions | ||
| description: > | ||
| Download-artifact strips execute bits. This action restores them for the | ||
| standard UCC/UCX/OMPI install trees used across CI jobs. | ||
| inputs: | ||
| ucx: | ||
| description: Restore UCX install permissions | ||
| default: 'true' | ||
| ucc: | ||
| description: Restore UCC install permissions | ||
| default: 'true' | ||
| ompi: | ||
| description: Restore OMPI install permissions | ||
| default: 'false' | ||
| runs: | ||
| using: composite | ||
| steps: | ||
| - shell: bash | ||
| run: | | ||
| if [ "${{ inputs.ucx }}" = "true" ]; then | ||
| chmod -R +x /tmp/ucx/install/bin /tmp/ucx/install/lib 2>/dev/null || true | ||
| fi | ||
| if [ "${{ inputs.ucc }}" = "true" ]; then | ||
| chmod -R +x /tmp/ucc/install/bin /tmp/ucc/install/lib 2>/dev/null || true | ||
| fi | ||
| if [ "${{ inputs.ompi }}" = "true" ]; then | ||
| chmod -R +x /tmp/ompi/install/bin /tmp/ompi/install/lib 2>/dev/null || true | ||
| fi |
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,23 +1,24 @@ | ||
| name: Linter-NVIDIA | ||
| name: Lint (CUDA) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. previous name was correct, because we were checking not only CUDA builds but also Nvidia networking |
||
|
|
||
| on: [push, pull_request] | ||
|
|
||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | ||
| 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.22.1rc4/hpcx-v2.22.1-gcc-doca_ofed-ubuntu22.04-cuda12-x86_64.tbz | ||
| 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-2.1.8.0 | ||
| CUDA_VER: 12-8 | ||
| 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-22.04 | ||
| runs-on: ubuntu-24.04 | ||
| name: clang-tidy (CUDA) | ||
| steps: | ||
| - name: Install dependencies | ||
| run: | | ||
|
|
@@ -26,35 +27,60 @@ jobs: | |
| # 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/jammy/ llvm-toolchain-jammy-${CLANG_VER} main" | sudo tee /etc/apt/sources.list.d/llvm.list | ||
| 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: | | ||
| wget --no-verbose http://content.mellanox.com/ofed/MLNX_OFED-${MLNX_OFED_VER}/MLNX_OFED_LINUX-${MLNX_OFED_VER}-ubuntu22.04-x86_64.tgz | ||
| sudo tar -xvzf MLNX_OFED_LINUX-${MLNX_OFED_VER}-ubuntu22.04-x86_64.tgz | ||
| sudo chmod -R a+rwx MLNX_OFED_LINUX-${MLNX_OFED_VER}-ubuntu22.04-x86_64 | ||
| sudo MLNX_OFED_LINUX-${MLNX_OFED_VER}-ubuntu22.04-x86_64/mlnxofedinstall --skip-unsupported-devices-check --user-space-only --without-fw-update --force --basic -vvv | ||
| 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/ubuntu2204/x86_64/cuda-keyring_1.1-1_all.deb | ||
| 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: Cache UCX | ||
| id: cache-ucx | ||
| uses: actions/cache@v4 | ||
| with: | ||
| path: /tmp/ucx/install | ||
| key: ucx-nvidia-${{ env.OPEN_UCX_BRANCH }}-${{ hashFiles('.github/workflows/clang-tidy-nvidia.yaml') }} | ||
| - name: Get UCX | ||
| run: git clone ${OPEN_UCX_LINK} -b ${OPEN_UCX_BRANCH} /tmp/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.22.1-gcc-doca_ofed-ubuntu22.04-cuda12-x86_64.tbz | ||
| mv hpcx-v2.22.1-gcc-doca_ofed-ubuntu22.04-cuda12-x86_64 hpcx | ||
| - uses: actions/checkout@v4 | ||
| 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 | ||
|
|
||
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
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these options were added by @MamziB to get better backtrace report from asan