-
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
[CUDA][Kernel] A bunch of int64 kernels for COO and CSR #1883
Conversation
* \brief Sort the ID vector in ascending order. | ||
* | ||
* It performs both sort and arg_sort (returning the sorted index). The sorted index | ||
* is always in int64. |
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.
Why the sorted index is always int64
, is it designed to be compatible with pytorch?
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 int64 is the safest since the tensor shape is in int64.
return ret; | ||
} | ||
|
||
std::ptrdiff_t operator-(const PairIterator& other) const { |
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.
Is it used for computing the difference of two iterators? When would this function be called?
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.
It's part of the random-access iterator interface. I guess some sort algorithms might use this operator.
IdType* val_data = val.Ptr<IdType>(); | ||
int64_t* idx_data = idx.Ptr<int64_t>(); | ||
typedef std::pair<IdType, int64_t> Pair; | ||
#ifdef PARALLEL_ALGORITHMS |
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.
@classicsong , when would this flag be activated?
* COO sort * COOToCSR * CSR2COO * CSRSort; CSRTranspose * pass all CSR tests * lint * remove int32 conversion * fix tensorflow nn tests * turn on CI * fix * addreess comments
Description
New kernels added for int64 CSR/COO on CUDA:
TODO
* Integrate with python and fix bugs.Checklist
Please feel free to remove inapplicable items for your PR.
or have been fixed to be compatible with this change