Skip to content

Conversation

@MasterJH5574
Copy link
Contributor

This PR improves the memory planning to plan for tensors with shape such as (m, n) where only m has an integer upper bound (say m <= 20).

Prior to this PR, the tensor is not planned even though m has an upper bound. This is not as ideal since it does not fully leverage the upper bound info.

This PR enhances the planning, so that a memory chunk of 20 * n will be allocated first, and the tensor will then be allocated out from this chunk. This enables us to fully leverage the upper bound info.

A unit test is provided.

This PR improves the memory planning to plan for tensors
with shape such as `(m, n)` where only `m` has an integer
upper bound (say `m <= 20`).

Prior to this PR, the tensor is not planned even though
`m` has an upper bound. This is not as ideal since it
does not fully leverage the upper bound info.

This PR enhances the planning, so that a memory chunk
of `20 * n` will be allocated first, and the tensor
will then be allocated out from this chunk. This enables
us to fully leverage the upper bound info.

A unit test is provided.
@junrushao
Copy link
Member

This idea is pretty much similar to the "unified memory pool" in S-LoRA. It's not as feature-complete as S-LoRA, so please take a look whenever you have time

@junrushao junrushao merged commit b98bc66 into apache:main Jan 25, 2024
masahi pushed a commit to masahi/tvm that referenced this pull request Feb 20, 2024
This PR improves the memory planning to plan for tensors
with shape such as `(m, n)` where only `m` has an integer
upper bound (say `m <= 20`).

Prior to this PR, the tensor is not planned even though
`m` has an upper bound. This is not as ideal since it
does not fully leverage the upper bound info.

This PR enhances the planning, so that a memory chunk
of `20 * n` will be allocated first, and the tensor
will then be allocated out from this chunk. This enables
us to fully leverage the upper bound info.

A unit test is provided.
elvin-n pushed a commit to Deelvin/tvm that referenced this pull request Mar 19, 2024
This PR improves the memory planning to plan for tensors
with shape such as `(m, n)` where only `m` has an integer
upper bound (say `m <= 20`).

Prior to this PR, the tensor is not planned even though
`m` has an upper bound. This is not as ideal since it
does not fully leverage the upper bound info.

This PR enhances the planning, so that a memory chunk
of `20 * n` will be allocated first, and the tensor
will then be allocated out from this chunk. This enables
us to fully leverage the upper bound info.

A unit test is provided.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants