[WIP] Extend memory tracking resources tool#3051
Open
huuanhhuyn wants to merge 2 commits into
Open
Conversation
8d634df to
9ed0e23
Compare
9ed0e23 to
ef5b83f
Compare
ef5b83f to
e852f30
Compare
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.
NVTX range labels can be mis-attributed in
memory_tracking_resourcesCSVIssue summary
In the CSV produced by the
raft::memory_tracking_resources, an allocation can be recorded under the wrongnvtx_range. The allocation size is correct, only the nvtx range label is incorrect. This issue is reproduced in a unit test of this PR.Root cause
Stats are recorded on two different timelines:
instant
allocate()/deallocate()is called.which reads the currently active NVTX range at the moment it writes the row -> here.
The peak is an interval maximum (it persists until the next row resets it), but
the range label is a point-in-time read. If the sampler lags past a range
boundary — e.g. during a large/slow allocation+free — it stamps the carried-over
peak with whatever currently active range, not the range active when the allocation occured.
Issue Reproduction
The
MemoryTrackingResources.MismatchedRangeLabelingtest allocates, insidethree consecutive NVTX ranges:
1. expect 10 KB2. expect 1 GiB3. expect 4 MiB""""range 2 has already been popped, landing on range 3
Consequently, we get a misleading profiling result where an allocation can be associated with a wrong range.
Desired Behavior