Skip to content

Conversation

@AndrewZhaoLuo
Copy link
Contributor

@AndrewZhaoLuo AndrewZhaoLuo commented Mar 23, 2023

Previously only handle scalar case. That is rewriting a ./ 5 --> a .* 0.2. Now handle vector case a ./ [2, 3, 4] --> a .* [0.5, 0.33, 0.25]

Also changes the pass to rely on constant folding for proper folding instead of manually constructing constant data.

cc @Johnson9009 @tkonolige

@tvm-bot
Copy link
Collaborator

tvm-bot commented Mar 23, 2023

Thanks for contributing to TVM! Please refer to the contributing guidelines https://tvm.apache.org/docs/contribute/ for useful information and tips. Please request code reviews from Reviewers by @-ing them in a comment.

  • No users to tag found in teams: rewrite See #10317 for details

Generated by tvm-bot

return post;
}

// rely on constant folding to fold things
Copy link
Contributor

Choose a reason for hiding this comment

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

Are you sure constant folding is going to fire at the right time? I can't remember if the divisions need to be rewritten before FakeQuantization or if it doesn't matter when.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hmm good point, I think there is a way to specify a required pass to be run after this one, so maybe will try to figure that out.

@tqchen tqchen closed this Feb 7, 2025
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.

4 participants