Skip to content
This repository was archived by the owner on Sep 30, 2026. It is now read-only.

[XPU] Improve include hygiene in the XPU PTI Kineto plugin - #1548

Merged
ryanzhang22 merged 2 commits into
pytorch:mainfrom
intel-staging:dev/pawelswi/improve-includes
Sep 1, 2026
Merged

ryanzhang22 merged 2 commits into
pytorch:mainfrom
intel-staging:dev/pawelswi/improve-includes

Conversation

@PawelSwider2000

Copy link
Copy Markdown
Contributor

This PR makes the XPU PTI plugin headers and sources explicitly include the types, utilities, and PTI APIs they use.

  • Adds missing direct project, standard-library, fmt, PTI dependencies across the XPU activity and scope-profiler components.
  • Removes unused or unnecessary transitive dependencies, including redundant headers from the activity and scope-profiler paths.
  • Normalizes include ordering with Kineto’s configured clang-format.

The changes are make based on: pytorch/tools/iwyu/run.sh - without applying suggestion regarding sycl.hpp includes

@meta-cla meta-cla Bot added the cla signed label Aug 26, 2026
@PawelSwider2000

Copy link
Copy Markdown
Contributor Author

@gujinghui Please review

@PawelSwider2000

Copy link
Copy Markdown
Contributor Author

@pytorchbot label "ciflow/xpu"

@pytorch-bot

pytorch-bot Bot commented Aug 26, 2026

Copy link
Copy Markdown

The ciflow label(s) ciflow/xpu will be added, but CI won't be triggered until the workflows are approved (scroll to the bottom of this page).

Please ping one of the reviewers if you do not have access to approve and run workflows.

@pytorch-bot

pytorch-bot Bot commented Aug 26, 2026 •

Copy link
Copy Markdown

Workflows were awaiting approval. CI has now been triggered for the ciflow labels on this PR.

Drop the duplicate <pti/pti_view.h> left behind in XpuptiActivityApi.h.
Replace the libstdc++-internal <bits/std_abs.h> with <cstdlib> and
qualify the call as std::abs so the plugin builds on MSVC and libc++.
Include <iostream> where std::cerr is used instead of relying on a
transitive include, and use quoted includes for libkineto headers in
XpuptiScopeProfilerSession.h.
@PawelSwider2000
PawelSwider2000 marked this pull request as ready for review August 31, 2026 05:03
@PawelSwider2000

Copy link
Copy Markdown
Contributor Author

@ryanzhang22 @scotts Please review

@aostrowski-hbn

Copy link
Copy Markdown
Contributor

@pytorchbot merge

@pytorch-bot

pytorch-bot Bot commented Sep 1, 2026

Copy link
Copy Markdown

Mergebot is not configured for this repository. Please use the merge button provided by GitHub.

@aostrowski-hbn

Copy link
Copy Markdown
Contributor

@ryanzhang22 please merge

@ryanzhang22
ryanzhang22 merged commit 760cbb0 into pytorch:main Sep 1, 2026
12 checks passed
aostrowski-hbn added a commit to aostrowski-hbn/kineto_intel that referenced this pull request Sep 2, 2026
Conflict came from the XPU plugin include-hygiene change (pytorch#1548), which
regrouped the includes in XpuptiScopeProfilerApi.cpp. Keep main's layout
(own header, project headers, sorted std, then third-party) and fold this
branch's additions into it: <span> and <utility> join the std group,
fmt/format.h the third-party group.

Two follow-ups for the same convention: the std includes this branch added
to XpuptiScopeProfilerConfig.cpp move ahead of the fmt block, and
XpuptiScopeProfilerApi.h now includes pti/pti.h explicitly, since it
declares selectDeviceHandles in terms of pti_device_handle_t and pytorch#1548
dropped the header that used to pull pti/pti.h in transitively.
pytorchmergebot pushed a commit to pytorch/pytorch that referenced this pull request Sep 4, 2026
  Includes the following commits:

  - [xpupti] Report the hardware engine per GPU op via PTI v2 records (pytorch/kineto#1555) 8b682ab
  - [Kineto] Reintroduce Windows timestamp fix in CUPTI test (pytorch/kineto#1556) 95fbe6f
  - [xpupti] Support more than 1 device in ptiMetricsScopeConfigure (pytorch/kineto#1479) 29a6d74
  - [XPUPTI] Fix buffer lifetime and report processed-record stats with some minor improvements. (pytorch/kineto#1553) 33b47f8
  - [XPU] Improve include hygiene in the XPU PTI Kineto plugin (pytorch/kineto#1548) 760cbb0
Pull Request resolved: #196015
Approved by: https://github.com/Skylion007
Sanskaaar1 pushed a commit to Sanskaaar1/pytorch that referenced this pull request Sep 8, 2026
  Includes the following commits:

  - [xpupti] Report the hardware engine per GPU op via PTI v2 records (pytorch/kineto#1555) 8b682ab
  - [Kineto] Reintroduce Windows timestamp fix in CUPTI test (pytorch/kineto#1556) 95fbe6f
  - [xpupti] Support more than 1 device in ptiMetricsScopeConfigure (pytorch/kineto#1479) 29a6d74
  - [XPUPTI] Fix buffer lifetime and report processed-record stats with some minor improvements. (pytorch/kineto#1553) 33b47f8
  - [XPU] Improve include hygiene in the XPU PTI Kineto plugin (pytorch/kineto#1548) 760cbb0
Pull Request resolved: pytorch#196015
Approved by: https://github.com/Skylion007
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants