-
Notifications
You must be signed in to change notification settings - Fork 540
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
Updating cmake files to enable NVTX markers for cuML build #4684
Conversation
Can one of the admins verify this patch? |
IMO even this line cuml/cpp/cmake/thirdparty/get_raft.cmake Line 65 in c4c80aa
NVTX_ENABLED and also RAFT does not get compiled as a lib. We need to compile the source that includes RAFT headers with -DNVTX_ENABLED . I could not test it and thus not doing that change. Let me know if it is okay to remove the line.
|
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 haven't been working with cmake for a while, but I've had an impression that normally this all should be handled by cmake as a regular header-only library. Raft is supposed to populate these compile/link options using the INTERFACE
scope.
Also what puzzles me, get_raft.cmake has a few more parameters besides NVTX; how come some of them work and this one does not?..
I haven't tested this when raft is picked up from the conda environment, but the current setting works on my machine well with raft set by -DCPM_raft_SOURCE=../raft
+ DISABLE_FORCE_CLONE_RAFT=ON
.
if(NVTX) | ||
target_compile_options(${PRIMS_BENCH_TARGET} PRIVATE "-DNVTX_ENABLED") | ||
target_link_libraries(${PRIMS_BENCH_TARGET} PRIVATE nvToolsExt) | ||
endif() |
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.
Since all bench and test targets depend on the cuml library target, we shouldn't need to repeat the compile options / link libraries. Does it work properly without these lines?
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 saw link time errors related to unresolved nvtx function calls. Thats why added them.
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.
Would it still error if you change the scope to PUBLIC in the library's CMakeLists?
@achirkin May be I am getting the CMake fundamentals wrong here but we are passing here |
|
I see. Does raft's CMakeLists.txt gets used while using raft in header only way? |
It should be, to the best of my understanding. Yet, I see, NVTX is indeed not enabled when I |
I've tried to trace cmake setup in cuml. It seems, the problem is Ideally, it would be nice to prevent conda/cmake from substituting options like |
Thanks for looking in to it @achirkin. I am okay with adopting any of the approaches as long as we can enable NVTX for cuml. |
Since |
ok to test |
Codecov Report
@@ Coverage Diff @@
## branch-22.06 #4684 +/- ##
===============================================
Coverage ? 84.06%
===============================================
Files ? 252
Lines ? 20336
Branches ? 0
===============================================
Hits ? 17095
Misses ? 3241
Partials ? 0
Flags with carried forward coverage won't be shown. Click here to find out more. Continue to review full report at Codecov.
|
This PR has been labeled |
rapidsai/raft#610 has been merged, so this one can be closed. NB: in the current state, NVTX is ON by default within raft, but OFF by default in cuml. We'd need another PR to invert the |
Currently cuML is not built with NVTX markers even when compiled with
NVTX=ON
. This PR enables NVTX markers for cuML (libcuml++so
, tests and benchmark binary) build when RAFT is picked from conda environment (which is default behavior right now). It should work even when RAFT is picked from user specified path, but I haven't tested it.As discussed previously elsewhere, we might decide to enable NVTX by default in future, this is a patch for time being.
@venkywonka @teju85 @achirkin @cjnolet @dantegd