Use cudaMemcpyDefault for trivial copies #7006
Open
+45
−2
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.
Description
In some instances, libcudf and/or rapidsmpf may call Thrust algorithms with an execution policy with a custom allocator that allocates device-accessible host memory. This was observed to fail on some systems, because
trivial_copy_from_deviceusescudaMemcpyDeviceToHostwhich becomes acudaErrorInvalidValue. If we instead usecudaMemcpyDefault, the CUDA runtime correctly infers the source/destination locations and no error is observed.Sample error output from @nirandaperera:
I added a basic test that calls
trivial_copy_(from|to)_devicewith host pointers. This should cover the failure case, though it is actually triggered by some more complex Thrust algorithms incudf::packthat I did not think were worth replicating as a unit test. Being able to use (pinned) host memory more easily is becoming important for performance, so we'd like to support this behavior.Checklist