-
Notifications
You must be signed in to change notification settings - Fork 5.7k
[Paddle-Inference]Add MatmulV2ToMatmul convert Pass, fix (matmul_v2, matmul, mul) convert pass, fix (matmul, mul) op_teller #36652
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
Merged
cryoco
merged 11 commits into
PaddlePaddle:develop
from
Wangzheee:new_Matmul2ToMatmulToMul
Oct 26, 2021
Merged
[Paddle-Inference]Add MatmulV2ToMatmul convert Pass, fix (matmul_v2, matmul, mul) convert pass, fix (matmul, mul) op_teller #36652
cryoco
merged 11 commits into
PaddlePaddle:develop
from
Wangzheee:new_Matmul2ToMatmulToMul
Oct 26, 2021
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Thanks for your contribution! |
shangzhizhou
previously approved these changes
Oct 24, 2021
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
cryoco
approved these changes
Oct 26, 2021
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Wangzheee
added a commit
to Wangzheee/Paddle
that referenced
this pull request
Oct 26, 2021
…matmul, mul) convert pass, fix (matmul, mul) op_teller (PaddlePaddle#36652) * new_Matmul2ToMatmulToMul * new_Matmul2ToMatmulToMul * fix paddle_pass_builder * fix paddle_pass_builder * fix paddle_pass_builder * tem * tem * Add MatmulV2ToMatmul convert Pass; MatmulV2ToMul convert Pass * Add MatmulV2ToMatmul convert Pass; MatmulV2ToMul convert Pass * add matmul_broadcast_unitest * fix op_teller
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
PR types
Others
PR changes
Others
Describe
修改MatmulV2ToMul 的 Pass,重新限定 (matmul_v2 to mul) 映射的 Pass,增加 MatmulV2ToMatmul 的 Pass,限定 (matmul_v2 to matmul) 映射的 Pass条件(不支持广播),修改 (matmul, mul) 的 op_teller 映射条件:
1、 MapMatmulV2ToMatmulPass:原生 op 的映射(matmul_v2 无 scales 的参数,matmul不支持广播);
2、MapMatmul2MulPass、MatmulV2ToMulPass:限制matmul、matmul_v2 映射到 mul 的条件(当 alpha 存在时 ==1、transpose_X==false、transpose_Y==false、y.dims==2、等),移除之前过度的限制(很多无用落后版本的限制,x.dims,后一个 OP 不一定必须是 elementwise_add);
3、修复之前 pass 映射导致的 op 中量化信息(out_threshold)的丢失;
4、增加matmul 的op_teller映射条件:不支持广播的限制;
5、增加mul 的op_teller映射条件:y.dims ==2、y_num_col_dims ==1;
6、动态图量化增加限制:只支持fake_quantize_dequantize_abs_max、fake_channel_wise_quantize_dequantize_abs_max