Skip to content

Enable CUDA sync event correlation on CUDA 12.9+ - #1552

Open
benghaem wants to merge 1 commit into
pytorch:mainfrom
benghaem:export-D117757961
Open

Enable CUDA sync event correlation on CUDA 12.9+#1552
benghaem wants to merge 1 commit into
pytorch:mainfrom
benghaem:export-D117757961

Conversation

@benghaem

@benghaem benghaem commented Aug 27, 2026

Copy link
Copy Markdown

Summary:

Summary

CUDA 12.9 decoupled CUPTI_ACTIVITY_KIND_CUDA_EVENT from CUPTI_ACTIVITY_KIND_SYNCHRONIZATION. Kineto continued enabling only synchronization when sync events were requested, so CUDA 13 traces lacked event-record inputs and left wait_on_stream and wait_on_cuda_event_record_corr_id unresolved.

Changes

Update CuptiActivityApi.cpp to enable and disable CUPTI_ACTIVITY_KIND_CUDA_EVENT alongside synchronization activity collection on CUDA 12.9 and newer. The CUDA 13 device-timestamp opt-in remains unchanged, and the implementation is mirrored between fbcode and xplat.

Add an end-to-end profiler test that creates a cross-stream wait and verifies the exported trace contains resolved source-stream and event-correlation metadata. The test runs whenever Kineto is available without CUDA-version or ROCm gating, uses a backend-neutral name, and validates the metadata contract without depending on backend-specific category or event display strings.

Differential Revision: D117757961

@meta-cla meta-cla Bot added the cla signed label Aug 27, 2026
@meta-codesync

meta-codesync Bot commented Aug 27, 2026

Copy link
Copy Markdown

@benghaem has exported this pull request. If you are a Meta employee, you can view the originating Diff in D117757961.

Summary:
## Summary

CUDA 12.9 decoupled `CUPTI_ACTIVITY_KIND_CUDA_EVENT` from `CUPTI_ACTIVITY_KIND_SYNCHRONIZATION`. Kineto continued enabling only synchronization when sync events were requested, so CUDA 13 traces lacked event-record inputs and left `wait_on_stream` and `wait_on_cuda_event_record_corr_id` unresolved.

## Changes

Update `CuptiActivityApi.cpp` to enable and disable `CUPTI_ACTIVITY_KIND_CUDA_EVENT` alongside synchronization activity collection on CUDA 12.9 and newer. The CUDA 13 device-timestamp opt-in remains unchanged, and the implementation is mirrored between fbcode and xplat.

Add an end-to-end profiler test that creates a cross-stream wait and verifies the exported trace contains resolved source-stream and event-correlation metadata. The test runs whenever Kineto is available without CUDA-version or ROCm gating, uses a backend-neutral name, and validates the metadata contract without depending on backend-specific category or event display strings.

Differential Revision: D117757961
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant