smanders / externpro

build external projects with cmake
MIT License
13 stars 12 forks source link

remove CUB #352

Closed smanders closed 1 year ago

smanders commented 2 years ago

we are currently using CUB 1.8.0 https://github.com/smanders/externpro/issues/215

from Blake Nelson

For this next round of (...) work I think it would be a good idea to upgrade CUB to 1.17 from 1.8. There have been some significant updates in their sorting algorithms that I think will significantly improve (...) registration code and performance.

and in a follow-on email from Blake

CUB is an NVIDIA-developed CUDA library that implements many very useful parallel primitives (in the CUDA training I said never implement reductions yourself---the reason is the CUB implements them better than we ever will).

Newer version of the library make improvements to their segmented sorting algorithm. I tried to use that in the older version in our registration module but it was too slow and so I had to do a rather complicated alternative. The upgrade could help us simplify the code while making it faster.

smanders commented 2 years ago

currently we don't have a patch of CUB, so this should all be pretty straightforward as long as their header-only library hasn't changed drastically https://github.com/smanders/externpro/blob/22.03/projects/cub.cmake (we just copy the cub/ directory)

smanders commented 1 year ago

it appears that CUB now is part of the CUDA Toolkit

CUDA Toolkit Documentation v11.7.1 https://docs.nvidia.com/cuda/archive/11.7.1/ CUDA API References https://docs.nvidia.com/cuda/archive/11.7.1/#cuda-api-references CUB https://docs.nvidia.com/cuda/archive/11.7.1/cub/index.html

is there a reason to maintain CUB in externpro? I believe it would really complicate things to have CUB in two places, and it seems that the CUB that comes with a particular release of CUDA is less likely to have issues...

smanders commented 1 year ago

From: Blake Nelson Date: Wednesday, November 16, 2022 at 9:28 AM To: Scott M Anderson, Cameron Frandsen Cc: Jordan Devenport, Aaron May Subject: CUB and externpro

Scott/Cameron,

Upon further discussion, we believe the best path forward here is to remove CUB from externpro and rely on the version shipped with the CUDA toolkit.

My original desire to keep both versions was simply to allow the plugin the flexibility of getting new functionality without requiring a CUDA toolkit update. However, on further reflection about how difficult it would be to maintain two CUB libraries and how much easier NVIDIA has made CUDA toolkit upgrades with the 11.x branch, I believe there is no upside to keeping both versions.

From: Scott M Anderson Date: Wednesday, November 16, 2022 at 10:33 AM To: Blake Nelson, Cameron Frandsen Cc: Jordan Devenport, Aaron May Subject: Re: CUB and externpro

Thanks, Blake! This sounds like a good path forward to me… if we decide later that there’s an easier way to maintain two versions it won’t take much to reintroduce CUB into externpro.

smanders commented 1 year ago

completed with commit to dev branch referenced above