-
Notifications
You must be signed in to change notification settings - Fork 901
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
Use NVTX from GitHub. #15178
Use NVTX from GitHub. #15178
Conversation
cpp/cmake/thirdparty/get_nvtx.cmake
Outdated
GIT_SHALLOW TRUE | ||
DOWNLOAD_ONLY TRUE | ||
) | ||
set(NVTX_INCLUDE_DIR |
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.
I get the feeling that this is not the right way to do this. I think I need to add the nvtx targets, rather than specifying the include directory directly.
The targets are defined by c/CMakeLists.txt
in the nvtx repo. I googled around a bit and tried to find how to add this. Do I need something like SOURCE_SUBDIR c
for it to find the targets? I'm not sure how to use this.
cc: @robertmaynard @vyasr
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.
Do I need something like SOURCE_SUBDIR c for it to find the targets?
Yes 🙂
https://github.com/NVIDIA/NVTX/tree/dev/c#use-cmake-package-manager-cpm
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.
Hmm. I tried this but wasn’t having success. I think that there is something I don’t understand about how rapids-cmake calls CPM.
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.
You need to use CPM _ARGS SOURCE_SUBDIR c
to tell rapids-cmake to pass the option down to cpm.
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.
@robertmaynard I think I did that in 226101b. In my understanding, that should make the nvtx3-cpp
target available, and I should be able to use target_link_libraries(cudf PRIVATE nvtx3-cpp)
to get it to recognize the include directories from nvtx. However, this isn't working as I expected. Can you help me debug it?
Co-authored-by: Robert Maynard <robertjmaynard@gmail.com>
@@ -777,7 +779,7 @@ add_dependencies(cudf jitify_preprocess_run) | |||
target_link_libraries( | |||
cudf | |||
PUBLIC ${ARROW_LIBRARIES} CCCL::CCCL rmm::rmm | |||
PRIVATE cuco::cuco ZLIB::ZLIB nvcomp::nvcomp kvikio::kvikio | |||
PRIVATE nvtx3-cpp cuco::cuco ZLIB::ZLIB nvcomp::nvcomp kvikio::kvikio |
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.
Will need to also have the cudf tests use this target, since some tests are including internal cudf headers.
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.
@robertmaynard I had to do this for benchmarks, too. On second thought, should cudf be exporting this dependency somehow? Or do we expect every library using cudf
to add nvtx3-cpp
to their target_link_libraries
?
(To be clear, I don't know the "right" way to solve this.)
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.
The reason that tests and benchmarks need to add the nvtx3-cpp
target is that they include non 'publicheaders from
cudf/detail`.
Actual consumers of libcudf will not do so, and therefore have no need to have nvtx3 installed when building against libcudf.
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.
Ah, that makes sense. Thanks, I hadn’t considered that.
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.
For posterity, the JNI code was also consuming cudf detail headers and needed to link to NVTX.
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.
Nice cleanups! 1925 lines removed 🔥 🔥 🔥
PR description to be updated otherwise looks great to me.
internal detail headers shouldn't consumed outside libcudf. :) If they are needed outside libcudf, a discussion about moving things out of detail should be started. |
/merge |
Description
This PR removes the vendored copy of NVTX and instead fetches it from GitHub.
Note: Consumers of libcudf internal
detail
headers will need to provide their own NVTX. This can be done by using the CMake code in this PR (or the sample CMake code in the NVTX README), and callingtarget_link_libraries(your_target PRIVATE nvtx3-cpp)
.Closes #6476.
Checklist