[Relay] improve SimplifyClipAndConsecutiveCast pass#15362
[Relay] improve SimplifyClipAndConsecutiveCast pass#15362Hzfengsy merged 3 commits intoapache:mainfrom
Conversation
|
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. Generated by tvm-bot |
|
Perhaps the failure of test is due to the optimization of this PR: this PR may reduce the memory the model requires. |
For now I just modify the ground truth of the test case to pass tests. Not sure if this is correct. Correct me if the original ground truth is indeed correct. |
| }; | ||
|
|
||
| bool CheckDataTypeMaxMinValue(DataType dtype, double min_value, double max_value) { | ||
| bool CheckDataTypeMaxMinValue(DataType dtype, double min_value, double max_value, int mode = 0) { |
There was a problem hiding this comment.
Please comment the meaning of different mode
This PR improves SimplifyClipAndConsecutiveCast pass in several aspects.
First, it allows that the dtype of
clipand the dtype of the lastcastdiffer.Second, it allows that there are arbitrary number of
castafterclip. This is achieved via the recursion of patterns.Both of the above two cases araise from the compilation of a prequantized model.
See the pre-RFC