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

Update outdated docs for torch logs #3127

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

nluu175
Copy link

@nluu175 nluu175 commented Oct 30, 2024

Fixes #137285

Description

Update Python code to better address the usage of python logging and torch.compile.

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 @williamwen42 @msaroufim @anijain2305

Copy link

pytorch-bot bot commented Oct 30, 2024

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/tutorials/3127

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

❗ 1 Active SEVs

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

❌ 1 New Failure

As of commit 26d2b0e with merge base 0088d45 (image):

NEW FAILURE - The following job has failed:

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

@nluu175 nluu175 changed the title Modify example code to fix torch logs doc Update outdated docs for torch logs Oct 30, 2024
@nluu175
Copy link
Author

nluu175 commented Oct 30, 2024

@ezyang could you please give me some feedbacks on this fix?

@nluu175
Copy link
Author

nluu175 commented Oct 30, 2024

@pytorchbot label "torch.compile"

Copy link

pytorch-bot bot commented Oct 30, 2024

Didn't find following labels among repository labels: module: logging

@svekars svekars requested a review from mlazos October 30, 2024 15:11
@svekars svekars added the torch.compile Torch compile and other relevant tutorials label Oct 30, 2024
@ezyang
Copy link
Contributor

ezyang commented Oct 31, 2024

TBH, maybe we should introduce tlparse here, it's much better for looking at the output code bits. Description at https://docs.google.com/document/d/1y5CRfMLdwEoF1nTk9q8qEu1mgMUuUtvhklPKJ2emLU8/edit?tab=t.0#heading=h.u9711c2s6w0c

@nluu175
Copy link
Author

nluu175 commented Oct 31, 2024

TBH, maybe we should introduce tlparse here, it's much better for looking at the output code bits. Description at https://docs.google.com/document/d/1y5CRfMLdwEoF1nTk9q8qEu1mgMUuUtvhklPKJ2emLU8/edit?tab=t.0#heading=h.u9711c2s6w0c

Thank you! I'll take a look at it.

@ezyang
Copy link
Contributor

ezyang commented Nov 7, 2024

waiting for render

Copy link
Contributor

@svekars svekars left a comment

Choose a reason for hiding this comment

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

A few editorial suggestions.

separator("")
######################################################################
# Use TORCH_TRACE/tlparse to produce produce compilation reports
# ~~~~~~~~~~
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
# ~~~~~~~~~~
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


separator("")
######################################################################
# Use TORCH_TRACE/tlparse to produce produce compilation reports
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
# Use TORCH_TRACE/tlparse to produce produce compilation reports
# Using ``TORCH_TRACE/tlparse`` to produce produce compilation reports

# Use TORCH_TRACE/tlparse to produce produce compilation reports
# ~~~~~~~~~~
#
# In this section, we introduce the usage of TORCH_TRACE and tlparse to produce reports.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
# In this section, we introduce the usage of TORCH_TRACE and tlparse to produce reports.
# In this section, we introduce ``TORCH_TRACE`` and ``tlparse`` to produce reports.

# ~~~~~~~~~~
#
# In this section, we introduce the usage of TORCH_TRACE and tlparse to produce reports.
# First, we run `TORCH_TRACE="/tmp/tracedir" python script.py` to generate the raw trace logs.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
# First, we run `TORCH_TRACE="/tmp/tracedir" python script.py` to generate the raw trace logs.
#
# 1. Generate the raw trace logs by running the following command:
#
# .. code-block:: bash
#
# TORCH_TRACE="/tmp/tracedir" python script.py`
#

#
# In this section, we introduce the usage of TORCH_TRACE and tlparse to produce reports.
# First, we run `TORCH_TRACE="/tmp/tracedir" python script.py` to generate the raw trace logs.
# We have replace `/tmp/tracedir` with a path to a directory you want to store the trace logs
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
# We have replace `/tmp/tracedir` with a path to a directory you want to store the trace logs
# Ensure you replace ``/tmp/tracedir`` with the path to the directory where you want to store the trace logs

Comment on lines 104 to 105
# `pip install tlparse` and then `tlparse /tmp/tracedir`. This will open up your browser with
# HTML like generated above.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
# `pip install tlparse` and then `tlparse /tmp/tracedir`. This will open up your browser with
# HTML like generated above.
# This will open your browser with the HTML-like generated above.
#

# `pip install tlparse` and then `tlparse /tmp/tracedir`. This will open up your browser with
# HTML like generated above.
#
# By default, reports generated by `tlparse` are
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
# By default, reports generated by `tlparse` are
# By default, reports generated by ``tlparse`` are

recipes_source/torch_logs.py Outdated Show resolved Hide resolved
recipes_source/torch_logs.py Outdated Show resolved Hide resolved
recipes_source/torch_logs.py Outdated Show resolved Hide resolved
@nluu175
Copy link
Author

nluu175 commented Nov 14, 2024

@ezyang hello. Do I need to make any more modifications for this issue? I see that the pipeline is still waiting to be reported.

@svekars svekars requested a review from ezyang November 15, 2024 21:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla signed torch.compile Torch compile and other relevant tutorials
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants