-
-
Notifications
You must be signed in to change notification settings - Fork 42
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
Add thrust and cub repos #38
base: main
Are you sure you want to change the base?
Conversation
I may have missed some includes in thrust - the set here are just from what I've used on another project and so may be missing some for some functionality. |
The problem here is the library is freezed for a single version and cannot be upgraded/downgraded by the user easily. Might better to stick with cuda toolkit bundled version. There are so many libraries and versions there, this should belong to a seperate repo that provides CUDA related libraries recipes, say cuDNN, TensorRT, etc. |
I don't necessarily think it should be a separate repo but could be a separate workspace contained within this repo. Ultimately it'll become a bzlmod registry for all these libraries. We can add version selection to this quite easily as an argument to the dependencies macro. The motivation for adding this is two-fold; to allow use of the downloadable tarballs for the cuda toolchain and to allow use of thrust / cub in the case that the user has disabled the cuda toolchain. Its perfectly valid to use thrust with an openmp backend and so this allows the user to do this without needing a cuda install to actually be present. |
maybe( | ||
name = "thrust", | ||
repo_rule = http_archive, | ||
build_file = "@rules_cuda//third_party:thrust.BUILD", | ||
sha256 = "d021e37f5aac30fd1b9737865399feb57db8e601ae2fc0af3cd41784435e9523", | ||
strip_prefix = "thrust-1.17.2", | ||
urls = ["https://github.com/NVIDIA/thrust/archive/refs/tags/1.17.2.tar.gz"], | ||
) | ||
|
||
maybe( | ||
name = "cub", | ||
repo_rule = http_archive, | ||
build_file = "@rules_cuda//third_party:cub.BUILD", | ||
sha256 = "1013a595794548c359f22c07e1f8c620b97e3a577f7e8496d9407f74566a3e2a", | ||
strip_prefix = "cub-1.17.2", | ||
urls = ["https://github.com/NVIDIA/cub/archive/refs/tags/1.17.2.tar.gz"], | ||
) | ||
|
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.
They are not mandatory, please move them into third_party/
also. Otherwise, our core rules depends on not in use remote files. Lets keep them minimal.
"cub/*.cuh", | ||
"cub/agent/*.cuh", | ||
"cub/block/*.cuh", | ||
"cub/block/specializations/*.cuh", | ||
"cub/device/*.cuh", | ||
"cub/device/dispatch/*.cuh", | ||
"cub/grid/*.cuh", | ||
"cub/warp/*.cuh", | ||
"cub/warp/specializations/*.cuh", | ||
"cub/iterator/*.cuh", | ||
"cub/thread/*.cuh", | ||
"cub/detail/*.cuh", |
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.
Any reason to make the glob so detailed? This prone to be affected by upstream implemtation details change. Why not just glob([cub/**/*.cuh])
.
filegroup( | ||
name = "include-src", | ||
srcs = glob([ | ||
"thrust/*.h", |
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.
This line is redundent.
#) | ||
|
||
filegroup( | ||
name = "include-src", |
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.
Maybe call them include-hdrs
.
#) | ||
|
||
filegroup( | ||
name = "include-src", |
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.
Same
Wanted to point out that Would it make more sense to add build rules to |
The current blocker is merely how do we avoid rules_cuda/cuda/runtime/BUILD.local_cuda Lines 26 to 30 in 7a29239
Or more generally, we need a confugrable way to piece together different packages (like in |
I think ultimately this will be replaced by bzlmod modules: bazelbuild/bazel-central-registry#1058. |
As thrust can also be used via an OpenMP backend, make this available as repository outside of the toolchain.