NVIDIA / cuCollections

Apache License 2.0
464 stars 84 forks source link

[ENHANCEMENT]: CUDA backward compatibility #588

Closed kroburg closed 1 day ago

kroburg commented 2 weeks ago

Is your feature request related to a problem? Please describe.

Hello,

I have found that cuco does not compile with CUDA 12.4 and requires up-to-date cub because of cub::DeviceFor. Fast dirty code comments does not resolve issue either: I got more compilation errors in cuda::std::min.

Upgrade to 12.6 fixed compilation issues but it is not easy (maintainable) solution.

Describe the solution you'd like

It would be nice if cuco will support backward compatibility with older CUDA versions. Excellent: 11.8 Good: 12.0

Also please notice that CUDA version upgrade from 11 to 12 requires major driver upgrade which is not always feasible.

Describe alternatives you've considered

No response

Additional context

No response

PointKernel commented 2 weeks ago

This appears to be a CCCL version mismatch issue rather than a problem with the CUDA Toolkit version.

Could you clarify how you’ve integrated cuco into your project? We highly recommend to use CPM https://github.com/NVIDIA/cuCollections?tab=readme-ov-file#adding-cucollections-to-a-cmake-project.

It seems like you're relying on CCCL bundled with the CUDA Toolkit rather than using the pinned CCCL version from rapids-cmake

kroburg commented 2 weeks ago

This appears to be a CCCL version mismatch issue rather than a problem with the CUDA Toolkit version.

I'm not sure if it is possible (or somehow easy) to link several CCCL version into a single binary due to names clashes.

I think that since cuco should/considered to be part of some other software and not a standalone .so/.dll library it have to be CCCL version agnostic/backward compatible.

Could you clarify how you’ve integrated cuco into your project?

git clone and then add include_directories(contrib/cuco/include) to my CMakeLists.txt.

PointKernel commented 2 weeks ago

I'm not sure if it is possible (or somehow easy) to link several CCCL version into a single binary due to names clashes.

The rapids-cmake CCCL is the only version you should use across your whole CUDA project.

git clone and then add include_directories(contrib/cuco/include) to my CMakeLists.txt.

Yeah, that's definitely something you want to avoid. CPM is hassle-free and easy to use.

@robertmaynard might know of even simpler options.

kroburg commented 2 weeks ago

The rapids-cmake CCCL is the only version you should use across your whole CUDA project.

  1. cmake is not the only build system. Unfortunately this is why rapids-cmake is not an option for me.
  2. I can't switch c++ (version) freely. It will not compile with specific compiler version or due some compiler/libstdc++ issues.
  3. Consider old Ubuntu versions (Trusty) which are still alive and LTS. And its glibc version :-/

I still believe that such libraries as cuco should be dumb as oak or flexible as liana in they dependencies.

kroburg commented 2 weeks ago

This appears to be a CCCL version mismatch issue rather than a problem with the CUDA Toolkit version.

Looks like CCCL may work for me. I will try to put more effort into adding CCCL as yet another dependency. It should work for cuda >=11.1 which is good.

robertmaynard commented 2 weeks ago

I'm not sure if it is possible (or somehow easy) to link several CCCL version into a single binary due to names clashes.

The rapids-cmake CCCL is the only version you should use across your whole CUDA project.

git clone and then add include_directories(contrib/cuco/include) to my CMakeLists.txt.

Yeah, that's definitely something you want to avoid. CPM is hassle-free and easy to use.

@robertmaynard might know of even simpler options.

CPM is the easiest way.

jrhemstad commented 2 weeks ago

It would be nice if cuco will support backward compatibility with older CUDA versions. Excellent: 11.8 Good: 12.0

@kroburg, to be clear, cuco does support compiling with nvcc from CTK 11.8 and 12.0. However, there are additional dependencies that need to be satisfied, like using an up-to-date version of CCCL.

Both cuco and CCCL are header-only libraries and we intentionally support compiling with nvcc from older CTKs. As was mentioned earlier, if you are using cmake then these dependencies conveniently handled for you.

If you aren't using cmake for any reason, that is fine, but it will require more manual effort to satisfy cuco's dependencies.

kroburg commented 2 weeks ago

Yes, I got it. Thank you!

I will try to integrate CCCL and drop all legacy cub/thrust stuff from contrib.

PointKernel commented 1 day ago

Closing this as the issue appears to be resolved.

Feel free to open new issues if you have additional concerns.