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

[Relay][Quantization] Fix add_rewrite and UnifyDTypeScale #3534

Merged
merged 4 commits into from
Jul 12, 2019

Conversation

vinx13
Copy link
Member

@vinx13 vinx13 commented Jul 11, 2019

This PR fixed a few broken things due to previous changes:

  • Fixed missing cases in add_rewrite
  • Recovered removed cast + stop_fusion in UnifyDTypeScale
  • Fixed ForwardRewrite arguments
  • Removed unused relay._quantize.annotate (we moved to mod api)

See https://discuss.tvm.ai/t/quantization-broken-due-to-pr-3135/3237/6

cc @ZihengJiang @tmoreau89

Copy link
Contributor

@tmoreau89 tmoreau89 left a comment

Choose a reason for hiding this comment

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

Thank you for the patch! LGTM

@tmoreau89
Copy link
Contributor

@ZihengJiang can you review this PR before I merge it?

@tmoreau89 tmoreau89 requested a review from ZihengJiang July 11, 2019 18:51
@tqchen tqchen merged commit 45878ff into apache:master Jul 12, 2019
LOG(FATAL) << "should not touch here.";
dtype = cfg->dtype_activation;
}
for (size_t i = 0; i < ret.size(); ++i) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Hey @vinx13 , I guess we can remove this part with rewrite_for_vta, which will insert cast and stop_fusion in the end of residual block

Copy link
Member Author

@vinx13 vinx13 Jul 18, 2019

Choose a reason for hiding this comment

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

@ZihengJiang This part is needed when rewrite_for_vta is not enabled (store_lowbit_output=False), or we can remove this part in rewrite_for_vta?

Copy link
Contributor

Choose a reason for hiding this comment

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

@vinx13 Current Realize pass has been used to achieve multiple goals: insert stop_fusion; decide datatype; unify scales for some operator, etc. It's better to decouple things for passes, I would also like to make rewrite_for_vta and store_lowbit_output enabled by default.

wweic pushed a commit to wweic/tvm that referenced this pull request Aug 9, 2019
* [Relay][Quantization] Fix issue introduced in apache#3135

* Recover StopFusion

* Fix fmultiref

* Fix lint
wweic pushed a commit to neo-ai/tvm that referenced this pull request Sep 6, 2019
* [Relay][Quantization] Fix issue introduced in apache#3135

* Recover StopFusion

* Fix fmultiref

* Fix lint
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