-
Notifications
You must be signed in to change notification settings - Fork 220
Introduce XPU scope profiler extending existing XPU profiler plugin #1174
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
@moksiuc It's great that we are going to update our PTI integration code, and introduce new profiler path.
|
|
For sure not in this PR. I'll add this to our list of tasks. |
Extracted clean up and adding config for scope profiler to separate PR's. |
- place of config initialization - removal of passing unused C compiler flag into test cmake file
gujinghui
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
@moksiuc Let's close this PR. |
|
@gujinghui this is the core of the scope profiler. When 2 smaller parts are merged this one would have only core profiler left. |
Otherwise old profiler requires setting ZET_ENABLE_METRICS what is incorrect requirement.
|
@EikanWang, @gujinghui |
|
Tests are run on pytorch part: |
gujinghui
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. I assume you already verified it on local real machine, right? @moksiuc
Yes, I did. |
|
@malfet @sraikund16 could you help review this PR? Thanks. |
|
@malfet @sraikund16 could you review, please ? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR. I'm ramping up on this space. I'm curious to understand how much does it differ from the existing XPU profiler - maybe it should exist as a separate class in itself ? How can I learn more about the scope profiler ?
Also, thank you for adding tests.
| #endif | ||
|
|
||
| void XpuptiActivityApi::enableXpuptiActivities( | ||
| #if PTI_VERSION_AT_LEAST(0, 15) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: XPUPTI_VERSION_AT_LEAST would be a better name for this macro. I can update that later (not relevant for this PR).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, thanks for hint. I can update it if I have to make any other update in the code and push new commit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After thinking about it XPUPTI_VERSION_AT_LEAST might be misleading as it is not xpupti version (that is part of kineto) but the PTI component version that xpupti uses underneath. Actually there is whole PTI api referenced starting with pti* prefix and PTI_VERSION_AT_LEAST refers to version of that api.
This PR adds new activity ActivityType::XPU_SCOPE_PROFILER, accepted by XPU profiler. With this new mode enabled XPU profiler additionally gathers requested HW metrics. |
Hi @divyanshk , For more details of CuptiRangeProfiler, please see this page. https://deepwiki.com/pytorch/kineto/3.1-nvidia-gpu-support-(cupti)#4-cupti-range-profiler-integration @moksiuc is going to provide similar functionalities on XPU in this PR. |
|
Hi, @moksiuc, I'm also a new maintainer to this library. Thanks for all of the recent cleanup PRs! On this PR, I have a similar concern that @divyanshk does on the code structuring. Specifically, this code uses We should be able to achieve the same functionality by defining |
Summary:
As XPU became a PyTorch built-in device, the profiler support is indispensable part of functionality completeness. In this PR, the XPU scope profiler is introduced by extending existing XPU profiler plugin. The XPU scope profiler is built on the foundation of intel PTI toolkit (https://github.com/intel/pti-gpu), and underlying SYCL runtime. It allows to gather XPU hardware metrics. The LIBKINETO_NOXPUPTI option is used to enable or disable the whole XPU profiler plugin during kineto build stage.
Changes: