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 KvikIO as a shared library #527

Merged
merged 9 commits into from
Nov 6, 2024

Conversation

madsbk
Copy link
Member

@madsbk madsbk commented Oct 30, 2024

Moving libcurl dependent functions to remote_handle.cpp (let's move the rest in a follow up PR) and setup building libkvikio.so.

Background

Now that KvikIO has evolved into a standalone IO library that works without cuFile and CUDA, I think it makes sense to move to a shared library. Originally, KvikIO was a very thin wrapper around cuFile, which is why we decided to keep it header-only (not because of templates).

Pros:

  • Enables us to statically compile libcurl into libkvikio.so.
  • Avoid having to compile libcurl in downstream projects. Currently, cudf must compile libcurl in every build.
  • Reduce compile time in CI, both for KvikIO and downstream projects.
  • Ease development by not having to rebuild downstream projects like cudf every time KvikIO is modified.

Cons:

  • Projects cannot vendoring KvikIO as a header-only project. As far as we know, nobody does this.

@madsbk madsbk added breaking Introduces a breaking change improvement Improves an existing functionality labels Oct 30, 2024
@madsbk madsbk force-pushed the shared_library branch 9 times, most recently from 31bdb15 to 891099d Compare October 31, 2024 15:43
madsbk added a commit to madsbk/cudf that referenced this pull request Oct 31, 2024
madsbk added a commit to madsbk/cudf that referenced this pull request Oct 31, 2024
madsbk added a commit to madsbk/cudf that referenced this pull request Oct 31, 2024
@madsbk madsbk force-pushed the shared_library branch 6 times, most recently from df465f1 to 788c9b4 Compare November 3, 2024 21:19
madsbk added a commit to madsbk/cudf that referenced this pull request Nov 4, 2024
@madsbk madsbk force-pushed the shared_library branch 2 times, most recently from 6d38bec to f1a0f21 Compare November 4, 2024 08:29
madsbk added a commit to madsbk/cudf that referenced this pull request Nov 4, 2024
madsbk added a commit to madsbk/cudf that referenced this pull request Nov 4, 2024
@madsbk madsbk changed the title Build KvikIO to a shared library Build KvikIO as a shared library Nov 4, 2024
madsbk added a commit to madsbk/cudf that referenced this pull request Nov 4, 2024
@madsbk madsbk closed this Nov 4, 2024
Copy link
Contributor

@bdice bdice left a comment

Choose a reason for hiding this comment

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

This seems mostly right to me. I have a couple pieces of feedback and I noticed CI is not running. It gave an error on the last commit.

Invalid workflow file: .github/workflows/pr.yaml#L78
The workflow is not valid. .github/workflows/pr.yaml (Line: 78, Col: 11): Input shared_actions_repo is required, but not provided while calling. .github/workflows/pr.yaml (Line: 78, Col: 11): Input shared_actions_ref is required, but not provided while calling.

https://github.com/rapidsai/kvikio/actions/runs/11667562812

cpp/include/kvikio/shim/utils.hpp Outdated Show resolved Hide resolved
@@ -35,14 +35,23 @@ rapids_cmake_write_version_file(include/kvikio/version_config.hpp)
# Set a default build type if none was specified
rapids_cmake_build_type(Release)

# build options
option(KvikIO_REMOTE_SUPPORT "Configure CMake to build with remote IO support" ON)
# ##################################################################################################
Copy link
Contributor

Choose a reason for hiding this comment

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

These comment blocks are super long and the lengths of the --- aren't the same length as the ###. Can we keep this to ~72 chars instead of ~100?

Copy link
Member Author

Choose a reason for hiding this comment

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

The 100 width of the comment blocks are forced by the cmake style, which adds = until the width is 100. I have fixed the ---- length to match.
I think we need a style update in a separate PR.

@bdice
Copy link
Contributor

bdice commented Nov 4, 2024

I noticed CI is not running. It gave an error on the last commit.

This was due to an unexpected merge of rapidsai/shared-workflows#257, which should be corrected by rapidsai/shared-workflows#258. cc: @msarahan

@AyodeAwe
Copy link
Contributor

AyodeAwe commented Nov 4, 2024

This was due to an unexpected merge of rapidsai/shared-workflows#257, which should be corrected by rapidsai/shared-workflows#258. cc: @msarahan

@bdice perhaps a typo but rapidsai/shared-workflows#257 at this time hasn't been merged.

@bdice
Copy link
Contributor

bdice commented Nov 4, 2024

This was due to an unexpected merge of rapidsai/shared-workflows#257, which should be corrected by rapidsai/shared-workflows#258. cc: @msarahan

@bdice perhaps a typo but rapidsai/shared-workflows#257 at this time hasn't been merged.

Sorry, I meant rapidsai/shared-workflows#247. The issue should be resolved now but may require pushing a new commit.

cpp/CMakeLists.txt Outdated Show resolved Hide resolved
Co-authored-by: Robert Maynard <[email protected]>
@madsbk madsbk requested a review from robertmaynard November 4, 2024 20:04
@madsbk
Copy link
Member Author

madsbk commented Nov 5, 2024

@robertmaynard, do you have anything else?

Copy link
Contributor

@vyasr vyasr left a comment

Choose a reason for hiding this comment

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

Looks good. I checked everything, but not exactly with a fine-toothed comb since we'll be testing this very quickly in the downstream PRs anyway.

@madsbk
Copy link
Member Author

madsbk commented Nov 5, 2024

@bdice do you have anything?

Copy link
Contributor

@bdice bdice left a comment

Choose a reason for hiding this comment

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

Approving. I previously looked at everything, and now approve based on the diff since my last look.

@madsbk
Copy link
Member Author

madsbk commented Nov 6, 2024

/merge

@rapids-bot rapids-bot bot merged commit 1c99841 into rapidsai:branch-24.12 Nov 6, 2024
57 checks passed
@madsbk
Copy link
Member Author

madsbk commented Nov 6, 2024

Thanks all. With this merged, we need to update cudf asap: rapidsai/cudf#17239

madsbk added a commit to madsbk/cudf that referenced this pull request Nov 6, 2024
rapids-bot bot pushed a commit to rapidsai/cudf that referenced this pull request Nov 7, 2024
Update cudf  to use the new KvikIO shared library: rapidsai/kvikio#527

#### Tasks
- [x] Wait for the [KvikIO shared library PR](rapidsai/kvikio#527) to be merged.
- [x] Revert the use of the [KvikIO shared library](rapidsai/kvikio#527) in CI: 2d8eeaf.

Authors:
  - Mads R. B. Kristensen (https://github.com/madsbk)
  - Vyas Ramasubramani (https://github.com/vyasr)

Approvers:
  - Vyas Ramasubramani (https://github.com/vyasr)
  - James Lamb (https://github.com/jameslamb)

URL: #17239
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking Introduces a breaking change improvement Improves an existing functionality
Projects
Status: Landed
Development

Successfully merging this pull request may close these issues.

6 participants