Skip to content
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

[XPU profiler] Introduce XPU profiler by following kineto plugin design #961

Closed
wants to merge 1 commit into from

Conversation

zejun-chen
Copy link
Contributor

@zejun-chen zejun-chen commented Jul 16, 2024

As XPU became a PyTorch built-in device, the profiler support is indispensable part of functionality completeness. In this PR, the XPU profiler is introduced by following kineto plugin design under libkineto/src/plugin/xpupti. The XPU profiler plugin is built on the foundation of intel PTI toolkit (https://github.com/intel/pti-gpu), and underlying SYCL runtime. The LIBKINETO_NOXPUPTI option is added to enable or disable the XPU profiler plugin during kineto build stage.

CC: @aaronenyeshi @briancoutinho @davidberard98 @sraikund16

@facebook-github-bot
Copy link
Contributor

Hi @zejun-chen!

Thank you for your pull request.

We require contributors to sign our Contributor License Agreement, and yours needs attention.

You currently have a record in our system, but the CLA is no longer valid, and will need to be resubmitted.

Process

In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at [email protected]. Thanks!

@facebook-github-bot
Copy link
Contributor

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks!

@gujinghui
Copy link

@aaronenyeshi could you help review?

The associated PR in pytorch is pytorch/pytorch#130811

Thanks.

Copy link
Member

@aaronenyeshi aaronenyeshi left a comment

Choose a reason for hiding this comment

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

please check and fix broken CI signals

@gujinghui
Copy link

gujinghui commented Jul 23, 2024

please check and fix broken CI signals

@zejun-chen pls. follow and fix. Thanks.

@zejun-chen zejun-chen force-pushed the zejun/xpu_profiler_3 branch from 386f0ed to 561c1d8 Compare July 24, 2024 01:41
@zejun-chen
Copy link
Contributor Author

please check and fix broken CI signals

Hi, @aaronenyeshi

Thank you for review 👍. Fix the CI error and wait for new CI result.
Here is our RFC for the PR: #962
Could you help review?

Thank you.

@zejun-chen zejun-chen force-pushed the zejun/xpu_profiler_3 branch from 561c1d8 to 4fe8c30 Compare July 24, 2024 02:48
@zejun-chen
Copy link
Contributor Author

Hi, @aaronenyeshi

The new CI failure is caused by the missing file cupti.h. Could you help take a look at the CI env?

[ 32%] Building CXX object CMakeFiles/kineto_base.dir/src/CuptiNvPerfMetric.cpp.o
[ 35%] Building CXX object CMakeFiles/kineto_base.dir/src/Demangle.cpp.o
In file included from /home/runner/work/kineto/kineto/libkineto/src/CuptiMetricApi.cpp:9:
/home/runner/work/kineto/kineto/libkineto/src/CuptiMetricApi.h:11:10: fatal error: cupti.h: No such file or directory
   11 | #include <cupti.h>
      |          ^~~~~~~~~
compilation terminated.

Thank you

@zejun-chen zejun-chen force-pushed the zejun/xpu_profiler_3 branch 2 times, most recently from 7ce7bd0 to 0f96de9 Compare August 2, 2024 01:33
As XPU became a PyTorch built-in device, the profiler support
is indispensable part of functionality completeness. In this PR,
the XPU profiler is introduced by following kineto plugin design
under libkineto/src/plugin/xpupti. The XPU profiler plugin is
built on the foundation of intel PTI toolkit (https://github.com/intel/pti-gpu),
and underlying SYCL runtime. The LIBKINETO_NOXPUPTI option is
added to enable or disable the XPU profiler plugin during kineto
build stage.

Signed-off-by: Chen, Zejun <[email protected]>
@zejun-chen zejun-chen force-pushed the zejun/xpu_profiler_3 branch from 0f96de9 to 626fa32 Compare August 2, 2024 02:13
@zejun-chen
Copy link
Contributor Author

zejun-chen commented Aug 5, 2024

Hi, @aaronenyeshi

The XPU profiler is targeting PT 2.5(6th. Sep). We need to land the feature before the timeline. Could you help review?
Thank you for any comments. :)

Thank you.

Copy link
Member

@aaronenyeshi aaronenyeshi left a comment

Choose a reason for hiding this comment

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

Looks great! Thank you for creating a subfolder plugin/xpupti for the XPU profiler. I am happy to help merge any diffs into xpupti.

@facebook-github-bot
Copy link
Contributor

@aaronenyeshi has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@facebook-github-bot
Copy link
Contributor

@aaronenyeshi merged this pull request in 0cded49.

@zejun-chen
Copy link
Contributor Author

zejun-chen commented Aug 7, 2024

Hi, @aaronenyeshi

Thank you for help! Really appreciate that!
Could you help review pytorch/pytorch#130811? It enables the build option for XPUPTI in kineto.

Thank you.

LucasLLC pushed a commit to LucasLLC/pytorch that referenced this pull request Aug 7, 2024
…130811)

As XPU became a PyTorch built-in device, the profiler support is indispensable part of functionality completeness. This PR is associated with the PR to introduce XPU profiler plugin into the kineto. When USE_XPU is enabled, the LIBKINETO_NOXPUPTI option will be suppressed accordingly, which allows kineto to build with XPU profiler plugin.

Associated PR to introduce kineto-based XPU profiler into kineto:
pytorch/kineto#961

Also updates the Kineto Submodule to include XPU changes.

Co-authored-by: Aaron Enye Shi <[email protected]>
Pull Request resolved: pytorch#130811
Approved by: https://github.com/aaronenyeshi
staugust pushed a commit to staugust/kineto that referenced this pull request Aug 27, 2024
Summary:
As XPU became a PyTorch built-in device, the profiler support is indispensable part of functionality completeness. In this PR, the XPU profiler is introduced by following kineto plugin design under libkineto/src/plugin/xpupti. The XPU profiler plugin is built on the foundation of intel PTI toolkit (https://github.com/intel/pti-gpu), and underlying SYCL runtime. The LIBKINETO_NOXPUPTI option is added to enable or disable the XPU profiler plugin during kineto build stage.

CC: aaronenyeshi briancoutinho davidberard98 sraikund16

Pull Request resolved: pytorch#961

Reviewed By: xuzhao9

Differential Revision: D60830913

Pulled By: aaronenyeshi

fbshipit-source-id: a24444e1ab1ed074bfcf5a9012076fa7c193b178
staugust pushed a commit to staugust/kineto that referenced this pull request Aug 27, 2024
Summary:
As XPU became a PyTorch built-in device, the profiler support is indispensable part of functionality completeness. In this PR, the XPU profiler is introduced by following kineto plugin design under libkineto/src/plugin/xpupti. The XPU profiler plugin is built on the foundation of intel PTI toolkit (https://github.com/intel/pti-gpu), and underlying SYCL runtime. The LIBKINETO_NOXPUPTI option is added to enable or disable the XPU profiler plugin during kineto build stage.

CC: aaronenyeshi briancoutinho davidberard98 sraikund16

Pull Request resolved: pytorch#961

Reviewed By: xuzhao9

Differential Revision: D60830913

Pulled By: aaronenyeshi

fbshipit-source-id: a24444e1ab1ed074bfcf5a9012076fa7c193b178
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.

4 participants