-
Notifications
You must be signed in to change notification settings - Fork 22
[MINOR] Adding a RAPIDSMPF_DETAIL mode
#612
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
Changes from 2 commits
d9197cd
1bed432
1e1307c
d2829c1
1fc278b
11dfcc6
0451c53
68b90f4
30d771d
cd1a999
c0512e6
af2aa59
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -171,7 +171,9 @@ class Shuffler::Progress { | |
| * @return The progress state of the shuffler. | ||
| */ | ||
| ProgressThread::ProgressState operator()() { | ||
| #if RAPIDSMPF_DEBUG | ||
| RAPIDSMPF_NVTX_SCOPED_RANGE("Shuffler.Progress", p_iters++); | ||
| #endif | ||
|
||
| auto const t0_event_loop = Clock::now(); | ||
|
|
||
| // Tags for each stage of the shuffle | ||
|
|
@@ -186,7 +188,9 @@ class Shuffler::Progress { | |
| { | ||
| auto const t0_send_metadata = Clock::now(); | ||
| auto ready_chunks = shuffler_.outgoing_postbox_.extract_all_ready(); | ||
| #if RAPIDSMPF_DEBUG | ||
| RAPIDSMPF_NVTX_SCOPED_RANGE("meta_send", ready_chunks.size()); | ||
| #endif | ||
| for (auto&& chunk : ready_chunks) { | ||
| // All messages in the chunk maps to the same key (checked by the PostBox) | ||
| // thus we can use the partition ID of the first message in the chunk to | ||
|
|
@@ -226,8 +230,10 @@ class Shuffler::Progress { | |
| // `incoming_chunks_`. | ||
| { | ||
| auto const t0_metadata_recv = Clock::now(); | ||
| #if RAPIDSMPF_DEBUG | ||
| RAPIDSMPF_NVTX_SCOPED_RANGE("meta_recv"); | ||
| int i = 0; | ||
|
||
| #endif | ||
| while (true) { | ||
| auto const [msg, src] = shuffler_.comm_->recv_any(metadata_tag); | ||
| if (msg) { | ||
|
|
@@ -245,17 +251,23 @@ class Shuffler::Progress { | |
| } else { | ||
| break; | ||
| } | ||
| #if RAPIDSMPF_DEBUG | ||
| i++; | ||
| #endif | ||
| } | ||
| stats.add_duration_stat( | ||
| "event-loop-metadata-recv", Clock::now() - t0_metadata_recv | ||
| ); | ||
| #if RAPIDSMPF_DEBUG | ||
| RAPIDSMPF_NVTX_MARKER("meta_recv_iters", i); | ||
| #endif | ||
| } | ||
|
|
||
| // Post receives for incoming chunks | ||
| { | ||
| #if RAPIDSMPF_DEBUG | ||
| RAPIDSMPF_NVTX_SCOPED_RANGE("post_chunk_recv", incoming_chunks_.size()); | ||
| #endif | ||
| auto const t0_post_incoming_chunk_recv = Clock::now(); | ||
| for (auto it = incoming_chunks_.begin(); it != incoming_chunks_.end();) { | ||
| auto& [src, chunk] = *it; | ||
|
|
@@ -342,6 +354,7 @@ class Shuffler::Progress { | |
| // requested data. | ||
| { | ||
| auto const t0_init_gpu_data_send = Clock::now(); | ||
| #if RAPIDSMPF_DEBUG | ||
| RAPIDSMPF_NVTX_SCOPED_RANGE( | ||
| "init_gpu_send", | ||
| std::transform_reduce( | ||
|
|
@@ -352,6 +365,7 @@ class Shuffler::Progress { | |
| [](auto& kv) { return kv.second.size(); } | ||
| ) | ||
| ); | ||
| #endif | ||
| // ready_ack_receives_ are separated by rank so that we | ||
| // can guarantee that we don't match messages out of order | ||
| // when using the UCXX communicator. See comment in | ||
|
|
@@ -379,7 +393,9 @@ class Shuffler::Progress { | |
| // Check if any data in transit is finished. | ||
| { | ||
| auto const t0_check_future_finish = Clock::now(); | ||
| #if RAPIDSMPF_DEBUG | ||
| RAPIDSMPF_NVTX_SCOPED_RANGE("check_fut_finish", in_transit_futures_.size()); | ||
| #endif | ||
| if (!in_transit_futures_.empty()) { | ||
| std::vector<ChunkID> finished = | ||
| shuffler_.comm_->test_some(in_transit_futures_); | ||
|
|
@@ -439,7 +455,9 @@ class Shuffler::Progress { | |
| std::unordered_map<Rank, std::vector<std::unique_ptr<Communicator::Future>>> | ||
| ready_ack_receives_; ///< Receives matching ready for data messages. | ||
|
|
||
| #if RAPIDSMPF_DEBUG | ||
| int64_t p_iters = 0; ///< Number of progress iterations (for NVTX) | ||
| #endif | ||
| }; | ||
|
|
||
| std::vector<PartID> Shuffler::local_partitions( | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.
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 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?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.
A
DEBUGmode macro came up in several discussions. So, I would like this to be used for not just nvtx annotations.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.
RAPIDSMPF_VERBOSEor simplyRAPIDSMPF_DETAIL?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 think
DEBUGis a more specific term IMO, I'd preferRAPIDSMPF_DETAIL. In any case, I think we should only enable it when explicitly specified, and not just depend onCMAKE_BUILD_TYPE=Debugto enable it by default.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.
Agree, let's not use
DEBUG.But
DETAILmight not be ideal either. It could be confused with ourdetailnamespace and with macros likeRAPIDSMPF_CONCAT_DETAIL_