Skip to content

Add support for the Arrow device capsule interfaces - #15370

Merged
rapids-bot[bot] merged 16 commits into
NVIDIA:branch-25.06from
vyasr:feat/arrow_device_capsule
Apr 22, 2025
Merged

Add support for the Arrow device capsule interfaces#15370
rapids-bot[bot] merged 16 commits into
NVIDIA:branch-25.06from
vyasr:feat/arrow_device_capsule

Conversation

@vyasr

@vyasr vyasr commented Mar 21, 2024

Copy link
Copy Markdown
Contributor

Description

This PR adds support for using Arrow's device capsule interface to pylibcudf Column and Table objects. This will allow two-way zero-copy interchange of Arrow data with other libraries that know how to consume data conforming to the Arrow specification.

I use the Python nanoarrow package for testing since it is the only package I know of that supports two-way conversions (consumption and production) of Arrow device capsules at the moment.

Closes #14959

Checklist

  • I am familiar with the Contributing Guidelines.
  • New or existing tests cover these changes.
  • The documentation is up to date with these changes.

@vyasr vyasr added feature request New feature or request non-breaking Non-breaking change labels Mar 21, 2024
@vyasr vyasr self-assigned this Mar 21, 2024
@copy-pr-bot

copy-pr-bot Bot commented Mar 21, 2024

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@github-actions github-actions Bot added libcudf Affects libcudf (C++/CUDA) code. Python Affects Python cuDF API. CMake CMake build issue labels Mar 21, 2024
@vyasr

vyasr commented Mar 21, 2024

Copy link
Copy Markdown
Contributor Author

Everything outside the python directory is a change from #15047 and can be ignored.

@review-notebook-app

Copy link
Copy Markdown

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@vyasr
vyasr changed the base branch from branch-25.02 to branch-25.06 April 10, 2025 23:23
@github-actions github-actions Bot added the pylibcudf Issues specific to the pylibcudf package label Apr 10, 2025
@vyasr vyasr changed the title Add Python interface for to_arrow_device Add support for the Arrow device capsule interfaces Apr 10, 2025
@vyasr

vyasr commented Apr 10, 2025

Copy link
Copy Markdown
Contributor Author

/ok to test

@vyasr

vyasr commented Apr 16, 2025

Copy link
Copy Markdown
Contributor Author

@zeroshade you may want to take a look at this if you have use cases to try it out.

@zeroshade

Copy link
Copy Markdown
Contributor

@vyasr I'm currently travelling for conferences, but I'll definitely take a look here when I get a chance.

Comment thread python/pylibcudf/pylibcudf/table.pyx
Comment thread python/pylibcudf/pylibcudf/table.pyx
@Matt711
Matt711 self-requested a review April 18, 2025 18:21
@vyasr
vyasr requested a review from mroeschke April 18, 2025 21:31

@Matt711 Matt711 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.

Just non blocking suggestions/questions

- pydata-sphinx-theme>=0.15.4
- pynvml>=12.0.0,<13.0.0a0
- pytest-benchmark<5.1.0
- pytest-benchmark

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 curious why?

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.

See the changes in dependencies.yaml (I deleted a bunch of relevant comments).


return self._to_schema(), self._to_host_array()

def __arrow_c_device_array__(self, requested_schema=None, **kwargs):

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.

Nearly identical to the method for table. Maybe factor out? Same for _to_device_array

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.

Yeah, we could consider consolidating more. I'm not sure what the best way to do that is right now. Maybe we need some more common helper functions for this. It gets a bit tricky with the Cython typing though.

Comment thread python/pylibcudf/pylibcudf/libcudf/interop.pxd
Comment thread python/pylibcudf/pylibcudf/libcudf/interop.pxd
Comment thread python/pylibcudf/pylibcudf/libcudf/interop.pxd
Comment thread dependencies.yaml
@vyasr

vyasr commented Apr 21, 2025

Copy link
Copy Markdown
Contributor Author

/merge

Comment thread dependencies.yaml Outdated

@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.

Packaging approval.

@vyasr

vyasr commented Apr 22, 2025

Copy link
Copy Markdown
Contributor Author

/merge

@rapids-bot
rapids-bot Bot merged commit a978c51 into NVIDIA:branch-25.06 Apr 22, 2025
@vyasr
vyasr deleted the feat/arrow_device_capsule branch April 24, 2025 19:13
@vyasr

vyasr commented Apr 24, 2025

Copy link
Copy Markdown
Contributor Author

@zeroshade this PR is merged, but of course feel free to comment here or open issues/PRs if you see any problems or have any suggestions for follow-up!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature request New feature or request non-breaking Non-breaking change pylibcudf Issues specific to the pylibcudf package Python Affects Python cuDF API.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEA] Zero-copy nested types with other GPU libraries (like Awkward array)

6 participants