Skip to content

Commit

Permalink
Merge pull request #102 from laipaang/qingshui-2.4.2
Browse files Browse the repository at this point in the history
beam support 20/30 and fused_multi_transformer_int8 keep fp32
  • Loading branch information
laipaang authored Dec 11, 2023
2 parents fa9e8e8 + b5928ba commit 5535c6f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
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

0 comments on commit 5535c6f

Please sign in to comment.