Skip to content

Conversation

@SS-JIA
Copy link
Contributor

@SS-JIA SS-JIA commented May 12, 2025

Stack from ghstack (oldest at bottom):

Context

Currently, in ET-VK all memory allocations are done through the default memory pool of VMA (Vulkan Memory Allocator). This has some consequences:

  • Memory Pool Behaviour (e.g. block size, allocation algorithm, etc.) cannot be configured on a per-model basis
  • When a model is unloaded, GPU memory is not guaranteed to be freed since VMA may elect to hold on to the allocated memory for future use

This PR introduces the ability for models to use a custom VMA memory pool to allocate memory for tensors belonging to that model. This addresses the two points listed above, and makes it possible for VMA to release all memory used for a model once the model is unloaded. Additionally, using a custom VMA memory pool is optional.

Differential Revision: D74617843

## Context

Currently, in ET-VK all memory allocations are done through the default memory pool of VMA (Vulkan Memory Allocator). This has some consequences:

* Memory Pool Behaviour (e.g. block size, allocation algorithm, etc.) cannot be configured on a per-model basis
* When a model is unloaded, GPU memory is not guaranteed to be freed since VMA may elect to hold on to the allocated memory for future use

This PR introduces the ability for models to use a custom VMA memory pool to allocate memory for tensors belonging to that model. This addresses the two points listed above, and makes it possible for VMA to release all memory used for a model once the model is unloaded. Additionally, using a custom VMA memory pool is optional.

Differential Revision: [D74617843](https://our.internmc.facebook.com/intern/diff/D74617843/)

[ghstack-poisoned]
SS-JIA added a commit that referenced this pull request May 12, 2025
## Context

Currently, in ET-VK all memory allocations are done through the default memory pool of VMA (Vulkan Memory Allocator). This has some consequences:

* Memory Pool Behaviour (e.g. block size, allocation algorithm, etc.) cannot be configured on a per-model basis
* When a model is unloaded, GPU memory is not guaranteed to be freed since VMA may elect to hold on to the allocated memory for future use

This PR introduces the ability for models to use a custom VMA memory pool to allocate memory for tensors belonging to that model. This addresses the two points listed above, and makes it possible for VMA to release all memory used for a model once the model is unloaded. Additionally, using a custom VMA memory pool is optional.

Differential Revision: [D74617843](https://our.internmc.facebook.com/intern/diff/D74617843/)

ghstack-source-id: 283566254
Pull Request resolved: #10831
@pytorch-bot
Copy link

pytorch-bot bot commented May 12, 2025

🔗 Helpful Links

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

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:

❌ 4 New Failures

As of commit 1a6a05b with merge base a868166 (image):

NEW FAILURES - The following jobs have failed:

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

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label May 12, 2025
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D74617843

@github-actions
Copy link

This PR needs a release notes: label

If your changes are user facing and intended to be a part of release notes, please use a label starting with release notes:.

If not, please add the topic: not user facing label.

To add a label, you can comment to pytorchbot, for example
@pytorchbot label "topic: not user facing"

For more information, see
https://github.com/pytorch/pytorch/wiki/PyTorch-AutoLabel-Bot#why-categorize-for-release-notes-and-how-does-it-work.

@SS-JIA SS-JIA closed this Aug 29, 2025
@SS-JIA SS-JIA deleted the gh/SS-JIA/225/head branch October 15, 2025 17:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants