-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
[ROCM] Add Thrust support #7458
Conversation
@tkonolige @mbrookhart Thanks for review, it should be ready to go. This can be used for benchmarking the new TIR sort @mbrookhart is cooking. I'll follow up with another PR to enforce |
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.
Devil's advocate:
If I reformat the thrust.cu file with clang-format-10, like you said, they are identical except for the datatype errors you added and #include <thrust/sequence.h>
in the amd version.
Is there any reason to keep two copies around?
(otherwise LGTM, thank you!)
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.
Thanks @masahi for adding rocthrust support!
@mbrookhart Yes, I wanted to reuse
But unlike for CUDA, cmake doesn't recognize that this .cu file needs to be compiled by the same CXX compiler ( I think CMake has a special support for NVCC and .cu file, to correctly compile .cu with NVCC and others with gcc/clang. On rocm, everything needs to be compiled by the same compiler, |
Maybe pytorch people have a solution to the duplication problem. But my cmake-fu is too low and I have no interest in learning about cmake :) |
@tkonolige @csullivan Any other change requests or are you happy? |
@masahi You can use |
Thanks I'll try this ASAP |
Great |
Thanks @mbrookhart @tkonolige @csullivan |
* enable rocm thrust, confrimed to work on sort and scan * add rocm argsort strategy * Abort if CXX is not hipcc * add more strategy * add missing import * fix lint * show supported data type in err msg * try remove rocthrust * add missing include for rocthrust * more minor change Co-authored-by: Masahiro Masuda <masahi@129@gmail.com>
* enable rocm thrust, confrimed to work on sort and scan * add rocm argsort strategy * Abort if CXX is not hipcc * add more strategy * add missing import * fix lint * show supported data type in err msg * try remove rocthrust * add missing include for rocthrust * more minor change Co-authored-by: Masahiro Masuda <masahi@129@gmail.com>
This adds rocThrust support for our rocm backend, which can be used for sorting and scan.
https://github.com/ROCmSoftwarePlatform/rocThrust
Use "rocm -libs=thrust" to enable thrust based sort and scan.
contrib/rocthrust/thrust.cc
code is identical tocontrib/thrust/thrust.cu
used by CUDA backend. The same thrust code works on both CUDA and AMD.@mbrookhart @csullivan @antinucleon