Skip to content

Add unified memory APIs for torch.accelerator #152932

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 60 commits into from

Conversation

guangyey
Copy link
Collaborator

@guangyey guangyey commented May 6, 2025

Stack from ghstack (oldest at bottom):

Motivation

The following API will be put under torch.accelerator

  • empty_cache
  • max_memory_allocated
  • max_memory_reserved
  • memory_allocated
  • memory_reserved
  • memory_stats
  • reset_accumulated_memory_stats
  • reset_peak_memory_stats

cc @albanD @EikanWang

Copy link

pytorch-bot bot commented May 6, 2025

🔗 Helpful Links

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

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

❌ 1 New Failure, 3 Unrelated Failures

As of commit 63f2a36 with merge base 178515d (image):

NEW FAILURE - The following job has failed:

FLAKY - The following jobs failed but were likely due to flakiness present on trunk:

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

@guangyey guangyey changed the title Add unified memory APIs for torch.accelerator [WIP] Add unified memory APIs for torch.accelerator May 6, 2025
guangyey added 2 commits May 6, 2025 15:10
[ghstack-poisoned]
[ghstack-poisoned]
guangyey added 15 commits May 22, 2025 15:08
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
guangyey added 2 commits June 5, 2025 10:47
[ghstack-poisoned]
[ghstack-poisoned]
@pytorchmergebot
Copy link
Collaborator

@guangyey your PR has been reverted as part of the stack under #138222.

pytorchmergebot added a commit that referenced this pull request Jul 22, 2025
This reverts commit 2ad5c25.

Reverted #152932 on behalf of https://github.com/ZainRizvi due to Very sorry but this is still breaking internally. @albanD would you be able to help get this past the finish line? D78496124 has more details on the failure and the workaround might be to do something like what's in D78684669. To validate the fixes internally, you can follow the instructions here to ghimport the changes: https://fburl.com/fixing-ghfirst-reverts ([comment](#138222 (comment)))
guangyey added a commit that referenced this pull request Jul 22, 2025
ghstack-source-id: 2e6fbc9
Pull Request resolved: #152932
[ghstack-poisoned]
saienduri pushed a commit to saienduri/pytorch that referenced this pull request Jul 22, 2025
This reverts commit 2ad5c25.

Reverted pytorch#152932 on behalf of https://github.com/ZainRizvi due to Very sorry but this is still breaking internally. @albanD would you be able to help get this past the finish line? D78496124 has more details on the failure and the workaround might be to do something like what's in D78684669. To validate the fixes internally, you can follow the instructions here to ghimport the changes: https://fburl.com/fixing-ghfirst-reverts ([comment](pytorch#138222 (comment)))
[ghstack-poisoned]
[ghstack-poisoned]
@pytorchmergebot
Copy link
Collaborator

Starting merge as part of PR stack under #155200

[ghstack-poisoned]
@guangyey
Copy link
Collaborator Author

guangyey commented Aug 6, 2025

@pytorchbot merge -i

@pytorchmergebot
Copy link
Collaborator

Starting merge as part of PR stack under #155200

pytorchmergebot pushed a commit that referenced this pull request Aug 6, 2025
pytorchmergebot added a commit that referenced this pull request Aug 7, 2025
@pytorchmergebot
Copy link
Collaborator

@guangyey your PR has been reverted as part of the stack under #138222.

@guangyey guangyey added the ciflow/periodic-rocm-mi300 Trigger "distributed" config CI on ROCm MI300 label Aug 8, 2025
[ghstack-poisoned]
@pytorchmergebot
Copy link
Collaborator

Starting merge as part of PR stack under #155200

pytorchmergebot pushed a commit that referenced this pull request Aug 8, 2025
hinriksnaer pushed a commit to hinriksnaer/pytorch that referenced this pull request Aug 8, 2025
# Motivation
The following API will be put under torch.accelerator
- empty_cache
- max_memory_allocated
- max_memory_reserved
- memory_allocated
- memory_reserved
- memory_stats
- reset_accumulated_memory_stats
- reset_peak_memory_stats

Pull Request resolved: pytorch#152932
Approved by: https://github.com/albanD
ghstack dependencies: pytorch#138222
hinriksnaer pushed a commit to hinriksnaer/pytorch that referenced this pull request Aug 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci-no-td Do not run TD on this PR ciflow/mps Run MPS tests (subset of trunk) ciflow/periodic-rocm-mi300 Trigger "distributed" config CI on ROCm MI300 ciflow/rocm Trigger "default" config CI on ROCm ciflow/trunk Trigger trunk jobs on your pull request ciflow/xpu Run XPU CI tasks Merged module: accelerator Issues related to the shared accelerator API open source release notes: python_frontend python frontend release notes category Reverted
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants