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

[Frontend] Prevent tflite frontend from producing int64 shape/parameters #7030

Merged
merged 2 commits into from
Dec 4, 2020

Conversation

merrymercy
Copy link
Member

@merrymercy merrymercy commented Dec 4, 2020

I found some shapes and parameters (padding) are converted to int64 from tflite frontend.
The consequence is that the shape of a placeholder becomes [1, (int64) 112, (int64) 112, 64]. Some of them are int64, the others are int32.
This type-mixed shape fails some optimization in the auto-scheduler.

The reason for int64 shape is ShapeAsNumpy returns np.int32, and it is automatically upcasted to np.int64 when doing computation. To fix this, I convert all np.int32 to python's int to prevent auto upcast.

@merrymercy merrymercy changed the title [Frontend] Prevent tflite frontend from producing int64 shape [Frontend] Prevent tflite frontend from producing int64 shape/parameters Dec 4, 2020
@FrozenGene
Copy link
Member

Seems this pr should resolve #7009 goal

Copy link
Member

@FrozenGene FrozenGene left a comment

Choose a reason for hiding this comment

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

LGTM

@tqchen tqchen merged commit 9554e64 into apache:main Dec 4, 2020
@merrymercy merrymercy deleted the pr-fix-tflite branch December 4, 2020 16:19
trevor-m pushed a commit to trevor-m/tvm that referenced this pull request Dec 4, 2020
trevor-m pushed a commit to neo-ai/tvm that referenced this pull request Dec 4, 2020
electriclilies pushed a commit to electriclilies/tvm that referenced this pull request Feb 18, 2021
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.

3 participants