-
Notifications
You must be signed in to change notification settings - Fork 197
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
Build pyraft with scikit-build #644
Build pyraft with scikit-build #644
Conversation
I could use some tips on exactly what |
f8b35fe
to
5478bff
Compare
I still need some help resolving the last comment (the dependent libraries) but otherwise I think we're in OK shape. |
I think everything is correct when When |
In terms of dependencies, Pyraft is going to need to build against This package also requires building the raft handle, which is in turn going to require cudart, rmm, cusolver, cublas, and cusparse. This shouldn't require |
I agree that these transitive dependencies from the libraft build should be fine, I am mostly concerned about the additional dependencies that are only required by the pyraft build, NCCL and UCX. The C++ CMakeLists.txt has options for these dependencies, but they look like no-ops to me so I'm pretty sure that they have to be handled in the pyraft build unless I'm missing a reference to these somewhere else.
So I currently link against NCCL using this somewhat hacky approach, which works fine for me locally. I am not sure if there is a better way to get CMake to find NCCL, and it looks like the old Python build was just relying on the libraries being available somewhere on the system path because Since UCX is dlopened the build contains no UCX-specific information. Locally the comms tests are all skipped for me because the import fails, but I suspect that's an issue with my local UCX installation because the comms tests are all passing on CI. Do you see anything that you would improve here? I note that the old
I originally missed that cusolver/cublas/cusparse were listed as interface targets in the C++ CMakeLists.txt. I had assumed that they were Python-only dependencies because they are mentioned explicitly in the |
Will the The intention here was to have them throw an error when
Thinking through this a little more deeply- ucx-py should be providing the python-based interface to ucx, so that should allow the python pieces in pylibraft to build. However, the comms tests are being wrapped through cython, which ultimately require this header to be compiled. I think since the standard include path ($CONDA_PREFIX/include?) is being added to the include path, it might just be working when ucx has been installed. The I think the |
@cjnolet awesome, thanks for the context! Yes I think switching to scikit-build makes this much cleaner. Now the dependencies are correctly expressed: libraft does not depend on either NCCL or UCX, but pyraft does. AFAICT pyraft only requires the protocol component of UCX (UCP) to build and function correctly based on the fact that tests are passing for me locally, but let me know if I missed anything. Aside from that, I think we should be set. |
I realized that since we dlopen UCX we shouldn't need it at all at link time, so I've removed that altogether. This PR is good to go from my end. |
What happens if UCX is not present? Does it use TCP or something? |
@vyasr we still want to explicitly add ucx to the header path and make sure it's available. Unfortunately, right now it just happens to be available as a byproduct of ucx-py being installed in CI but we still need to compile against it to build the tests. |
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.
LGTM
Ack sorry I got excited to be able to delete code 😄 I forgot that the built Cython does in fact require these headers during the build stage. I put that back. |
Thanks again @vyasr. This all looks great! |
@gpucibot merge |
This PR fixes a number of small errors that slipped through in #644 and #633. None of them materially affect the build (whether a preexisting libraft exists or not) since 1) benchmarks are currently turned off by default anyway in the C++ build, and 2) pyraft only depends on libraft for headers, not for compiled libraries. Authors: - Vyas Ramasubramani (https://github.com/vyasr) Approvers: - Corey J. Nolet (https://github.com/cjnolet) URL: #662
This PR changes the pyraft build system to use scikit-build and CMake. It depends on the changes in #633 and should be merged after that PR.
This PR is largely complete, except that I am not yet sure exactly which libraries/headers are entirely necessary for the build. This version builds locally for me, but not all tests pass since I don't have nccl. However, I am a bit surprised to see the build succeeding without me even searching for UCX (perhaps this is because it's already on my system include path) so I need to figure out what do with UCX, NCCL, and the various CUDA math libraries (cusparse, cublas, etc).