Skip to content

[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
merged 11 commits into from
Oct 26, 2021

Conversation

Wangzheee
Copy link
Contributor

@Wangzheee Wangzheee commented Oct 22, 2021

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

@paddle-bot-old
Copy link

Thanks for your contribution!
Please wait for the result of CI firstly. See Paddle CI Manual for details.

shangzhizhou
shangzhizhou previously approved these changes Oct 24, 2021
Copy link
Member

@shangzhizhou shangzhizhou left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link

@cryoco cryoco left a comment

Choose a reason for hiding this comment

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

LGTM

@cryoco cryoco merged commit 93c591e into PaddlePaddle:develop Oct 26, 2021
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
Superjomn pushed a commit that referenced this pull request Oct 26, 2021
…matmul, mul) convert pass, fix (matmul, mul) op_teller (#36652) (#36737)
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