Skip to content
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

[Unity] Support storage reuse for dynamic shapes #16500

Merged
merged 3 commits into from Feb 2, 2024

Conversation

vinx13
Copy link
Member

@vinx13 vinx13 commented Jan 31, 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.

cc @MasterJH5574 @tqchen

Copy link
Contributor

@MasterJH5574 MasterJH5574 left a comment

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
19 checks passed
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.

None yet

2 participants