Skip to content

Conversation

@albanD
Copy link
Collaborator

@albanD albanD commented Dec 13, 2024

Fixes a bug introduced in #137267

While the test ensures the finalizer did run to make sure things are cleared, the objects are not properly collected by the gc due to the faulty tp_clear implementation. So, while the finalizer did run, the object was still alive.
Fixing this by giving tp_clear the same treatment as tp_traverse and tp_dealloc on Tensor: make it a unique function that handles the full subclass hierarchy in one place.

Stack from ghstack (oldest at bottom):

[ghstack-poisoned]
@albanD albanD requested a review from soulitzer as a code owner December 13, 2024 17:17
@pytorch-bot
Copy link

pytorch-bot bot commented Dec 13, 2024

🔗 Helpful Links

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

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:

✅ No Failures

As of commit 5e44b3a with merge base 6178be8 (image):
💚 Looks good so far! There are no failures yet. 💚

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

@albanD albanD added release notes: python_frontend python frontend release notes category topic: bug fixes topic category labels Dec 13, 2024
[ghstack-poisoned]
@albanD
Copy link
Collaborator Author

albanD commented Dec 13, 2024

@pytorchbot merge

@pytorch-bot pytorch-bot bot added the ciflow/trunk Trigger trunk jobs on your pull request label Dec 13, 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

fightingand pushed a commit to fightingand/pytorch that referenced this pull request Dec 20, 2024
@github-actions github-actions bot deleted the gh/albanD/2/head branch January 14, 2025 02:04
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: python_frontend python frontend release notes category topic: bug fixes topic category

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants