Skip to content

[xpupti] Add XCCL collective communication activity tracing to XPU plugin#1396

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

[xpupti] Add XCCL collective communication activity tracing to XPU plugin#1396
tsocha wants to merge 11 commits into
pytorch:mainfrom
intel-staging:dev/tsocha/oneccl-3

Conversation

@tsocha

@tsocha tsocha commented May 11, 2026

Copy link
Copy Markdown
Contributor

It's a part of #1335 3/3

Enable PTI_VIEW_COMMUNICATION collection in the XPU PTI plugin so oneCCL host-side collective operations show up in Kineto traces. Events are emitted as COLLECTIVE_COMM activities named with an "xccl::" prefix and carry the PTI communicator id as metadata.

  • Gate new code paths on PTI_VERSION_AT_LEAST(0, 17)
  • Wire enable/disable of PTI_VIEW_COMMUNICATION in XpuptiActivityApi
  • Add handleCommunicationActivity for pti_view_record_comms records
  • Add unit tests covering naming, field mapping, and out-of-range drop
  • Document INTEL_LIBITTNOTIFY64 requirement in libkineto/README.md

Enable PTI_VIEW_COMMUNICATION collection in the XPU PTI plugin so oneCCL
host-side collective operations show up in Kineto traces. Events are
emitted as COLLECTIVE_COMM activities named with an "xccl::" prefix and
carry the PTI communicator id as metadata.

- Gate new code paths on PTI_VERSION_AT_LEAST(0, 17)
- Wire enable/disable of PTI_VIEW_COMMUNICATION in XpuptiActivityApi
- Add handleCommunicationActivity for pti_view_record_comms records
- Add unit tests covering naming, field mapping, and out-of-range drop
- Document INTEL_LIBITTNOTIFY64 requirement in libkineto/README.md
@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/XpuptiActivityApi.cpp Outdated
@tsocha tsocha requested a review from gujinghui May 12, 2026 09:50
Comment thread libkineto/README.md
The default trace output is a JSON file that can be visualized in Chrome Trace Viewer or Perfetto. The trace output is generated by the `ChromeTraceLogger` instance. The `ChromeTraceLogger` writes to a JSON file using `std::ofstream` in `output_json.cpp` to maximize performance during export. This instance is created by the `ActivityProfilerController` and is stored in the `ActivityLoggerFactory` alongside its protocol. Using this schema, Kineto supports multiple trace output formats.

- Intel XCCL: to enable collecting of oneCCL host events, `INTEL_LIBITTNOTIFY64` enviroment variable have to be set as path to `pti_view.so` location.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why does this need to be in the general instructions? Is this something that's covered in Intel's other docs? I'd like to keep this file short and general.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This env variable is required by ITT which is used by PTI to collect these events.
Without this variable user won't see oneCCL events in his trace.

I wanted to expose this information to avoid confusion of the Kineto user.

We are working to remove this requirement in the future but due to performance requirements of PTI integration it's not ready yet.

I could create a new README file inside xpupti plugin directory but I'm afraid that it will be hidden.

What do you think?

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tsocha Do we have public doc to explain this env var?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is some documentation related to V-tune and ITT:
https://www.intel.com/content/www/us/en/docs/vtune-profiler/user-guide/2025-4/attaching-itt-apis-to-a-launched-application.html

Unfortunately it's not directly related to Kineto.
In our case the PTI is a collector.

There is also a documentation of tests for ITT:
https://github.com/intel/ittapi/blob/master/src/ittnotify_refcol/README.md
Again, it's at least 2 levels lower than Kineto and we should not expect that user will know that he need to set an env variable for ITT -> which is used by PTI -> which is used by Kineto.

The best documentation I was able to get is PTI Known Issues section of the documentation:
https://intel.github.io/pti-gpu/knownissues.html

I want to avoid confusion from the user.
If the main README.md is not a good place for it, maybe we should create another one in XPUPTI plugin directory.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@scotts
README.md is clean again. Now, we emit a runtime warning.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@scotts Can you please review this PR. as it said README.md is clean
and all additional requirements will be documented at Intel PTI special page in a way specific to PyTorch profiler
thanks!

att @gujinghui

@tsocha tsocha requested a review from scotts May 21, 2026 10:23
@gujinghui

Copy link
Copy Markdown

@scotts please help review this PR. Thanks.

@tsocha tsocha changed the title Add XCCL collective communication activity tracing to XPU plugin [xpupti] Add XCCL collective communication activity tracing to XPU plugin Jun 24, 2026
@gujinghui

Copy link
Copy Markdown

@scotts @divyanshk @ryanzhang22
Could you please help review this PR? I would appreciate it if it could be included in the next PyTorch release. Thanks.

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

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

5 participants