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

Build C++ wheel #4340

Closed
wants to merge 67 commits into from
Closed

Build C++ wheel #4340

wants to merge 67 commits into from

Conversation

vyasr
Copy link
Contributor

@vyasr vyasr commented Apr 12, 2024

This PR changes wheel building in RMM to create a separate C++ wheel that is then found from the Python wheel. The C++ wheel is now a hard dependency of the Python wheel. This allows Python packaging to more closely mirror the structure of our conda packaging, and the way we would normally wish to package these in any other manager. It also allows us to reduce package sizes by allowing better sharing of artifacts between different Python packages that rely on the same C++ components from other packages.

Contributes to rapidsai/build-planning#33

@vyasr vyasr added the Epic Tracker for a relatively large body of work that is broken down into stories and issues label May 9, 2024
@BradReesWork BradReesWork changed the base branch from branch-24.06 to branch-24.08 May 28, 2024 13:10
@BradReesWork BradReesWork added this to the 24.08 milestone May 28, 2024
@KyleFromNVIDIA
Copy link
Contributor

Please open a PR at https://github.com/rapidsai/rapids-metadata to reflect the new project structure. This can be the same PR as the one that updates cudf.

# Iterate over the array
for wheelhouse in "${WHEELHOUSES[@]}"; do
FIND_LINKS+="--find-links ${wheelhouse} "
done
Copy link
Member

Choose a reason for hiding this comment

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

Whenever we pick this back up, I think it'd be preferable to switch away from FIND_LINKS towards a constraint file, as described in rapidsai/build-planning#69 (comment).

@BradReesWork BradReesWork modified the milestones: 24.08, 24.10 Aug 5, 2024
@BradReesWork BradReesWork changed the base branch from branch-24.08 to branch-24.10 August 5, 2024 19:22
@BradReesWork BradReesWork changed the base branch from branch-24.10 to branch-24.12 September 30, 2024 13:52
@BradReesWork BradReesWork modified the milestones: 24.10, 24.12 Sep 30, 2024
@BradReesWork BradReesWork changed the base branch from branch-24.12 to branch-25.02 November 18, 2024 19:48
@BradReesWork BradReesWork modified the milestones: 24.12, 25.02 Nov 18, 2024
@BradReesWork BradReesWork added the DO NOT MERGE Hold off on merging; see PR for details label Nov 20, 2024
@vyasr
Copy link
Contributor Author

vyasr commented Nov 20, 2024

Closing as stale. We can rebase my branch later and open a new PR when we are ready.

@vyasr vyasr closed this Nov 20, 2024
rapids-bot bot pushed a commit that referenced this pull request Jan 18, 2025
Replaces #4340, contributes to rapidsai/build-planning#33.

Proposes packaging `libcugraph` as a wheel, which is then re-used by `cugraph-cu{11,12}` and `pylibcugraph-cu{11,12}` wheels.

## Notes for Reviewers

### Benefits of these changes

* smaller wheels (see "Size Changes" below)
  - *no more `pylibcugraph` and `cugraph` both holding copies of libcugraph.so*
* faster compile times
  - *no more re-compiling RAFT, thanks to rapidsai/raft#2531
  - *no more recompiling libcugraph.so in both `pylibcugraph` and `cugraph` wheel builds*
* other benefits mentioned in rapidsai/build-planning#33

### Wheel contents

`libcugraph`:

* `libcugraph.so` (shared library)
* cuGraph headers
* vendored dependencies (`fmt`, `spdlog`, CCCL, `cuco`)

`pylibcugraph`:

* `pylibcugraph` Python / Cython code and compiled Cython extensions

`cugraph`:

* `cugraph` Python / Cython code and compiled Cython extension

### Dependency Flows

In short.... `libcugraph` contains `libcugraph.so` and `libcugraph_c.so` dynamic libraries and the headers to link against it.

* Anything that needs to link against cuGraph at build time pulls in `libcugraph` wheels as a build dependency.
* Anything that needs cuGraph's symbols at runtime pulls it in as a runtime dependency, and calls `libcugraph.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) |
|:---------------:|------------------:|-----------------:|--------------:|-------------:|
| `libcugraph`     |   ---                       |  1762                     | ---                   | 903M       |
| `pylibcugraph` |  190                      |   187                       | 901M              | 2M                 |
| `cugraph`         |  315                      |   313                      | 899M              | 3M                 |
|**TOTAL**          |   **505**         |   **2,262**               | **1,800M**                 | **908M**    |

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

*This is a cuGraph-specific slice of the table from rapidsai/raft#2531. See that PR for details.*

### How I tested this

These other PRs:

* rapidsai/devcontainers#435
* rapidsai/cugraph-gnn#110

Authors:
  - James Lamb (https://github.com/jameslamb)
  - Ralph Liu (https://github.com/nv-rliu)
  - Bradley Dice (https://github.com/bdice)

Approvers:
  - Brad Rees (https://github.com/BradReesWork)
  - Bradley Dice (https://github.com/bdice)

URL: #4804
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci CMake DO NOT MERGE Hold off on merging; see PR for details Epic Tracker for a relatively large body of work that is broken down into stories and issues feature request New feature or request non-breaking Non-breaking change python
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants