Skip to content

refactor: use libnvcomp from libkvikio wheel to unblock Python 3.13 upgrade - #18593

Merged
rapids-bot[bot] merged 17 commits into
NVIDIA:branch-25.06from
gforsyth:libkvikio_vendor_nvcomp
May 2, 2025
Merged

refactor: use libnvcomp from libkvikio wheel to unblock Python 3.13 upgrade#18593
rapids-bot[bot] merged 17 commits into
NVIDIA:branch-25.06from
gforsyth:libkvikio_vendor_nvcomp

Conversation

@gforsyth

@gforsyth gforsyth commented Apr 29, 2025

Copy link
Copy Markdown
Contributor

xref rapidsai/kvikio#702
xref rapidsai/build-planning#120
xref rapidsai/build-planning#171

This PR enables us to update cudf to use Python 3.13. We were blocked on upgrading because there are no nvcomp wheels for Python 3.13, but we've now vendored nvcomp into libkvikio, so we should be able to upgrade that way.

I've added a new cmake option so that we look for libnvcomp.so.4 in the right place -- that can be reverted when we switch back to using nvcomp wheels.

@gforsyth
gforsyth requested a review from a team as a code owner April 29, 2025 17:33
@gforsyth gforsyth added the DO NOT MERGE Hold off on merging; see PR for details label Apr 29, 2025
@gforsyth
gforsyth requested a review from a team as a code owner April 29, 2025 17:33
@gforsyth gforsyth added improvement Improvement / enhancement to an existing function non-breaking Non-breaking change labels Apr 29, 2025
@gforsyth
gforsyth requested a review from jameslamb April 29, 2025 17:33
@gforsyth
gforsyth force-pushed the libkvikio_vendor_nvcomp branch from 3949463 to 569295a Compare April 29, 2025 17:33
@github-actions github-actions Bot added the Python Affects Python cuDF API. label Apr 29, 2025

@bdice bdice left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if we will need to update any CMake, wheel library-loading, or wheel library-exclusion code to make this work?

Comment thread ci/build_wheel_libcudf.sh Outdated

set -x
#kvikio_wheel_cpp_libkvikio_cu11_aarch64.tar.gz
LIBKVIKIO_WHL="libkvikio_${RAPIDS_PY_CUDA_SUFFIX}-25.6.0a32-py3-none-${AUDITWHEEL_PLAT}.whl"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you can follow the instructions in rapidsai/docs#593 for a more concise solution.

Maybe something like:

# ci/use_wheels_from_prs.sh
RAPIDS_PY_CUDA_SUFFIX=$(rapids-wheel-ctk-name-gen "${RAPIDS_CUDA_VERSION}")

# download wheels, store the directories holding them in variables
LIBKVIKIO_WHEELHOUSE=$(
  RAPIDS_PY_WHEEL_NAME="libkvikio_${RAPIDS_PY_CUDA_SUFFIX}" rapids-get-pr-wheel-artifact-github kvikio 702 cpp
)
KVIKIO_WHEELHOUSE=$(
  RAPIDS_PY_WHEEL_NAME="kvikio_${RAPIDS_PY_CUDA_SUFFIX}" rapids-get-pr-wheel-artifact-github kvikio 702 python
)

# write a pip constraints file saying e.g. "whenever you encounter a requirement for 'librmm-cu12', use this wheel"
cat > /tmp/constraints.txt <<EOF
libkvikio-${RAPIDS_PY_CUDA_SUFFIX} @ file://$(echo ${LIBKVIKIO_WHEELHOUSE}/libkvikio_*.whl)
kvikio-${RAPIDS_PY_CUDA_SUFFIX} @ file://$(echo ${KVIKIO_WHEELHOUSE}/kvikio_*.whl)
EOF
export PIP_CONSTRAINT=/tmp/constraints.txt

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't seem to work unless I specify the GITHUB_RUN_ID, at which point I'm doing roughly the same amount of work

@gforsyth

Copy link
Copy Markdown
Contributor Author

update any CMake, wheel library-loading, or wheel library-exclusion code

Yeah, I'm not sure. The nvcomp symbols should get loaded when libkvikio is imported

@gforsyth
gforsyth requested a review from a team as a code owner April 30, 2025 15:13
@github-actions github-actions Bot added the CMake CMake build issue label Apr 30, 2025
@gforsyth
gforsyth force-pushed the libkvikio_vendor_nvcomp branch from 1366447 to 6e75249 Compare April 30, 2025 15:17
@gforsyth

gforsyth commented May 1, 2025

Copy link
Copy Markdown
Contributor Author

@bdice -- I think this looks good as confirmation of the upstream vendoring of libnvcomp in libkvikio -- care to take a quick pass to confirm?

@gforsyth gforsyth changed the title [DO NOT MERGE]: test upstream libkvikio wheel with vendored nvcomp refactor: use libnvcomp from libkvikio wheel to unblock Python 3.13 upgrade May 2, 2025
@gforsyth gforsyth removed the DO NOT MERGE Hold off on merging; see PR for details label May 2, 2025

@jameslamb jameslamb left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me! Just left one small comment, it's not even a suggestion... I'd be comfortable merging this as-is.


# TODO(nvcomp): when `nvcomp` supports Python 3.13 and we de-vendor `nvcomp` from `kvikio` this
# block should be removed
if(USE_NVCOMP_FROM_LIBKVIKIO_WHEEL)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just putting this in writing to make it explicit... I think it's ok to allow USE_NVCOMP_RUNTIME_WHEEL and and USE_NVCOMP_FROM_LIBVIKIO_WHEEL to both be ON, as you've done here.

Having both RPATHs set on libcudf.so, even if accidentally, shouldn't be a problem. But just calling out that possibility, to give you an opportunity to say "oh yeah, I hadn't thought of that... ok no that's bad, let's make them mutually exclusive".

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a good callout -- I do think that it's ok if they're both set. It should be a temporary addition, in any case.

@gforsyth

gforsyth commented May 2, 2025

Copy link
Copy Markdown
Contributor Author

/merge

@rapids-bot
rapids-bot Bot merged commit 7da384a into NVIDIA:branch-25.06 May 2, 2025
@gforsyth
gforsyth deleted the libkvikio_vendor_nvcomp branch May 2, 2025 19:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CMake CMake build issue improvement Improvement / enhancement to an existing function non-breaking Non-breaking change Python Affects Python cuDF API.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants