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

[TIR] Avoid unnecessary dtype escalation in loop splitting #12035

Merged
merged 6 commits into from
Jul 8, 2022

Conversation

zxybazh
Copy link
Member

@zxybazh zxybazh commented Jul 7, 2022

This PR introduces a type check to cast loop split decisions (sometimes given as int64) back to a smaller datatype when the loop variable's data type is smaller. This issue usually happens during reloading a trace from disk using JSON database and causes the failure of CompactBufferAllocation pass.

Unit test is also added.

@zxybazh zxybazh marked this pull request as ready for review July 7, 2022 23:36
@zxybazh
Copy link
Member Author

zxybazh commented Jul 7, 2022

Double checked and confirmed the only source of data type inconsistency comes from directly calling Split with given decisions. Therefore, I introduced a type check in Split's factor parsing part. Ready for review. CC: @junrushao1994

@zxybazh
Copy link
Member Author

zxybazh commented Jul 8, 2022

Fixed and all issues addressed! Thanks for the feedbacks.

@junrushao junrushao changed the title [MetaSchedule][TIR] Patch for Data Type Inconsistency After Trace Reloading [TIR] Avoid unnecessary dtype escalation in loop splitting Jul 8, 2022
Copy link
Member

@junrushao junrushao left a comment

Choose a reason for hiding this comment

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

LGTM!

@junrushao
Copy link
Member

Thanks @zxybazh for looking into that!

@junrushao junrushao merged commit 684a838 into apache:main Jul 8, 2022
masahi pushed a commit to masahi/tvm that referenced this pull request Jul 15, 2022
)

This PR introduces a type check to cast loop split decisions (sometimes given as `int64`) back to a smaller datatype when the loop variable's data type is smaller. This issue usually happens during reloading a trace from disk using JSON database and causes the failure of `CompactBufferAllocation` pass.
junrushao pushed a commit to yelite/tvm that referenced this pull request Jul 27, 2022
)

This PR introduces a type check to cast loop split decisions (sometimes given as `int64`) back to a smaller datatype when the loop variable's data type is smaller. This issue usually happens during reloading a trace from disk using JSON database and causes the failure of `CompactBufferAllocation` pass.
xinetzone pushed a commit to daobook/tvm that referenced this pull request Nov 25, 2022
)

This PR introduces a type check to cast loop split decisions (sometimes given as `int64`) back to a smaller datatype when the loop variable's data type is smaller. This issue usually happens during reloading a trace from disk using JSON database and causes the failure of `CompactBufferAllocation` pass.
mikeseven pushed a commit to mikeseven/tvm that referenced this pull request Sep 27, 2023
)

This PR introduces a type check to cast loop split decisions (sometimes given as `int64`) back to a smaller datatype when the loop variable's data type is smaller. This issue usually happens during reloading a trace from disk using JSON database and causes the failure of `CompactBufferAllocation` pass.
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