Bounded deep-profiling window + PC sampling collection fixes - #136
Merged
Conversation
…bounded deep-profiling window
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.
Description
Adds a bounded deep-profiling window and fixes the PC sampling bugs found while validating it.
Deep window
gpufl::deepWindow()plusgpufl trace --deep-after/--deep-for/--deep-launches/--deep-cooldown,so a long-running job can be deeply profiled for a slice of its life without editing its source.
Includes unit tests, CLI parse tests, and an e2e script + gpufl-agnostic CUDA target.
PC sampling fixes
Two independent bugs, both of which made
--passes PcSamplingcollect nothing:cuptiPCSamplingGetDataon an armed sampler returnsnothing and discards the buffer. The sampler is now armed once and read once, with sampling
stopped, at scope end. There is no working mid-run collect: stop/read/restart every second also
returns 0 and makes the target ~100x slower.
that window made
SetConfigurationAttribute— and then every later PC sampling call on thecontext — return
INVALID_OPERATION, which was being swallowed as benign and logged as success.Buffers are now allocated before Enable; configure failures are fatal and name the rejected
attribute.
Also corrects the guidance: collection scales with kernel-launch count, not wall time
(same 8s window: 876 launches → 0 samples, 2002 → 87.8M), so the 0-sample message and the
--deep-*help now point at--deep-launches. The old message's advice was counterproductive —a "heavier" workload means fewer launches, and a finer
--pc-sample-periodcut launches coveredfrom 992 to 58.
Type of Change
Testing
Checklist