Skip to content

Update cuvs to properly create a NCCL::NCCL target#720

Merged
rapids-bot[bot] merged 2 commits intorapidsai:branch-25.06from
robertmaynard:properly_use_nccl_cmake_target
Apr 16, 2025
Merged

Update cuvs to properly create a NCCL::NCCL target#720
rapids-bot[bot] merged 2 commits intorapidsai:branch-25.06from
robertmaynard:properly_use_nccl_cmake_target

Conversation

@robertmaynard
Copy link
Copy Markdown
Contributor

Previously cuvs was relying on the fact that nccl would be found when passed as -lnccl and be found on one of the implicit link directories.

@bdice
Copy link
Copy Markdown
Contributor

bdice commented Apr 16, 2025

@robertmaynard Does this need to be revived for 25.06? @divyegala may care about this as he's doing some NCCL packaging work.

@bdice bdice changed the base branch from branch-25.04 to branch-25.06 April 16, 2025 14:21
@bdice bdice added improvement Improves an existing functionality non-breaking Introduces a non-breaking change labels Apr 16, 2025
@robertmaynard
Copy link
Copy Markdown
Contributor Author

@robertmaynard Does this need to be revived for 25.06? @divyegala may care about this as he's doing some NCCL packaging work.

Yes it does

Comment thread cpp/tests/CMakeLists.txt Outdated
if(BUILD_CAGRA_HNSWLIB)
ConfigureTest(NAME NEIGHBORS_HNSW_TEST PATH neighbors/hnsw.cu GPUS 1 PERCENT 100)
ConfigureTest(
NAME NEIGHBORS_HNSW_TEST PATH neighbors/hnsw.cu GPUS 1 PERCENT 100 ADDITIONAL_DEP NCCL::NCCL
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why was the link needed here? AFAIK this code path does not use NCCL.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It pulls in nccl headers via helper headers it uses

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you have the trace? This seems like a leak to me. No problem if not, I can track it down - but shouldn't hold this PR on that, can fix as a follow up.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

re-testing locally and I can't reproduce the nccl dependency. So I am dropping this change

Comment thread cpp/CMakeLists.txt Outdated
)
find_package(NCCL REQUIRED)
target_link_libraries(cuvs_objs PRIVATE NCCL::NCCL)
target_link_libraries(cuvs PUBLIC NCCL::NCCL)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe this should be a PRIVATE link. @viclafargue correct me if I am wrong but does any cuvs header include NCCL header or a RAFT header that includes NCCL header?

Copy link
Copy Markdown
Contributor

@viclafargue viclafargue Apr 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for noticing this. The public cuVS MNMG API should only take in a raft::resources, everything related to NCCL is hidden inside the implementation. At least that is what we are aiming for with rapidsai/raft#2549 and #454.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is currently the status though? Are we exposing the NCCL header directly or indirectly to cuVS users from a header file?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe that we do not have any direct or indirect reference to NCCL with the current version of the codebase.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

re-testing localled shows that I can have this as PRIVATE.

@robertmaynard robertmaynard force-pushed the properly_use_nccl_cmake_target branch from 7900cd8 to 611c9d2 Compare April 16, 2025 17:22
@divyegala
Copy link
Copy Markdown
Member

@robertmaynard is this PR ready for a merge once CI passes?

@robertmaynard
Copy link
Copy Markdown
Contributor Author

robertmaynard commented Apr 16, 2025 via email

@divyegala
Copy link
Copy Markdown
Member

/merge

@rapids-bot rapids-bot Bot merged commit 4e0fb09 into rapidsai:branch-25.06 Apr 16, 2025
66 checks passed
@robertmaynard robertmaynard deleted the properly_use_nccl_cmake_target branch December 3, 2025 22:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CMake cpp improvement Improves an existing functionality non-breaking Introduces a non-breaking change

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

5 participants