Skip to content

[Profiler] Fix gc test by checking for at least one gc event between bounds - #186832

Closed
ryanzhang22 wants to merge 1 commit into
pytorch:mainfrom
ryanzhang22:profiler-fix-gc-test
Closed

ryanzhang22 wants to merge 1 commit into
pytorch:mainfrom
ryanzhang22:profiler-fix-gc-test

Conversation

@ryanzhang22

Copy link
Copy Markdown
Contributor

This test has been failing in CI: https://github.com/pytorch/kineto/actions/runs/27210714257/job/80338678706

It runs profiling with gc enabled and inserts a gc event between two record_function blocks, then expects that all gc events in the produced trace are between the two record_function timestamps. However, on a fresh build, there's something else that triggers python gc which is causing a spurious event to show up in the profile, leading to test failure.

We are really just checking that the singular gc event we induce is in the profile, so instead of checking that all events fall within the timeframe, just check if at least one does.

@ryanzhang22
ryanzhang22 requested a review from scotts June 9, 2026 19:51
@pytorch-bot pytorch-bot Bot added the topic: not user facing topic category label Jun 9, 2026
@pytorch-bot

pytorch-bot Bot commented Jun 9, 2026 •

Copy link
Copy Markdown

🔗 Helpful Links

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

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

❌ 5 New Failures

As of commit 5942ef9 with merge base 0a9ce1d (image):

NEW FAILURES - The following jobs have failed:

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

@meta-codesync

meta-codesync Bot commented Jun 9, 2026

Copy link
Copy Markdown

@ryanzhang22 has imported this pull request. If you are a Meta employee, you can view this in D108054666.

@ryanzhang22

Copy link
Copy Markdown
Contributor Author

@pytorchbot merge

@pytorch-bot pytorch-bot Bot added the ciflow/trunk Trigger trunk jobs on your pull request label Jun 9, 2026
@pytorchmergebot

Copy link
Copy Markdown
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
Copy Markdown
Collaborator

@ryanzhang22

Copy link
Copy Markdown
Contributor Author

@pytorchbot merge -i

@pytorchmergebot

Copy link
Copy Markdown
Collaborator

jemitche1 pushed a commit to jemitche1/pytorch that referenced this pull request Jun 13, 2026
…bounds (pytorch#186832)

This test has been failing in CI: https://github.com/pytorch/kineto/actions/runs/27210714257/job/80338678706

It runs profiling with gc enabled and inserts a gc event between two `record_function` blocks, then expects that all gc events in the produced trace are between the two `record_function` timestamps. However, on a fresh build, there's something else that triggers python gc which is causing a spurious event to show up in the profile, leading to test failure.

We are really just checking that the singular gc event we induce is in the profile, so instead of checking that all events fall within the timeframe, just check if at least one does.
Pull Request resolved: pytorch#186832
Approved by: https://github.com/scotts
gplutop7 pushed a commit to gplutop7/pytorch that referenced this pull request Jul 15, 2026
…bounds (pytorch#186832)

This test has been failing in CI: https://github.com/pytorch/kineto/actions/runs/27210714257/job/80338678706

It runs profiling with gc enabled and inserts a gc event between two `record_function` blocks, then expects that all gc events in the produced trace are between the two `record_function` timestamps. However, on a fresh build, there's something else that triggers python gc which is causing a spurious event to show up in the profile, leading to test failure.

We are really just checking that the singular gc event we induce is in the profile, so instead of checking that all events fall within the timeframe, just check if at least one does.
Pull Request resolved: pytorch#186832
Approved by: https://github.com/scotts
aws-kingrj pushed a commit to amazon-contributing/upstream-to-pytorch that referenced this pull request Jul 29, 2026
…bounds (pytorch#186832)

This test has been failing in CI: https://github.com/pytorch/kineto/actions/runs/27210714257/job/80338678706

It runs profiling with gc enabled and inserts a gc event between two `record_function` blocks, then expects that all gc events in the produced trace are between the two `record_function` timestamps. However, on a fresh build, there's something else that triggers python gc which is causing a spurious event to show up in the profile, leading to test failure.

We are really just checking that the singular gc event we induce is in the profile, so instead of checking that all events fall within the timeframe, just check if at least one does.
Pull Request resolved: pytorch#186832
Approved by: https://github.com/scotts
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 topic: not user facing topic category

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants