-
Notifications
You must be signed in to change notification settings - Fork 915
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
More error checking in from_dlpack
#10850
More error checking in from_dlpack
#10850
Conversation
The implementation copying a full column at a time relies on unit-stride, column-major data in the incoming dlpack tensor. Check these preconditions and report error messages, rather than either silently producing bad data (unit-stride, row-major 2D tensors) or invalid memory accesses (non-unit-stride in the fastest-varying dimension). Closes rapidsai#10754 by providing an explicit error message for this unsupported case.
I would like to add some tests for this, but need a little guidance on where the best place is/how to do so. I guess since |
@wence- I'm not familiar with this part of the code but looks like we can custom a tensor (https://github.com/rapidsai/cudf/blob/branch-22.06/cpp/tests/interop/dlpack_test.cpp#L345-L351) and verify if the function can throw the expected message via |
Thanks, although I am loathe to introduce testing of specific error messages, in light of #10632 and the in-progress #10637. |
|
Codecov Report
@@ Coverage Diff @@
## branch-22.06 #10850 +/- ##
================================================
+ Coverage 86.23% 86.32% +0.09%
================================================
Files 143 144 +1
Lines 22546 22656 +110
================================================
+ Hits 19442 19558 +116
+ Misses 3104 3098 -6
Continue to review full report at Codecov.
|
Thanks, done. |
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.
There are a couple of instances (lines 169 and 174) near these changes where the CUDF_EXPECTS
text reads
greater than or equal-to
Could you remove the hyphen?
Done in 4b9743f |
@gpucibot merge |
The implementation copying a full column at a time relies on
unit-stride, column-major data in the incoming dlpack tensor. Check
these preconditions and report error messages, rather than either
silently producing bad data (unit-stride, row-major 2D tensors) or
invalid memory accesses (non-unit-stride in the fastest-varying
dimension). Closes #10754 by providing an explicit error message for
this unsupported case.