Add TieredAllocator for capacity-bounded on-chip/spill allocation#32
Draft
fpedd wants to merge 1 commit into
Draft
Add TieredAllocator for capacity-bounded on-chip/spill allocation#32fpedd wants to merge 1 commit into
fpedd wants to merge 1 commit into
Conversation
The existing allocators all minimize a single unbounded pool. They cannot answer the question a hardware team actually asks: given a fixed on-chip memory, which buffers live there and which spill off-chip? TieredAllocator fills that gap. It models the two tiers within one address space: the fast memory occupies offsets [0, capacity), every buffer that first-fit can place under that ceiling stays on-chip, and the rest are packed contiguously above capacity (the spill region). A buffer is on-chip iff its height (offset + size) is at most capacity, so the result is an ordinary valid allocation and works with validate_allocation, plot_allocation, and the benchmark harness unchanged. TieredConfig exposes capacity (bytes; None means unbounded, the default) and order, the priority buffers get for the fast tier (default largest size first, keeping the bytes most expensive to spill on-chip). With capacity=None the allocator reduces to first-fit in order, so it is constructible with no arguments and usable directly by registry name "tiered_allocator".
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The existing allocators all minimize a single unbounded pool. They cannot
answer the question a hardware team actually asks: given a fixed on-chip
memory, which buffers live there and which spill off-chip? TieredAllocator
fills that gap.
It models the two tiers within one address space: the fast memory occupies
offsets [0, capacity), every buffer that first-fit can place under that
ceiling stays on-chip, and the rest are packed contiguously above capacity
(the spill region). A buffer is on-chip iff its height (offset + size) is at
most capacity, so the result is an ordinary valid allocation and works with
validate_allocation, plot_allocation, and the benchmark harness unchanged.
TieredConfig exposes capacity (bytes; None means unbounded, the default) and
order, the priority buffers get for the fast tier (default largest size
first, keeping the bytes most expensive to spill on-chip). With capacity=None
the allocator reduces to first-fit in order, so it is constructible with no
arguments and usable directly by registry name "tiered_allocator".