Skip to content

Add XPU synchronization events to XPUPTI profiler#1395

Open
tsocha wants to merge 5 commits into
pytorch:mainfrom
intel-staging:dev/tsocha/oneccl-2
Open

Add XPU synchronization events to XPUPTI profiler#1395
tsocha wants to merge 5 commits into
pytorch:mainfrom
intel-staging:dev/tsocha/oneccl-2

Conversation

@tsocha

@tsocha tsocha commented May 11, 2026

Copy link
Copy Markdown

It's a part of #1335 2/3

Introduce a new ActivityType::XPU_SYNC that surfaces device synchronization records from PTI_VIEW_DEVICE_SYNCHRONIZATION in the XPUPTI plugin.

  • Register XPU_SYNC in ActivityType (value 27) and update ENUM_COUNT / name table.
  • Enable/disable PTI_VIEW_DEVICE_SYNCHRONIZATION alongside the other XPUPTI activity kinds.
  • Add handleSynchronizationActivity, including a synchronization-type -> string map, GPU vs. host barrier accounting, and metadata (context/queue/event handles, wait-event count, return code).
  • Generalize getApiName into a template so it works for both API and synchronization records; move it to the header.
  • Route PTI_VIEW_DEVICE_SYNCHRONIZATION in handlePtiActivity.
  • Cover the new handler with unit tests in XpuptiActivityHandlersTest.cpp.

Introduce a new ActivityType::XPU_SYNC that surfaces device
synchronization records from PTI_VIEW_DEVICE_SYNCHRONIZATION
in the XPUPTI plugin.

- Register XPU_SYNC in ActivityType (value 27) and update
  ENUM_COUNT / name table.
- Enable/disable PTI_VIEW_DEVICE_SYNCHRONIZATION alongside the
  other XPUPTI activity kinds.
- Add handleSynchronizationActivity, including a
  synchronization-type -> string map, GPU vs. host barrier
  accounting, and metadata (context/queue/event handles,
  wait-event count, return code).
- Generalize getApiName into a template so it works for both
  API and synchronization records; move it to the header.
- Route PTI_VIEW_DEVICE_SYNCHRONIZATION in handlePtiActivity.
- Cover the new handler with unit tests in
  XpuptiActivityHandlersTest.cpp.
@meta-cla meta-cla Bot added the cla signed label May 11, 2026
@tsocha

tsocha commented May 11, 2026

Copy link
Copy Markdown
Author

@gujinghui please review it.

Comment thread libkineto/src/plugin/xpupti/XpuptiActivityProfilerSession.h
@tsocha tsocha requested a review from gujinghui May 13, 2026 11:45
@gujinghui

Copy link
Copy Markdown

@divyanshk @scotts This PR is ready for your review. Thanks.

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.

2 participants