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

Combine amp and qat #33484

Merged
merged 8 commits into from
Jun 21, 2021
Merged

Combine amp and qat #33484

merged 8 commits into from
Jun 21, 2021

Conversation

juncaipeng
Copy link
Contributor

@juncaipeng juncaipeng commented Jun 10, 2021

PR types

Others

PR changes

Others

Describe

  • Register FP16 kernels for fake_quant_dequant_ops
  • Add fake_quant_dequant_ops to the WHITE_LIST of amp
  • Add the unit test of combining amp and qat

@PaddlePaddle PaddlePaddle deleted a comment from paddle-bot-old bot Jun 10, 2021
Comment on lines 188 to 196
if (op_type == "moving_average_abs_max_scale") {
for (const auto& pair : ins) {
if (pair.first == "X" &&
pair.second.front()->DataType() ==
framework::proto::VarType::FP16) {
dst_type = framework::proto::VarType::FP16;
}
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

can it be handled like "batch_norm", as the code below?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

moving_average_abs_max_scale only considers the dtype of input(X) to determine the dest_type. However, "batch_norm" just cast the input(X) to FP16 or FP32. These are two different cases.

@paddle-bot-old
Copy link

Sorry to inform you that bbe2e45's CIs have passed for more than 7 days. To prevent PR conflicts, you need to re-run all CIs manually.

Copy link
Contributor

@zhiqiu zhiqiu left a comment

Choose a reason for hiding this comment

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

LGTM

@juncaipeng juncaipeng merged commit f88af20 into PaddlePaddle:develop Jun 21, 2021
@juncaipeng juncaipeng deleted the mix_amp_qat_1 branch June 21, 2021 06:38
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