Skip to content
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

[ENH]: Improve/Rewrite cuda.parallel's build system #2334

Closed
leofang opened this issue Aug 30, 2024 · 5 comments · Fixed by #3597
Closed

[ENH]: Improve/Rewrite cuda.parallel's build system #2334

leofang opened this issue Aug 30, 2024 · 5 comments · Fixed by #3597
Assignees

Comments

@leofang
Copy link
Member

leofang commented Aug 30, 2024

Building cuda.parallel is quite brittle due to requirements from the C library. Through some patient trials and errors I discovered the following build-time dependencies are required:

  • gcc 13+ (due to the usage of std::format)
  • CUDA 12.5+ (due to the usage of gcc 13, which is otherwise unresolvable with conda-forge CUDA packages)
  • make (this is a quirk of conda-forge)
  • libnvjitlink-dev (needed to pass CMake checks)
  • cuda-nvrtc-dev (needed to pass CMake checks)
  • lit (needed to pass CMake checks)

Also I have to set the env var CUDAARCHS like CUDAARCHS="86;89" pip install -v . so that CMake knows which archs to build for, otherwise CMake also complains.

Suggestions:

  • Migrate the build system from setuptools + custom build commands to more CMake-friendly scikit-build-core
  • Add build-time requirements to the section in pyproject.toml for scikit-build-core to pick up
  • Skip unnecessary CMake checks if only building the C library
  • Figure out a way to build also for CUDA 11 (for which the underlying C library is supposed to work) so as to support deployments based on CUDA minor version compatibility
  • Set a default CUDA arch value and allow users to overwrite
  • Test conda builds in the CI like the RAPIDS projects do
  • Expand the installation section to add instructions for building from source
@leofang
Copy link
Member Author

leofang commented Aug 30, 2024

I noted that due to the way we look up headers at run time, editable install (pip install -e .) does not work.

@miscco
Copy link
Collaborator

miscco commented Aug 30, 2024

I have opened a PR to address:

  • gcc 13+ (due to the usage of std::format)
  • CUDA 12.5+ (due to the usage of gcc 13, which is otherwise unresolvable with conda-forge CUDA packages)

I believe we can get rid of

  • make (this is a quirk of conda-forge)
  • lit (needed to pass CMake checks)

AFAIK we need

  • libnvjitlink-dev (needed to pass CMake checks)
  • cuda-nvrtc-dev (needed to pass CMake checks)

@gevtushenko
Copy link
Collaborator

Issue tracking CCCL headers installation in cuda.parallel: #2281
Issue tracking CMake improvements for CCCL/c: #2235

@github-project-automation github-project-automation bot moved this to Todo in CCCL Oct 10, 2024
@jollylili jollylili added the 2.8.0 target for 2.8.0 release label Nov 15, 2024
@rwgk
Copy link
Contributor

rwgk commented Jan 18, 2025

Hi @leofang

I noted that due to the way we look up headers at run time, editable install (pip install -e .) does not work.

That was fixed with #3201 (which closed #2281).

I see #2335 and #2336 were merged.

In the meantime @shwina opened #3290, which seems at least partially related (lit).

Would it make sense to create issues for any remaining work that we still want to do, and close this one?

@leofang leofang assigned leofang and unassigned rwgk Jan 19, 2025
@leofang
Copy link
Member Author

leofang commented Jan 19, 2025

I think based on the conversations we had in #3201 we still want to move to scikit-build-core in the (near?) future. However, it is no longer a blocker given the recent improvements. Let us still use this issue to track it; I've detached this issue from the parent #2555 and assigned it to myself.

@leofang leofang removed the 2.8.0 target for 2.8.0 release label Jan 19, 2025
@leofang leofang assigned oleksandr-pavlyk and unassigned leofang Jan 27, 2025
@cccl-authenticator-app cccl-authenticator-app bot moved this from Todo to In Review in CCCL Jan 30, 2025
@github-project-automation github-project-automation bot moved this from In Review to Done in CCCL Feb 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

6 participants