Skip to content

[MPS] Add regression test for memory leak in nn.MaxPool2d #132408

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

Conversation

hvaara
Copy link
Contributor

@hvaara hvaara commented Aug 1, 2024

This pull request introduces a regression test for the issue described in

The test is designed to identify a GPU memory leak in the nn.MaxPool2d module in MPS. About 1.63 GiB is leaked in this test when the issue is present.

Summary of Changes:

  1. New Test Function:
    Added test_maxpool2d_no_leak to verify that no GPU memory is leaked when performing a sequence of operations with nn.MaxPool2d.
  2. Temporary Workaround with @xfailIf:
    Used the @xfailIf(product_version > 0) decorator to mark the test as expected to fail for product versions greater than 0.
    This will help identify when the issue is resolved in macOS version 15 or later (estimate by upstream), as the test will start failing consistently, indicating that the memory leak has been fixed. Once the issue is resolved in macOS, the predicate needs to be updated. For example, use @xfailIf(product_version < 15.1) if the issue is fixed in macOS version 15.1.

@hvaara hvaara requested review from kulinseth and malfet as code owners August 1, 2024 14:04
Copy link

pytorch-bot bot commented Aug 1, 2024

🔗 Helpful Links

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

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

✅ No Failures

As of commit 169ea5c with merge base 6ff1e43 (image):
💚 Looks good so far! There are no failures yet. 💚

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

@pytorch-bot pytorch-bot bot added the topic: not user facing topic category label Aug 1, 2024
@hvaara
Copy link
Contributor Author

hvaara commented Aug 1, 2024

Similar PR in #132355

@hvaara
Copy link
Contributor Author

hvaara commented Aug 5, 2024

Fixed the lint errors.

@hvaara hvaara force-pushed the maxpool2d-leak-test branch from 4d5a15f to 169ea5c Compare August 5, 2024 17:53
@ezyang ezyang added the triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module label Aug 5, 2024
Copy link
Contributor

github-actions bot commented Oct 4, 2024

Looks like this PR hasn't been updated in a while so we're going to go ahead and mark this as Stale.
Feel free to remove the Stale label if you feel this was a mistake.
If you are unable to remove the Stale label please contact a maintainer in order to do so.
If you want the bot to never mark this PR stale again, add the no-stale label.
Stale pull requests will automatically be closed after 30 days of inactivity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
open source Stale topic: not user facing topic category triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants