Skip to content

[executorch] Make HierarchicalAllocator use buffers instead of MemoryAllocators #387

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

Conversation

dbort
Copy link
Contributor

@dbort dbort commented Sep 17, 2023

Stack from ghstack (oldest at bottom):

The only operations that HierarchicalAllocator performs on its MemoryAllocator entries are base_address() and size(), which means that they're not really allocators, they're just buffers.

Move to using an array of simple "pointer and size" elements (represented by Spans).

This will ultimately let us remove base_address() and size() from MemoryAllocator, which are incompatible with dynamic subclasses like MallocMemoryAllocator.

To help demonstrate that the new version works, make ManagedMemoryManager use spans. This will cause a few dozen tests around the tree to start using spans as well.

Differential Revision: D49344931

…Allocators

The only operations that HierarchicalAllocator performs on its MemoryAllocator entries are `base_address()` and `size()`, which means that they're not really allocators, they're just buffers.

Move to using an array of simple "pointer and size" elements (represented by Spans).

This will ultimately let us remove `base_address()` and `size()` from `MemoryAllocator`, which are incompatible with dynamic subclasses like `MallocMemoryAllocator`.

To help demonstrate that the new version works, make `ManagedMemoryManager` use spans. This will cause a few dozen tests around the tree to start using spans as well.

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

[ghstack-poisoned]
…d of MemoryAllocators"

The only operations that HierarchicalAllocator performs on its MemoryAllocator entries are `base_address()` and `size()`, which means that they're not really allocators, they're just buffers.

Move to using an array of simple "pointer and size" elements (represented by Spans).

This will ultimately let us remove `base_address()` and `size()` from `MemoryAllocator`, which are incompatible with dynamic subclasses like `MallocMemoryAllocator`.

To help demonstrate that the new version works, make `ManagedMemoryManager` use spans. This will cause a few dozen tests around the tree to start using spans as well.

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

[ghstack-poisoned]
…d of MemoryAllocators"

The only operations that HierarchicalAllocator performs on its MemoryAllocator entries are `base_address()` and `size()`, which means that they're not really allocators, they're just buffers.

Move to using an array of simple "pointer and size" elements (represented by Spans).

This will ultimately let us remove `base_address()` and `size()` from `MemoryAllocator`, which are incompatible with dynamic subclasses like `MallocMemoryAllocator`.

To help demonstrate that the new version works, make `ManagedMemoryManager` use spans. This will cause a few dozen tests around the tree to start using spans as well.

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

[ghstack-poisoned]
…d of MemoryAllocators"

The only operations that HierarchicalAllocator performs on its MemoryAllocator entries are `base_address()` and `size()`, which means that they're not really allocators, they're just buffers.

Move to using an array of simple "pointer and size" elements (represented by Spans).

This will ultimately let us remove `base_address()` and `size()` from `MemoryAllocator`, which are incompatible with dynamic subclasses like `MallocMemoryAllocator`.

To help demonstrate that the new version works, make `ManagedMemoryManager` use spans. This will cause a few dozen tests around the tree to start using spans as well.

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

[ghstack-poisoned]
@facebook-github-bot
Copy link
Contributor

This pull request has been merged in 58c8c92.

@facebook-github-bot facebook-github-bot deleted the gh/dbort/10/head branch September 22, 2023 14:22
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. Merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants