-
Notifications
You must be signed in to change notification settings - Fork 3k
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
[Bugfix] Wrap cub with CUB_NS_PREFIX and remove dependency on Thrust to linking issues with Torch 1.8 #2758
[Bugfix] Wrap cub with CUB_NS_PREFIX and remove dependency on Thrust to linking issues with Torch 1.8 #2758
Conversation
So should we avoid using thrust altogether in DGL later on? Also a side question: if I write a PyTorch CUDA extension that uses thrust (or linking/dlopening two libraries both using thrust), would it also have symbol duplication? EDIT: the answer is yes: pytorch/pytorch#52663 |
@BarclayII I think until NVIDIA/thrust#1401 is resolved, it will be simplest to avoid using it in DGL. |
@BarclayII I think this PR fix the low-accuracy issue of dgl + cu112. |
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.
LGTM. Thanks for the fix.
Description
This wraps all cub usages with CUB_NS_PREFIX, and removes the one use of thrust. This prevents symbol collision when linking against PyTorch 1.8.
Checklist
Please feel free to remove inapplicable items for your PR.
or have been fixed to be compatible with this change
Changes
This adds
/src/array/cuda/dgl_cub.cuh
, which should be included in place ofcub/cub.cuh
, and it wraps it in the appropriate namespace.This also changes the implementation of NonZero to use cub::DeviceSelect::If instead of thrust.