Build the cupy.cuda.cub module by default#2584
Conversation
For example, #2562 needs to include more CUB headers in addition to those listed above. |
cupy.cuda.cub module by defaultcupy.cuda.cub module by default
cupy.cuda.cub module by defaultcupy.cuda.cub module by default
|
Removed the WIP tag from title since the test is separated from this PR. |
|
I found that Thrust comes with recent CUDA Toolkits, and CUB is part of Thrust in |
|
+1 to build CUB by default, and to disable CUB support for backward compatibility. How about bundling CUB as submodule instead of copying all code tree into CuPy? It makes the version bundled with CuPy clear, and it is also easer to bump version of CUB when new version is released. Using CUB under thrust directory seems not recommended by NVIDIA: https://devtalk.nvidia.com/default/topic/1035921/unable-to-include-cub/ |
That's a great idea I actually considered. I just wasn't sure whether the team likes a submodule or not, because it'd need some changes in both the CI and programers' daily workflows. Given that Thrust headers were copied over, I thought I may give it a try. A submodule is also good in that I won't have to contribute over 40k lines in a PR...Sounds a bit crazy 😜
Good finding, thanks a lot @kmaehashi! I wish NVIDIA folks document this kind of things. The devtalk forum is a horrible place to search and refer to... |
|
Done. PTAL. @kmaehashi, You may need to change your CI infrastructure to checkout the repo recursively in order to test this PR. When this PR is (about to be) merged, it's also better to make an announcement to Slack/mailing list/whatever channel you have, so that internal and external contributors are aware of this interruptive change. Git submodule can be a bit painful to work with for inexperienced developers (including me...) |
|
cc @anaruse (for awareness) |
|
Thanks, @jakirkham. Also pinging @grlee77 @y1r, although this PR is still on an early stage. |
|
@kmaehashi This might be a future concern, but I could also try to address it here if you can provide some instructions: How to not build the cub module if the build target is ROCm/HIP? |
|
Could you squash all commits into one, as the commit 6237353 is huge?
Sure I will. |
This is optional comment, but if you have time, could you update the build script to print some nice message (submodule is not checked out) when |
|
@kmaehashi By the way, how about #2584 (comment)?
Done.
Done. PTAL. |
|
https://ci.appveyor.com/project/cupy/cupy/builds/28761775#L164 shows the error message works 😆 |
|
Now the CUB module is imported everywhere, but whether it's used or not solely depends on the flag |
You have nothing to do about it, only |
|
Thanks for working on this @leofang. I agree with the submodule approach I haven't really worked with submodules on the CI services, but maybe something like the following would get Appveyor to checkout the submodule: appveyor/ci#899 (comment) (there are others potential solutions in that thread as well). |
Sorry for the late reply, I'm going to merge this PR first. |
|
Successfully created a job for commit 3f0a3dd: |
|
Jenkins CI test (for commit 3f0a3dd, target branch master) failed with status FAILURE. |
|
|
|
Note: in |
|
pfnCI, test this please. |
|
Successfully created a job for commit 3f0a3dd: |
|
Jenkins CI test (for commit 3f0a3dd, target branch master) failed with status FAILURE. |
|
Is chainer-doc on CUDA 8.0? |
|
pfnCI, test this please. |
|
Successfully created a job for commit 3f0a3dd: |
|
For some reason chainer-doc is not skipped for v8 tests, I'm going to resolve shortly. |
|
chainer/chainer-test#585 should fix |
|
Jenkins CI test (for commit 3f0a3dd, target branch master) failed with status FAILURE. |
|
pfnCI, test this please. |
|
Successfully created a job for commit 3f0a3dd: |
|
Jenkins CI test (for commit 3f0a3dd, target branch master) succeeded! |
|
LGTM! |
|
Thank you, @kmaehashi! Glad to see it's in! Quick question: Do you plan to backport this? 😛 |
|
Awesome! Thank you all for the hard work here! 😀 |
|
Jenkins CI test (for commit 3f0a3dd, target branch master) failed with status FAILURE. |
This changed the minimum g++ requirement, thus no backport 😉 |
|
Ah, I see. I didn't consider that. Thanks! |
Close #3078. Close #3075. Close #3108. Close #3507.
This PR includes all the CUB v1.8.0 headers (see notes below) so that the
cupy.cuda.cubmodule can be built by default. This also avoids the need of documenting how to build it.Note that the
CUB_PATHenv variable is no longer needed.TODO:
Write a unit test for(related: Test CUB and cuTensor in CI #2579) UPDATE: see Add tests forcupy.cuda.cubcupy.cuda.cub#2598cupy.cuda.cub_enabled = Falseduring import for backward compatibility, and whether theCUB_DISABLEDenv variable is still needed.Note:
cupy/cuda/cupy_cub.cu(obtained viacpp -MM -I(...) cupy/cuda/cupy_cub.cu):Since so many of them are needed, we might as well copy the entire
cubfolder for future extensibility and easier maintainability.3. CUB v1.8.0 is quite stable (no new release since Feb 2018), suitable to be a dependency.