Extend memory tracking resources#3051
Open
huuanhhuyn wants to merge 5 commits into
Open
Conversation
ef5b83f to
e852f30
Compare
e852f30 to
f4e4cee
Compare
32d3c6c to
455f959
Compare
455f959 to
a315972
Compare
achirkin
requested changes
Jul 1, 2026
Contributor
There was a problem hiding this comment.
From the description it follows that the new queue approach attaches NVTX annotations to the allocation events one-to-one. If so, it seems logical that NVTX annotations should be pulled from the allocating thread during the allocation rather than from the main thread. Then you'd also not need mutex locking of nvtx records since they are not accessed across threads.
Please refactor this as a separate resource type rather than changing the behavior of the existing resource, because the difference is significant.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Extend memory tracking resources with another queue-based approach (as opposed to the current sampling-rate notification approach).
Usage:
If the sampling interval is given, the notification approach is selected:
raft::memory_tracking_resources tracked(res, oss, 1ms);If it is NOT given, the queue-based approach is selected:
raft::memory_tracking_resources tracked(res, oss);Compare two approaches:
Unit test benchmark (H100, 64 threads, each thread 200x allocations, each allocation 256KiB):