-
Notifications
You must be signed in to change notification settings - Fork 1k
Use Span thoughout pylibcudf
#21087
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
Open
Matt711
wants to merge
9
commits into
rapidsai:main
Choose a base branch
from
Matt711:fea/plc/span
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+124
−42
Open
Use Span thoughout pylibcudf
#21087
Changes from 1 commit
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
3f09efc
Use Span in contiguous split APIs
Matt711 cb63f30
handle other affected APIs
Matt711 12e26c4
Merge branch 'main' into fea/plc/span
Matt711 96fc1a7
add a comment to test
Matt711 62c347e
Merge branch 'main' into fea/plc/span
Matt711 dce0548
Merge branch 'main' into fea/plc/span
Matt711 d187b75
Add two flaky copy-on-write tests to xfail list
Matt711 c97bac8
Merge branch 'main' into fea/plc/span
Matt711 fcd98f6
Add tests for Span protocol and empty table validation errors
Matt711 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I want this to be in
pylibcudf.utilsand be capable of creating different types ofdevice_spans (e.g.device_span<byte>which I'll need forcudf::table_to_array). I tried to use a fused type as the template type, but Cython cannot infer the type I want. Here is the compile error I get.Since the input here input is just object
object, the cython cannot infer the return type. Any ideas here @vyasr?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cython doesn't support this natively. The options are either to write separate Cython functions that return each concrete type and then having a wrapper function that dispatches to the right one (e.g. based on an enum value) or to use inline C++ to define the function so that you can export a templated version directly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the only APIs that are really relevant for #21069 are in contiguous split and reshape (please correct me if I'm missing something). Since its only two, its probably okay to have two seperate functions to create
device_span[uint8_t]and adevice_span[byte].I'm going to punt the reshape API (ie.
pylibcudf.reshape.table_to_array) to a follow up PR because it would be a breaking change. Currently the API takes in a ptr and a size. The new API would takeSpan, so we'd probably have to deprecate it.Aside: There are other places like in I/O types and null mask. But they really only need type checks using
is_span(I've added them in this PR).