tutorials icon indicating copy to clipboard operation
tutorials copied to clipboard

Patched docs for torch_compile_tutorial

Open ignaciobartol opened this issue 1 year ago • 8 comments

Fixes #2858

Description

Based on the discussion on #2858 I added a few examples on how to use torch.compile in nested modules and functions. Also, I added a few lines for "Best practices" to debug if there is a compilation problem and also how to disable a function from being compiled (along with its children functions) using torch.compiler.disable.

Let me know if anything can be improved in the tutorial and I will work on it. As a side note, from this issue in pytorch, I am not sure if torch.compiler.disable is working properly, but I used as specified as in the docs here

Checklist

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

cc @williamwen42 @msaroufim @sekyondaMeta @svekars @kit1980 @brycebortree

ignaciobartol avatar Jun 16 '24 17:06 ignaciobartol

:link: Helpful Links

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

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

:white_check_mark: No Failures

As of commit f36b152c962af364c08b341463a893651d4c738c with merge base e07d43bb7b9b3e84c5682eb5b0cb8c07e2d35051 (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 Jun 16 '24 17:06 pytorch-bot[bot]

I think this doc update would be better placed in the troubleshooting tutorial (@mlazos is working on this and will have an update soon).

Thanks @williamwen42 for the review and the great feedback! I will work on them. Once I have an update on which doc to contribute I will create a new commit.

ignaciobartol avatar Jun 17 '24 20:06 ignaciobartol

@pytorchbot rebase

ignaciobartol avatar Jun 24 '24 12:06 ignaciobartol

You don't have permissions to rebase this PR since you are a first time contributor. If you think this is a mistake, please contact PyTorch Dev Infra.

pytorch-bot[bot] avatar Jun 24 '24 12:06 pytorch-bot[bot]

Thanks @ignaciobartol, this looks like a good tutorial! I think we should add a section called "Best Practices for Onboarding a New Model" to https://pytorch.org/docs/stable/torch.compiler_troubleshooting.html and add your best practices section to that. You can also link to it from your tutorial as well. The rest of the troubleshooting doc is a bit outdated and I'll be revamping that next week.

mlazos avatar Jun 25 '24 01:06 mlazos

Content looks good, but can you fix any formatting issues that you see in the doc preview?

Also waiting for response from @mlazos to see where this change should go

Thanks! I am not sure what I am seeing in my build of the docs differs from what is on the preview (See screenshot below). Any ideas of why this may be happening?

torch_compile_build

ignaciobartol avatar Jun 25 '24 06:06 ignaciobartol

From publishing perspective the PR looks good to me. @mlazos - did you mean that this should be moved to torch.compiler troubleshooting instead of being here?

svekars avatar Jun 25 '24 22:06 svekars

From publishing perspective the PR looks good to me. @mlazos - did you mean that this should be moved to torch.compiler troubleshooting instead of being here?

Thanks @svekars for fixing the formatting errors. Once we have more information about this I can ago ahead and apply those changes

ignaciobartol avatar Jun 28 '24 05:06 ignaciobartol

From publishing perspective the PR looks good to me. @mlazos - did you mean that this should be moved to torch.compiler troubleshooting instead of being here?

Correct, it was just a suggestion, I'm okay either way.

mlazos avatar Aug 20 '24 14:08 mlazos