Skip to content

Commit 044ef54

Browse files
authored
libucx-cu12: Add version 1.21.0 (#2954)
1 parent ed572c3 commit 044ef54

3 files changed

Lines changed: 238 additions & 0 deletions

File tree

Lines changed: 174 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,174 @@
1+
# SPDX-FileCopyrightText: 2026 The RISE Project
2+
# SPDX-License-Identifier: MIT
3+
---
4+
# Based on upstream's own wheel build:
5+
# https://github.com/rapidsai/ucx-wheels/blob/eb5c51bc99469b337766454e3df7bc1506f9fa23/.github/workflows/build_and_test.yaml
6+
# https://github.com/rapidsai/ucx-wheels/blob/eb5c51bc99469b337766454e3df7bc1506f9fa23/ci/build_wheel.sh
7+
# https://github.com/rapidsai/ucx-wheels/blob/eb5c51bc99469b337766454e3df7bc1506f9fa23/ci/test_wheel.sh
8+
name: Build libucx-cu12 wheels (riscv64)
9+
10+
on:
11+
workflow_dispatch:
12+
inputs:
13+
version:
14+
description: 'Version glob to (re)build; empty builds every version of docs/packages/libucx-cu12.yaml not released yet'
15+
required: false
16+
default: ''
17+
pull_request:
18+
branches: [main]
19+
paths:
20+
- '.github/workflows/build-libucx-cu12.yml'
21+
- 'docs/packages/libucx-cu12.yaml'
22+
push:
23+
branches: [main]
24+
paths:
25+
- '.github/workflows/build-libucx-cu12.yml'
26+
- 'docs/packages/libucx-cu12.yaml'
27+
28+
concurrency:
29+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
30+
cancel-in-progress: true
31+
32+
permissions:
33+
contents: read # to fetch code (actions/checkout)
34+
35+
env:
36+
# rapidsai/ucx-wheels pushes no tags; this is "Release 1.21.0 (#45)", the
37+
# libucx/GIT_COMMIT recorded in the 1.21.0 PyPI wheels. Update alongside LIBUCX_CU12_VERSION.
38+
LIBUCX_CU12_REF: eb5c51bc99469b337766454e3df7bc1506f9fa23
39+
MANYLINUX_RISCV64_IMAGE: quay.io/pypa/manylinux_2_39_riscv64
40+
41+
jobs:
42+
setup:
43+
uses: $/.github/workflows/_setup.yml
44+
with:
45+
package: libucx-cu12
46+
version: ${{ inputs.version }}
47+
48+
build_wheels:
49+
needs: [setup]
50+
if: needs.setup.outputs.versions != '[]'
51+
name: Build libucx-cu12 ${{ matrix.version }} py3-none-manylinux_riscv64
52+
runs-on: ubuntu-24.04-riscv
53+
timeout-minutes: 240
54+
strategy:
55+
fail-fast: false
56+
matrix:
57+
version: ${{ fromJSON(needs.setup.outputs.versions) }}
58+
59+
env:
60+
LIBUCX_CU12_VERSION: ${{ matrix.version }}
61+
62+
steps:
63+
- name: Checkout rapidsai/ucx-wheels ${{ env.LIBUCX_CU12_VERSION }}
64+
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
65+
with:
66+
repository: rapidsai/ucx-wheels
67+
ref: ${{ env.LIBUCX_CU12_REF }}
68+
persist-credentials: false
69+
70+
- name: Checkout python-wheels
71+
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
72+
with:
73+
path: python-wheels
74+
persist-credentials: false
75+
76+
- name: Patch ucx-wheels source
77+
run: |
78+
git apply python-wheels/patches/libucx-cu12/${{ env.LIBUCX_CU12_VERSION }}/*.patch
79+
80+
# The wheel ships UCX's libraries but upstream only includes the packaging repo's LICENSE.
81+
- name: Stage UCX licence
82+
run: |
83+
curl -fsSL --retry 5 "https://raw.githubusercontent.com/openucx/ucx/v${LIBUCX_CU12_VERSION}/LICENSE" -o python/libucx/LICENSE.ucx
84+
85+
- name: Pull manylinux_riscv64 image
86+
run: docker pull "${MANYLINUX_RISCV64_IMAGE}"
87+
88+
- name: Build and repair the wheel
89+
run: |
90+
docker run --rm -v "$(pwd):/work" -w /work -e PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ "${MANYLINUX_RISCV64_IMAGE}" bash -c '
91+
set -euxo pipefail
92+
dnf install -y --enablerepo=crb autoconf automake libtool
93+
git config --global --add safe.directory /work
94+
export PATH=/opt/python/cp314-cp314/bin:$PATH
95+
96+
python -m pip wheel python/libucx/ -w python/libucx/dist -v --no-deps --disable-pip-version-check
97+
98+
auditwheel repair \
99+
-w wheelhouse \
100+
--exclude "libucm.so.0" \
101+
--exclude "libuct.so.0" \
102+
--exclude "libucs.so.0" \
103+
--exclude "libucp.so.0" \
104+
python/libucx/dist/*
105+
'
106+
107+
- name: Test the wheel
108+
run: |
109+
docker run --rm -v "$(pwd):/work" -w /tmp "${MANYLINUX_RISCV64_IMAGE}" bash -c '
110+
set -euxo pipefail
111+
for pydir in cp312-cp312 cp313-cp313 cp314-cp314 cp314-cp314t; do
112+
pybin=/opt/python/$pydir/bin
113+
"$pybin/pip" install -q /work/wheelhouse/*.whl
114+
"$pybin/python" -c "import libucx; assert all(libucx.load_library()); print(\"Loaded libucx libraries successfully!\")"
115+
done
116+
ucx_bin=$("$pybin/python" -c "import libucx, os; print(os.path.join(os.path.dirname(libucx.__file__), \"bin\"))")
117+
"$ucx_bin/ucx_info" -v
118+
"$ucx_bin/ucx_info" -d
119+
'
120+
121+
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
122+
with:
123+
name: libucx-cu12-${{ env.LIBUCX_CU12_VERSION }}-py3-none-manylinux_riscv64
124+
path: wheelhouse/*.whl
125+
if-no-files-found: error
126+
127+
gpl_sources:
128+
needs: [setup]
129+
if: needs.setup.outputs.versions != '[]'
130+
name: Collect GPL sources for libucx-cu12 ${{ matrix.version }}
131+
runs-on: ubuntu-24.04-riscv
132+
strategy:
133+
fail-fast: false
134+
matrix:
135+
version: ${{ fromJSON(needs.setup.outputs.versions) }}
136+
137+
env:
138+
LIBUCX_CU12_VERSION: ${{ matrix.version }}
139+
140+
steps:
141+
- name: Checkout python-wheels
142+
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
143+
with:
144+
persist-credentials: false
145+
146+
- uses: ./actions/collect-gpl-sources
147+
with:
148+
image: ${{ env.MANYLINUX_RISCV64_IMAGE }}
149+
output: gpl-sources.tar
150+
151+
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
152+
with:
153+
name: libucx-cu12-${{ env.LIBUCX_CU12_VERSION }}-gpl-sources
154+
path: gpl-sources.tar
155+
if-no-files-found: error
156+
157+
publish:
158+
name: Publish libucx-cu12 ${{ matrix.version }}
159+
needs: [setup, build_wheels, gpl_sources]
160+
if: needs.setup.outputs.versions != '[]'
161+
strategy:
162+
fail-fast: false
163+
matrix:
164+
version: ${{ fromJSON(needs.setup.outputs.versions) }}
165+
permissions:
166+
contents: write
167+
pull-requests: write
168+
uses: $/.github/workflows/_publish-wheel.yml
169+
secrets:
170+
app-private-key: ${{ secrets.RISEPROJECT_APP_PRIVATE_KEY }}
171+
with:
172+
artifact-pattern: libucx-cu12-${{ matrix.version }}-*-manylinux_riscv64
173+
gpl-sources-artifact: libucx-cu12-${{ matrix.version }}-gpl-sources
174+
gpl-sources-description: gcc

‎docs/packages/libucx-cu12.yaml‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
package-name: libucx-cu12
2+
source-code: https://github.com/rapidsai/ucx-wheels
3+
license: BSD-3-Clause
4+
versions:
5+
- version: 1.21.0
6+
patched: true
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
2+
From: Ludovic Henry <git@ludovic.dev>
3+
Date: Tue, 13 Oct 2026 00:00:00 +0000
4+
Subject: [PATCH] Build UCX without CUDA as libucx-cu12
5+
6+
NVIDIA ships no CUDA toolkit for riscv64, so `--with-cuda=/usr/local/cuda`
7+
makes UCX's configure fail ("CUDA support is requested but cuda packages
8+
cannot be found") and rapids-build-backend aborts before that because it
9+
derives the `-cu12` name suffix from `nvcc --version`.
10+
11+
CUDA is optional in UCX: it only adds the dlopen()ed libuct_cuda,
12+
libucm_cuda and libucx_perftest_cuda modules, while libucs/libucm/libuct/
13+
libucp link no CUDA library. Configure `--without-cuda`, disable
14+
rapids-build-backend's CUDA detection, and keep the distribution name
15+
consumers depend on (libucxx-cu12 requires libucx-cu12).
16+
17+
Upstream-Status: Inappropriate [riscv64 has no CUDA toolkit; upstream's wheels are CUDA builds by design]
18+
---
19+
python/libucx/pyproject.toml | 3 ++-
20+
python/libucx/setup.py | 2 +-
21+
2 files changed, 3 insertions(+), 2 deletions(-)
22+
diff --git a/python/libucx/pyproject.toml b/python/libucx/pyproject.toml
23+
index a55467c..3c4972e 100644
24+
--- a/python/libucx/pyproject.toml
25+
+++ b/python/libucx/pyproject.toml
26+
@@ -8,7 +8,7 @@ requires = [
27+
]
28+
29+
[project]
30+
-name = "libucx"
31+
+name = "libucx-cu12"
32+
dynamic = ["version"]
33+
description = "The Unified Communication X library (UCX)"
34+
readme = { file = "README.md", content-type = "text/markdown" }
35+
@@ -47,6 +47,7 @@ commit-files = [
36+
"libucx/GIT_COMMIT"
37+
]
38+
dependencies-file = ""
39+
+disable-cuda = true
40+
requires = [
41+
"packaging",
42+
"wheel",
43+
diff --git a/python/libucx/setup.py b/python/libucx/setup.py
44+
index 6ac7a0d..569cfed 100644
45+
--- a/python/libucx/setup.py
46+
+++ b/python/libucx/setup.py
47+
@@ -60,7 +60,7 @@ class build_py(build_orig):
48+
"--with-sysroot",
49+
"--without-verbs",
50+
"--without-rdmacm",
51+
- "--with-cuda=/usr/local/cuda",
52+
+ "--without-cuda",
53+
],
54+
check=True,
55+
)
56+
--
57+
2.43.0
58+

0 commit comments

Comments
 (0)