Skip to content
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

introduce libcuml wheels #6199

Merged
merged 77 commits into from
Jan 24, 2025
Merged

Conversation

jameslamb
Copy link
Member

@jameslamb jameslamb commented Dec 30, 2024

Replaces #6006, contributes to rapidsai/build-planning#33.

Proposes packaging libcuml as a wheel, which is then re-used by cuml-cu{11,12} wheels.

Notes for Reviewers

Benefits of these changes

Wheel contents

libcuml:

  • libcuml++.so (shared library) and its headers
  • libcumlprims_mg.so (shared library) and its headers
  • other vendored dependencies (CCCL, fmt)

cuml:

  • cuml Python / Cython code and compiled Cython extensions

Dependency Flows

In short.... libcuml contains libcuml.so and libcumlprims_mg.so dynamic libraries and the headers to link against them.

  • Anything that needs to link against cuML at build time pulls in libcugraph wheels as a build dependency.
  • Anything that needs cuML's symbols at runtime pulls it in as a runtime dependency, and calls libcuml.load_library().

For more details and some flowcharts, see rapidsai/build-planning#33 (comment)

Size changes (CUDA 12, Python 3.12, x86_64)

wheel num files (before) num files (this PR) size (before) size (this PR)
libcuml --- 1766 --- 289M
cuml 442 441 527M 9M
TOTAL 442 2207 527M 298M

NOTES: size = compressed, "before" = 2025-01-22 nightlies

how I calculated those (click me)
docker run \
    --rm \
    --network host \
    --env RAPIDS_NIGHTLY_DATE=2025-01-22 \
    --env CUML_NIGHTLY_SHA=01e19bba9821954b062a04fbf31d3522afa4b0b1 \
    --env CUML_PR="pull-request/6199" \
    --env CUML_PR_SHA="9d5100ec4589e20230a31817518427efa1e49c6d" \
    --env RAPIDS_PY_CUDA_SUFFIX=cu12 \
    --env WHEEL_DIR_BEFORE=/tmp/wheels-before \
    --env WHEEL_DIR_AFTER=/tmp/wheels-after \
    -it rapidsai/ci-wheel:cuda12.5.1-rockylinux8-py3.12 \
    bash

# --- nightly wheels --- #
mkdir -p ./wheels-before

export RAPIDS_BUILD_TYPE=branch
export RAPIDS_REF_NAME="branch-25.02"

# cuml
RAPIDS_PY_WHEEL_NAME="cuml_${RAPIDS_PY_CUDA_SUFFIX}" \
RAPIDS_REPOSITORY=rapidsai/cuml \
RAPIDS_SHA=${CUML_NIGHTLY_SHA} \
    rapids-download-wheels-from-s3 python ./wheels-before

# --- wheels from CI --- #
mkdir -p ./wheels-after

export RAPIDS_BUILD_TYPE="pull-request"

# libcuml
RAPIDS_PY_WHEEL_NAME="libcuml_${RAPIDS_PY_CUDA_SUFFIX}" \
RAPIDS_REPOSITORY=rapidsai/cuml \
RAPIDS_REF_NAME="${CUML_PR}" \
RAPIDS_SHA="${CUML_PR_SHA}" \
    rapids-download-wheels-from-s3 cpp ./wheels-after

# cuml
RAPIDS_PY_WHEEL_NAME="cuml_${RAPIDS_PY_CUDA_SUFFIX}" \
RAPIDS_REPOSITORY=rapidsai/cuml \
RAPIDS_REF_NAME="${CUML_PR}" \
RAPIDS_SHA="${CUML_PR_SHA}" \
    rapids-download-wheels-from-s3 python ./wheels-after

pip install pydistcheck
pydistcheck \
    --inspect \
    --select 'distro-too-large-compressed' \
    ./wheels-before/*.whl \
| grep -E '^checking|files: | compressed' \
> ./before.txt

# get more exact sizes
du -sh ./wheels-before/*

pydistcheck \
    --inspect \
    --select 'distro-too-large-compressed' \
    ./wheels-after/*.whl \
| grep -E '^checking|files: | compressed' \
> ./after.txt

# get more exact sizes
du -sh ./wheels-after/*

How I tested this

These other PRs:

@jameslamb jameslamb added 2 - In Progress Currenty a work in progress DO NOT MERGE Hold off on merging; see PR for details labels Dec 30, 2024

This comment was marked as resolved.

@github-actions github-actions bot removed the CUDA/C++ label Dec 31, 2024
@github-actions github-actions bot added conda conda issue CUDA/C++ labels Jan 2, 2025
@bdice bdice requested review from teju85 and bdice January 23, 2025 15:07
@jameslamb jameslamb changed the title WIP: [DO NOT MERGE] introduce libcuml wheels introduce libcuml wheels Jan 23, 2025
@jameslamb jameslamb added improvement Improvement / enhancement to an existing function non-breaking Non-breaking change and removed 2 - In Progress Currenty a work in progress DO NOT MERGE Hold off on merging; see PR for details labels Jan 23, 2025
@jameslamb
Copy link
Member Author

conda-python-tests-singlegpu has been running for a LONG time here... is it normal for that to happen sometimes?

On this PR, I see:

  • 11.8.0, 3.10, amd64, rockylinux8, v100, earliest-driver, oldest-deps (still running - 4h37m)
  • 12.5.1, 3.12, amd64, ubuntu24.04, v100, latest-driver, latest-deps (finished - 4h4m)
  • 12.0.1, 3.11, arm64, ubuntu20.04, a100, latest-driver, latest-deps (finished - 56m22s)

Those times do not include time spent waiting for a runner to pick up the jobs... that's all time occupying a GPU runner.

I see that happening on other PRs too, for example this in-progress build from #6238: https://github.com/rapidsai/cuml/actions/runs/12931830455/job/36069533961

Not sure if #6247 is the root cause... that refers to a "hang" but doesn't have other details.

@jameslamb
Copy link
Member Author

Put up #6251 tracking the long CI times, I see them even on whitespace-only PRs like #6238 so don't think they're caused by the changes in this PR.

vyasr pushed a commit to rapidsai/devcontainers that referenced this pull request Jan 23, 2025
Contributes to rapidsai/build-planning#33

Adjusts `rapids-build-utils` manifest for release 25.02 to account for
the introduction of new `libcuml` wheels
(rapidsai/cuml#6199).

## Notes for Reviewers

This shouldn't be merged still pointing at my forks.

Plan:

1. merge #440, then update
this branch
2. see CI pass here
3. see all CI except devcontainers pass on
rapidsai/cuml#6199
4. point this PR back at upstream and admin-merge it
5. re-run devcontainers CI on rapidsai/cuml#6199
and see it pass
@vyasr
Copy link
Contributor

vyasr commented Jan 24, 2025

Sweet everything is finally passing here!

@jameslamb
Copy link
Member Author

jameslamb commented Jan 24, 2025

Sweet everything is finally passing here!

I think this is ready! But holding off on merging because @dantegd indicated he also wanted to review. (update: talked offline, this is good to merge)

@jameslamb jameslamb added the DO NOT MERGE Hold off on merging; see PR for details label Jan 24, 2025
@jameslamb jameslamb requested review from dantegd and removed request for teju85 and raydouglass January 24, 2025 14:44
@jameslamb jameslamb removed the DO NOT MERGE Hold off on merging; see PR for details label Jan 24, 2025
@jameslamb
Copy link
Member Author

/merge

@rapids-bot rapids-bot bot merged commit 732dac9 into rapidsai:branch-25.02 Jan 24, 2025
76 checks passed
@jameslamb jameslamb deleted the libcuml-wheels branch January 24, 2025 17:25
jameslamb added a commit to rapidsai/rapids-metadata that referenced this pull request Jan 24, 2025
Proposes updating the metadata here to account for new wheels added in
the 25.02 release cycle.

This shouldn't be merged until all of these are:

* [x] `libcugraph` (rapidsai/cugraph#4804)
* [x] `libcuml`  (rapidsai/cuml#6199 )
* [x] `libcuvs` (rapidsai/cuvs#594)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci CMake conda conda issue CUDA/C++ Cython / Python Cython or Python issue improvement Improvement / enhancement to an existing function non-breaking Non-breaking change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants