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

beam support 20/30 and fused_multi_transformer_int8 keep fp32 #102

Merged
merged 1 commit into from
Dec 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions paddle/phi/kernels/fusion/gpu/beam_search_softmax.cu
Original file line number Diff line number Diff line change
Expand Up @@ -840,6 +840,8 @@ void invokeTopkSoftMax(const Context &dev_ctx,
CASE_K(14);
CASE_K(15);
CASE_K(16);
CASE_K(20);
CASE_K(30);
CASE_K(50);
default:
PADDLE_THROW(paddle::platform::errors::Unimplemented(
Expand Down
5 changes: 3 additions & 2 deletions python/paddle/fluid/contrib/mixed_precision/fp16_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,9 @@ def _keep_fp32_input(op, in_name):
return in_name in {
'LnScale', 'LnBias', 'Ln2Scale', 'Ln2Bias', "Ln1Scale", "Ln1Bias"
}
if op_type in ['fused_multi_transformer', 'fused_multi_transformer_moe']:
return in_name in {'LnScale', 'LnBias', 'FFNLnScale', 'FFNLnBias'}
if op_type in ['fused_multi_transformer', 'fused_multi_transformer_int8', 'fused_multi_transformer_moe']:
return in_name in {'LnScale', 'LnBias', 'FFNLnScale', 'FFNLnBias', 'QKVOutScale',
'OutLinearOutScale', 'FFN1OutScale', 'FFN2OutScale'}
return False


Expand Down