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

Allow enabling NVTX markers by downstream projects after install #610

Merged

Conversation

achirkin
Copy link
Contributor

@achirkin achirkin commented Apr 6, 2022

Allow downstream projects enable NVTX option for the raft::raft target, if it hasn't been enabled at the install time.

@achirkin achirkin requested a review from a team as a code owner April 6, 2022 08:47
@achirkin achirkin added improvement Improvement / enhancement to an existing function non-breaking Non-breaking change 3 - Ready for Review and removed cpp CMake labels Apr 6, 2022
@achirkin
Copy link
Contributor Author

achirkin commented Apr 6, 2022

This PR should replace rapidsai/cuml#4684 . Tagging @robertmaynard @vinaydes @cjnolet to continue the discussion, please let me know what you think of it.

Note specifically, if NVTX is enabled at the install time, there is no way to turn it off in this proposal.

@vinaydes
Copy link
Contributor

vinaydes commented Apr 6, 2022

Looks good to me. I'll close my PR if we decide to merge this one.

@teju85
Copy link
Member

teju85 commented Apr 7, 2022

Just curious, why not just enable nvtx markers all the time?

Copy link
Member

@cjnolet cjnolet left a comment

Choose a reason for hiding this comment

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

This LGTM but would like @robertmaynard’s thoughts before merging

cpp/CMakeLists.txt Outdated Show resolved Hide resolved
cpp/CMakeLists.txt Outdated Show resolved Hide resolved
@achirkin achirkin requested a review from a team as a code owner May 2, 2022 07:55
@achirkin achirkin added breaking Breaking change and removed non-breaking Non-breaking change labels May 2, 2022
@achirkin
Copy link
Contributor Author

achirkin commented May 2, 2022

Update, as per prior suggestions:

build.sh Outdated Show resolved Hide resolved
@cjnolet
Copy link
Member

cjnolet commented May 2, 2022

@achirkin the PR looks good. I think there's still a compilation error showing up in the CI logs:

04:31:43 /workspace/cpp/include/raft/common/detail/nvtx.hpp(153): error: expression must have a constant value
04:31:43 /workspace/cpp/include/raft/common/detail/nvtx.hpp(153): note: cannot call non-constexpr function "raft::common::nvtx::detail::nvtxDomainCreateA"
04:31:43 /usr/local/cuda/include/nvToolsExt.h(1502): here
04:31:43           detected during:
04:31:43             instantiation of class "raft::common::nvtx::detail::domain_store<Domain, std::enable_if_t<std::is_same<const char *, std::decay<decltype(Domain::name)>::type>::value, Domain>> [with Domain=raft::common::nvtx::domain::app]" 
04:31:43 (166): here
04:31:43             instantiation of "void raft::common::nvtx::detail::push_range_name<Domain>(const char *) [with Domain=raft::common::nvtx::domain::app]" 
04:31:43 (177): here
04:31:43             instantiation of "void raft::common::nvtx::detail::push_range<Domain,Args...>(const char *, Args...) [with Domain=raft::common::nvtx::domain::app, Args=<const char *, const char *>]" 
04:31:43 /workspace/cpp/include/raft/core/nvtx.hpp(98): here
04:31:43             instantiation of "void raft::common::nvtx::push_range(const char *, Args...) [with Domain=raft::common::nvtx::domain::app, Args=<const char *, const char *>]" 
04:31:43 /workspace/cpp/include/raft/core/nvtx.hpp(141): here
04:31:43             instantiation of "raft::common::nvtx::range<Domain>::range(const char *, Args...) [with Domain=raft::common::nvtx::domain::app, Args=<const char *, const char *>]" 
04:31:43 /workspace/cpp/test/distance/distance_base.cuh(427): here
04:31:43             instantiation of "void raft::distance::DistanceTest<distanceType, DataType>::SetUp() [with distanceType=raft::distance::CorrelationExpanded, DataType=float]" 
04:31:43 
04:31:43 1 error detected in the compilation of "/workspace/cpp/test/distance/dist_correlation.cu".

Copy link
Member

@ajschmidt8 ajschmidt8 left a comment

Choose a reason for hiding this comment

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

Approving ops-codeowner file changes

@achirkin
Copy link
Contributor Author

achirkin commented May 5, 2022

Apparently, the NVTX implementation was bugged for cuda <= 11.2 because of the usage of nvtxDomainCreateA as an initializer of a static const pointer. Should work properly now!

@achirkin
Copy link
Contributor Author

achirkin commented May 5, 2022

rerun tests

2 similar comments
@achirkin
Copy link
Contributor Author

achirkin commented May 6, 2022

rerun tests

@cjnolet
Copy link
Member

cjnolet commented May 6, 2022

rerun tests

@cjnolet
Copy link
Member

cjnolet commented May 10, 2022

@gpucibot merge

@rapids-bot rapids-bot bot merged commit 3a431f1 into rapidsai:branch-22.06 May 10, 2022
@achirkin achirkin deleted the enh-allow-nvtx-after-install branch May 10, 2022 13:01
rapids-bot bot pushed a commit to rapidsai/cuml that referenced this pull request May 12, 2022
Adjust the name of the option according to the changes proposed in rapidsai/raft#610

Authors:
  - Artem M. Chirkin (https://github.com/achirkin)

Approvers:
  - Corey J. Nolet (https://github.com/cjnolet)

URL: #4718
vimarsh6739 pushed a commit to vimarsh6739/cuml that referenced this pull request Oct 9, 2023
Adjust the name of the option according to the changes proposed in rapidsai/raft#610

Authors:
  - Artem M. Chirkin (https://github.com/achirkin)

Approvers:
  - Corey J. Nolet (https://github.com/cjnolet)

URL: rapidsai#4718
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3 - Ready for Review breaking Breaking change CMake cpp improvement Improvement / enhancement to an existing function
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants