Skip to content

Add warning for clearing profiler events at the end of each cycle#168066

Closed
jiannanWang wants to merge 10 commits intomainfrom
jiannanWang/profilerstepwarning
Closed

Add warning for clearing profiler events at the end of each cycle#168066
jiannanWang wants to merge 10 commits intomainfrom
jiannanWang/profilerstepwarning

Conversation

@jiannanWang
Copy link
Contributor

Fixes #148314.

This PR introduces a warning to clarify the behavior of the Profiler regarding event management. Specifically, it informs users that:

  • The Profiler clears events at the end of each cycle.
  • Only events from the current cycle will be reported by default.
  • To retain events across cycles, users should set acc_events=True.
    The warning is triggered only once when self.profiler is not None and self.acc_events is False, using the warn_once function.

This change aims to improve transparency and help users avoid confusion when analyzing profiling results.

@pytorch-bot
Copy link

pytorch-bot bot commented Nov 18, 2025

🔗 Helpful Links

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

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

✅ No Failures

As of commit 44600b2 with merge base 28e8803 (image):
💚 Looks good so far! There are no failures yet. 💚

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

@jiannanWang
Copy link
Contributor Author

@pytorchbot label "release notes: profiler"

@pytorch-bot pytorch-bot bot added the release notes: profiler release notes category label Nov 18, 2025
Copy link
Contributor

@sraikund16 sraikund16 left a comment

Choose a reason for hiding this comment

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

LGTM!

@jiannanWang
Copy link
Contributor Author

@pytorchbot merge

@pytorch-bot pytorch-bot bot added the ciflow/trunk Trigger trunk jobs on your pull request label Nov 19, 2025
@pytorchmergebot
Copy link
Collaborator

Merge started

Your change will be merged once all checks pass (ETA 0-4 Hours).

Learn more about merging in the wiki.

Questions? Feedback? Please reach out to the PyTorch DevX Team

Advanced Debugging
Check the merge workflow status
here

@pytorchmergebot
Copy link
Collaborator

Merge failed

Reason: 1 jobs have failed, first few of them are: trunk / linux-jammy-cuda12.8-py3.10-gcc11 / test (default, 3, 5, linux.g6.4xlarge.experimental.nvidia.gpu)

Details for Dev Infra team Raised by workflow job

@jiannanWang
Copy link
Contributor Author

@pytorchbot merge

@pytorchmergebot
Copy link
Collaborator

Merge started

Your change will be merged once all checks pass (ETA 0-4 Hours).

Learn more about merging in the wiki.

Questions? Feedback? Please reach out to the PyTorch DevX Team

Advanced Debugging
Check the merge workflow status
here

@pytorchmergebot
Copy link
Collaborator

Merge failed

Reason: 1 jobs have failed, first few of them are: trunk / linux-jammy-cuda12.8-py3.10-gcc11 / test (default, 3, 5, linux.g6.4xlarge.experimental.nvidia.gpu)

Details for Dev Infra team Raised by workflow job

@jiannanWang
Copy link
Contributor Author

@pytorchbot drci

@jiannanWang jiannanWang changed the title add warning for clearing events at the end of each cycle Add warning for clearing profiler events at the end of each cycle Nov 21, 2025
@jiannanWang
Copy link
Contributor Author

@pytorchbot merge

@pytorchmergebot
Copy link
Collaborator

Merge started

Your change will be merged once all checks pass (ETA 0-4 Hours).

Learn more about merging in the wiki.

Questions? Feedback? Please reach out to the PyTorch DevX Team

Advanced Debugging
Check the merge workflow status
here

JacobSzwejbka pushed a commit that referenced this pull request Dec 8, 2025
…68066)

Fixes #148314.

This PR introduces a warning to clarify the behavior of the Profiler regarding event management. Specifically, it informs users that:
- The Profiler clears events at the end of each cycle.
- Only events from the current cycle will be reported by default.
- To retain events across cycles, users should set `acc_events=True`.
The warning is triggered only once when `self.profiler` is not `None` and `self.acc_events` is `False`, using the `warn_once` function.

This change aims to improve transparency and help users avoid confusion when analyzing profiling results.

Pull Request resolved: #168066
Approved by: https://github.com/sraikund16
@github-actions github-actions bot deleted the jiannanWang/profilerstepwarning branch December 22, 2025 02:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ciflow/trunk Trigger trunk jobs on your pull request Merged release notes: profiler release notes category

Projects

None yet

Development

Successfully merging this pull request may close these issues.

The recorded step number in profiler is wrong

3 participants