Skip to content

Conversation

@nirandaperera
Copy link
Contributor

@nirandaperera nirandaperera commented Oct 29, 2025

This PR adds a detail definition to the build. RAPIDSMPF_DETAIL def is available in c++.

Signed-off-by: niranda perera <[email protected]>
@nirandaperera nirandaperera requested review from a team as code owners October 29, 2025 21:41
@nirandaperera nirandaperera added improvement Improves an existing functionality non-breaking Introduces a non-breaking change labels Oct 29, 2025
Signed-off-by: niranda perera <[email protected]>
Comment on lines 40 to 46
# Set RAPIDSMPF_DEBUG default based on build type
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
set(RAPIDSMPF_DEBUG_DEFAULT ON)
else()
set(RAPIDSMPF_DEBUG_DEFAULT OFF)
endif()

Copy link
Member

@pentschev pentschev Oct 30, 2025

Choose a reason for hiding this comment

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

I would prefer that the default is always off, even when CMake build type is debug, thus requiring you to specify it manually via --cmake-args, for example. The reason for that is we are more likely to build in debug mode to do general debugging than to require the extended NVTX annotations.

Furthermore, I think it makes more sense to have a different name, debug invokes a meaning of trying to resolve a problem, whereas I think this is more about performance validation/investigation. How do you feel about RAPIDSMPF_NVTX_DETAIL?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

A DEBUG mode macro came up in several discussions. So, I would like this to be used for not just nvtx annotations.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

RAPIDSMPF_VERBOSE or simply RAPIDSMPF_DETAIL?

Copy link
Member

Choose a reason for hiding this comment

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

I think DEBUG is a more specific term IMO, I'd prefer RAPIDSMPF_DETAIL. In any case, I think we should only enable it when explicitly specified, and not just depend on CMAKE_BUILD_TYPE=Debug to enable it by default.

Copy link
Member

Choose a reason for hiding this comment

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

Agree, let's not use DEBUG.

But DETAIL might not be ideal either. It could be confused with our detail namespace and with macros like RAPIDSMPF_CONCAT_DETAIL_

Comment on lines 174 to 176
#if RAPIDSMPF_DEBUG
RAPIDSMPF_NVTX_SCOPED_RANGE("Shuffler.Progress", p_iters++);
#endif
Copy link
Member

Choose a reason for hiding this comment

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

Can we embed the RAPIDSMPF_DEBUG check inside RAPIDSMPF_NVTX_SCOPED_RANGE()?

Copy link
Member

Choose a reason for hiding this comment

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

Doing that means we disable it completely unless built with that flag. Most software, cuDF inclusive, AFAIK, doesn't do that, NVTX symbols are always present. I think the primary goal of this PR is not disabling NVTX entirely, but rather the very verbose/fine-grained NVTX annotations.

Copy link
Member

@madsbk madsbk Oct 30, 2025

Choose a reason for hiding this comment

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

Then call it RAPIDSMPF_NVTX_SCOPED_RANGE_VERBOSE ?

Copy link
Member

Choose a reason for hiding this comment

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

Yes, that option I like, +1 to that.

@nirandaperera nirandaperera changed the title [MINOR] Adding a DEBUG mode [MINOR] Adding a RAPIDSMPF_DETAIL mode Oct 30, 2025
Copy link
Member

@KyleFromNVIDIA KyleFromNVIDIA left a comment

Choose a reason for hiding this comment

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

Approved CMake changes

RAPIDSMPF_NVTX_SCOPED_RANGE("meta_recv");
RAPIDSMPF_NVTX_SCOPED_RANGE_VERBOSE("meta_recv");
#if RAPIDSMPF_VERBOSE_INFO
int i = 0;
Copy link
Member

Choose a reason for hiding this comment

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

Nit: now that this needs guards, rename i to something a bit more descriptive.

Comment on lines +257 to +259
#if RAPIDSMPF_VERBOSE_INFO
RAPIDSMPF_NVTX_MARKER("meta_recv_iters", i);
#endif
Copy link
Member

Choose a reason for hiding this comment

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

Or better than renaming i, how about adding a RAPIDSMPF_NVTX_MARKER_VERBOSE, then always defining i and let the RAPIDSMPF_NVTX_MARKER_VERBOSE determine whether to use i or not?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants