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

fix QAT export bug in while OP #38102

Merged

Conversation

yghstill
Copy link
Contributor

PR types

Bug fixes

PR changes

APIs

Describe

When program has sub-block in while op, moving_average_abs_max_scale can't delete, so fix it. Details refer to PaddlePaddle/Paddle-Lite#7738

@paddle-bot-old
Copy link

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

@yghstill yghstill force-pushed the fix_sub_graph_qat_export branch from 9343fb1 to e320adc Compare December 14, 2021 01:58
@@ -486,6 +487,15 @@ def save_quantized_model(self, model, path, input_spec=None, **config):

self._gather_scales(infer_program, scope, fetch_targets)

# Remove `moving_average_abs_max_scale` node in sub graphs.
graph = IrGraph(core.Graph(infer_program.desc), for_test=False)
for sub_graph in graph.all_sub_graphs():
Copy link
Contributor

Choose a reason for hiding this comment

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

子图中的threshold有被正确设置么?只是在save infer model时没有删除op么?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

sub graph中threshold设置是正确的

@wanghaoshuang wanghaoshuang merged commit fff6e77 into PaddlePaddle:develop Dec 14, 2021
@yghstill yghstill deleted the fix_sub_graph_qat_export branch December 14, 2021 07:58
Caozhou1995 pushed a commit to Caozhou1995/Paddle that referenced this pull request Dec 29, 2021
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.

2 participants