tutorials icon indicating copy to clipboard operation
tutorials copied to clipboard

Updated Doc for Intel XPU Profile

Open louie-tsai opened this issue 1 year ago • 6 comments

Description

PyTorch Profiling changes for XPU.

Landing page: https://pytorch.org/tutorials/recipes/recipes/profiler_recipe.html https://pytorch.org/tutorials/recipes/profile_with_itt.html

Checklist

  • [ ] The issue that is being fixed is referred in the description (see above "Fixes #ISSUE_NUMBER")
  • [ ] Only one issue is addressed in this pull request
  • [ ] Labels from the issue that this PR is fixing are added to this pull request
  • [ ] No unnecessary issues are included into this pull request.

cc @gujinghui @EikanWang @fengyuan14 @guangyey

louie-tsai avatar Aug 26 '24 22:08 louie-tsai

:link: Helpful Links

:test_tube: See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/tutorials/3013

Note: Links to docs will display an error until the docs builds have been completed.

:heavy_exclamation_mark: 1 Active SEVs

There are 1 currently active SEVs. If your PR is affected, please view them below:

:white_check_mark: No Failures

As of commit a5408b184f63e63b8ea2980334cfa25ccf58cfdb with merge base b7250323251f87f94d977386965c7cab092d642d (image): :green_heart: Looks good so far! There are no failures yet. :green_heart:

This comment was automatically generated by Dr. CI and updates every 15 minutes.

pytorch-bot[bot] avatar Aug 26 '24 22:08 pytorch-bot[bot]

Hi @louie-tsai!

Thank you for your pull request and welcome to our community.

Action Required

In order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you.

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 avatar Aug 26 '24 22:08 facebook-github-bot

Changes to profile_with_itt looks fine to me, but changes to profiler_recpie makes it really hard to read. Perhaps one should try to find an easier to use interface for collecting/analyzing profiler information from accelerators?

@malfet The profiler_recipe contents will also be populated into a html file : https://pytorch.org/tutorials/recipes/recipes/profiler_recipe.html Hope that html file format addresses your concern for "hard to read".

louie-tsai avatar Sep 16 '24 23:09 louie-tsai

The profiler_recipe contents will also be populated into a html file : https://pytorch.org/tutorials/recipes/recipes/profiler_recipe.html Hope that html file format addresses your concern for "hard to read".

Sorry, I was not talking about this one, but rather about the following code:

if device == 'cuda':
   activities.append(ProfilerActivity.CUDA)
elif device == 'xpu':
   activities.append(ProfilerActivity.XPU)

As one can not compile PyTorch with CUDA and XPU at the same time, why introducing new enum rather than creating an alias(i.e. ProfilerActivity.XPU == ProfilerActivity.CUDA), so that users do not have to rewrite their programs when migrating from one accelerator to another?

malfet avatar Sep 16 '24 23:09 malfet

The profiler_recipe contents will also be populated into a html file : https://pytorch.org/tutorials/recipes/recipes/profiler_recipe.html Hope that html file format addresses your concern for "hard to read".

Sorry, I was not talking about this one, but rather about the following code:

if device == 'cuda':
   activities.append(ProfilerActivity.CUDA)
elif device == 'xpu':
   activities.append(ProfilerActivity.XPU)

As one can not compile PyTorch with CUDA and XPU at the same time, why introducing new enum rather than creating an alias(i.e. ProfilerActivity.XPU == ProfilerActivity.CUDA), so that users do not have to rewrite their programs when migrating from one accelerator to another?

Hi @malfet , it doesn't seem to be something can be fixed in this tutorial. It involves code changes. We will see how to address this concern in 2.6 with a separate PR to change profiler code.

jingxu10 avatar Sep 18 '24 03:09 jingxu10

As one can not compile PyTorch with CUDA and XPU at the same time

@malfet : why? this should be technically possible if someone will install both CUDA and XPU stacks on the system. And might be convenient for some people (mostly for debug I guess) to build pytorch with both path enabled in a single build.

dvrogozh avatar Sep 18 '24 14:09 dvrogozh

As one can not compile PyTorch with CUDA and XPU at the same time

@malfet : why? this should be technically possible if someone will install both CUDA and XPU stacks on the system. And might be convenient for some people (mostly for debug I guess) to build pytorch with both path enabled in a single build.

@malfet Any feedback? Ex: some laptops also have both Intel iGPU and NVidia dGPU at the same time, so it might be common to have both XPU and CUDA.

louie-tsai avatar Oct 02 '24 18:10 louie-tsai

@malfet @jingxu10 @dvrogozh @guangyey please help to merge it if no concern for the change.

thanks!

louie-tsai avatar Oct 09 '24 18:10 louie-tsai

@malfet updated accordingly. hope it works for you.

louie-tsai avatar Oct 15 '24 22:10 louie-tsai

To fix spelling, please add these to the en-wordlist.txt:

  • _batch_norm_impl_index
  • convolution_overrideable
  • aten
  • XPU

svekars avatar Oct 16 '24 16:10 svekars

To fix spelling, please add these to the en-wordlist.txt:

  • _batch_norm_impl_index
  • convolution_overrideable
  • aten
  • XPU

addressed them accordingly. please also help to approve it if all look good to you.

louie-tsai avatar Oct 22 '24 18:10 louie-tsai