Introduce callback registry for callback management #1237
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.
Summary
Central source of truth — Consolidates scattered CUPTI callback metadata (flow correlation, blocklist status) into a single registry. This will replace hardcoded checks throughout the codebase.
Minimal API — Exposes only 2 methods: requiresFlowCorrelation(domain, cbid) for CPU→GPU trace arrows and isBlocklisted(domain, cbid) for filtering noisy callbacks. Although we can add more, the overall idea should be to keep it minimal.
O(1) lookups — Uses separate std::unordered_map per domain (RUNTIME/DRIVER) with range support for memory operations, initialized lazily as a singleton.
Usage — TBD but this would be initialized before the profiling stage when deciding which callbacks to hook on to; and then used later when activity buffers are collected and are to be processed.
This PR in itself brings no material change to kineto. Future PR will refactor files to make use of this registry.
Note: this is different from
CuptiCallbackApi'sregisterCallbackwhich register generic function pointers to be called when CUPTI fires. WithCuptiCallbackRegistry, we want to store metadata/properties about CUPTI callbacks to help with post-processing (filtering, flow correlation checks, etc).