8000 Fix memory leak on masked Tensor by albanD · Pull Request #137890 · pytorch/pytorch · GitHub
[go: up one dir, main page]

Skip to content

Fix memory leak on masked Tensor #137890

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

Closed
wants to merge 1 commit into from
Closed

Conversation

albanD
Copy link
Collaborator
@albanD albanD commented Oct 14, 2024

Note that this reverts the change from #137815 as well which is not needed anymore!

Without this, you create an unbeakable reference cycle. It is unbreakable because part of the cycle is through the autograd graph which we cannot traverse.

@albanD albanD requested review from huydhn and cpuhrsch October 14, 2024 13:51
Copy link
pytorch-bot bot commented Oct 14, 2024

🔗 Helpful Links

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

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

✅ No Failures

As of commit 41881d7 with merge base 0e4d426 (image):
💚 Looks good so far! There are no failures yet. 💚

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

Copy link
Contributor
@atalman atalman left a comment

Choose a reason for hiding this comment

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

lgtm

@huydhn huydhn added the topic: not user facing topic category label Oct 14, 2024
@Skylion007
Copy link
Collaborator

Do our current tests catch that the unbreakable reference cycle is broken?

@Skylion007 Skylion007 added this to the 2.5.1 milestone Oct 14, 2024
@albanD
Copy link
Collaborator Author
albanD commented Oct 14, 2024

It's pretty hard to detect that on the cpu side without flakyness :/
But the GPU tests are pretty good at it when you leak a Tensor. That's why the original PR linked above did the change to begin with.

@albanD
Copy link
Collaborator Author
albanD commented Oct 14, 2024

@pytorchbot merge

@pytorch-bot pytorch-bot bot added the ciflow/trunk Trigger trunk jobs on your pull request label Oct 14, 2024
@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 mandatory check(s) failed. The first few are:

Dig deeper by viewing the failures on hud

Details for Dev Infra team Raised by workflow job

Failing merge rule: Core Maintainers

@cpuhrsch cpuhrsch added release notes: sparse release notes category topic: bug fixes topic category and removed topic: not user facing topic category labels Oct 14, 2024
@cpuhrsch
Copy link
Contributor

@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

jackzhxng pushed a commit that referenced this pull request Oct 16, 2024
Note that this reverts the change from #137815 as well which is not needed anymore!

Without this, you create an unbeakable reference cycle. It is unbreakable because part of the cycle is through the autograd graph which we cannot traverse.
Pull Request resolved: #137890
Approved by: https://github.com/atalman, https://github.com/huydhn, https://github.com/Skylion007
@kit1980
Copy link
Contributor
kit1980 commented Oct 23, 2024

2.5.1 is an emergency patch release to address specific large regressions, moving this to 2.6.0

@kit1980
Copy link
Contributor
kit1980 commented Jan 25, 2025

For release 2.6 I verified that the change is present in https://github.com/pytorch/pytorch/blob/v2.6.0-rc9/torch/masked/maskedtensor/core.py and thus tested in CI.

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: sparse release notes category topic: bug fixes topic category
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants
0