Skip to content

[Unity] Support storage reuse for dynamic shapes - #16500

Merged
MasterJH5574 merged 3 commits into
apache:mainfrom
vinx13:feat/memory-planning-dyn
Feb 2, 2024
Merged

MasterJH5574 merged 3 commits into
apache:mainfrom
vinx13:feat/memory-planning-dyn

Conversation

@vinx13

@vinx13 vinx13 commented Jan 31, 2024

Copy link
Copy Markdown
Member

Before this PR, dynamic shapes require upper bound of variables to be provided in order to use storage planning. We can relax this requirement, for shapes with unknown bound, we can look up other tensors with the same symbolic shapes. This can be helpful for deep learning models where the layers with the same configurations are usually repeated since there are many objects with the same shapes.

This PR changed the StorageToken to use PrimExpr bytes which can be integer or symbolic. For symbolic shapes, we put the tokens into a special buckets for looking up.

cc @MasterJH5574 @tqchen

@MasterJH5574 MasterJH5574 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thank you @vinx13!

@MasterJH5574
MasterJH5574 merged commit 5b2f641 into apache:main Feb 2, 2024
masahi pushed a commit to masahi/tvm that referenced this pull request Feb 20, 2024
Before this PR, dynamic shapes require upper bound of
variables to be provided in order to use storage planning.
We can relax this requirement, for shapes with unknown bound,
we can look up other tensors with the same symbolic
shapes. This can be helpful for deep learning models
where the layers with the same configurations are usually
repeated since there are many objects with the same shapes.

This PR changed the `StorageToken` to use `PrimExpr`
bytes which can be integer or symbolic. For symbolic
shapes, we put the tokens into a special buckets for looking up.
elvin-n pushed a commit to Deelvin/tvm that referenced this pull request Mar 19, 2024
Before this PR, dynamic shapes require upper bound of
variables to be provided in order to use storage planning.
We can relax this requirement, for shapes with unknown bound,
we can look up other tensors with the same symbolic
shapes. This can be helpful for deep learning models
where the layers with the same configurations are usually
repeated since there are many objects with the same shapes.

This PR changed the `StorageToken` to use `PrimExpr`
bytes which can be integer or symbolic. For symbolic
shapes, we put the tokens into a special buckets for looking up.
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