Skip to content

[xpupti] Add XPU synchronization events to XPUPTI profiler - #1395

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

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

Conversation

@tsocha

@tsocha tsocha commented May 11, 2026

Copy link
Copy Markdown
Contributor

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
Contributor 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.

@tsocha tsocha changed the title Add XPU synchronization events to XPUPTI profiler [xpupti] Add XPU synchronization events to XPUPTI profiler Jun 24, 2026
@ZhaoqiongZ ZhaoqiongZ moved this to Aged Pending Review in PyTorch Intel Jul 6, 2026
@gujinghui

Copy link
Copy Markdown

@scotts @ryanzhang22
Could you please help review this PR?

@meta-codesync

meta-codesync Bot commented Jul 16, 2026

Copy link
Copy Markdown

@ryanzhang22 has imported this pull request. If you are a Meta employee, you can view this in D112382372.

@tsocha

tsocha commented Jul 20, 2026

Copy link
Copy Markdown
Contributor Author

@ryanzhang22 The CI passed, could you merge it?

@ryanzhang22

Copy link
Copy Markdown
Contributor

this is landing internally and will get synced here soon. it's just being slow to test.

@tsocha

tsocha commented Jul 23, 2026

Copy link
Copy Markdown
Contributor Author

this is landing internally and will get synced here soon. it's just being slow to test.

I see, thank you for the update.

@meta-codesync meta-codesync Bot closed this in 8285e5b Jul 23, 2026
@meta-codesync meta-codesync Bot added the Merged label Jul 23, 2026
@meta-codesync

meta-codesync Bot commented Jul 23, 2026

Copy link
Copy Markdown

@ryanzhang22 merged this pull request in 8285e5b.

@tsocha
tsocha deleted the dev/tsocha/oneccl-2 branch July 24, 2026 08:59
pytorchmergebot pushed a commit to pytorch/pytorch that referenced this pull request Jul 30, 2026
Includes the following commits:

- Clean up dtypes for metadata fields (pytorch/kineto#1499) 6f446fe
- [xpupti] Fix Windows build support for xpupti tests and multi-config generators. (pytorch/kineto#1394) 9e826ca
- Test ConfigLoader on-demand daemon poll ingress (pytorch/kineto#1504) 7674d28
- Remove comment about documentation (pytorch/kineto#1503) eeb3db9
- Remove HTA from README (pytorch/kineto#1502) 46b1c63
- Catch config-update exceptions so the poll thread can't crash the process (pytorch/kineto#1498) be334e1
- Drop EventProfiler config kind from ConfigLoader (pytorch/kineto#1496) e7c97a6
- Remove event-only config surface from Config (pytorch/kineto#1495) a3a0566
- Remove dead event profiler: runtime, CUPTI backends, build wiring (pytorch/kineto#1494) 36c2e05
- Decompose libkineto_defs.bzl source lists into atoms (pytorch/kineto#1493) 328fa51
- Add XPU synchronization events to XPUPTI profiler (pytorch/kineto#1395) 8285e5b
- Re-enable CI linting and lint all C++ (pytorch/kineto#1489) 2c41c01
- Test ConfigLoader handler fan-out (pytorch/kineto#1487) cccc5d1
- Update C++ lint tooling (pytorch/kineto#1488) 57e59e6
Pull Request resolved: #191526
Approved by: https://github.com/scotts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Aged Pending Review

Development

Successfully merging this pull request may close these issues.

4 participants