Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle
提交
95c4bb41
P
Paddle
项目概览
PaddlePaddle
/
Paddle
大约 1 年 前同步成功
通知
2298
Star
20931
Fork
5422
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1423
列表
看板
标记
里程碑
合并请求
543
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1,423
Issue
1,423
列表
看板
标记
里程碑
合并请求
543
合并请求
543
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
95c4bb41
编写于
8月 21, 2023
作者:
R
RichardWooSJTU
提交者:
GitHub
8月 21, 2023
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix dynamic to static when export LLM inference model (#56390)
上级
36153898
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
24 addition
and
15 deletion
+24
-15
paddle/phi/infermeta/multiary.cc
paddle/phi/infermeta/multiary.cc
+12
-9
paddle/phi/infermeta/multiary.h
paddle/phi/infermeta/multiary.h
+2
-1
python/paddle/distributed/communication/stream/all_reduce.py
python/paddle/distributed/communication/stream/all_reduce.py
+1
-0
python/paddle/distributed/fleet/layers/mpu/mp_ops.py
python/paddle/distributed/fleet/layers/mpu/mp_ops.py
+4
-4
python/paddle/incubate/nn/functional/fused_layer_norm.py
python/paddle/incubate/nn/functional/fused_layer_norm.py
+5
-1
未找到文件。
paddle/phi/infermeta/multiary.cc
浏览文件 @
95c4bb41
...
...
@@ -1446,7 +1446,8 @@ void FusedBiasActInferMeta(const MetaTensor& x,
int
quant_round_type
,
float
quant_max_bound
,
float
quant_min_bound
,
MetaTensor
*
out
)
{
MetaTensor
*
out
,
MetaConfig
config
)
{
auto
x_dims
=
x
.
dims
();
PADDLE_ENFORCE_EQ
(
x_dims
.
size
(),
2
,
...
...
@@ -1455,15 +1456,17 @@ void FusedBiasActInferMeta(const MetaTensor& x,
auto
token_num
=
x_dims
[
0
];
auto
dim
=
x_dims
[
1
];
PADDLE_ENFORCE_GT
(
x_dims
[
0
],
0
,
phi
::
errors
::
InvalidArgument
(
"The size of Attr(rows) must > 0"
));
if
(
!
config
.
is_runtime
)
{
PADDLE_ENFORCE_GT
(
x_dims
[
0
],
0
,
phi
::
errors
::
InvalidArgument
(
"The size of Attr(rows) must > 0"
));
PADDLE_ENFORCE_GT
(
x_dims
[
1
],
0
,
phi
::
errors
::
InvalidArgument
(
"The size of Attr(cols) must > 0"
));
PADDLE_ENFORCE_GT
(
x_dims
[
1
],
0
,
phi
::
errors
::
InvalidArgument
(
"The size of Attr(cols) must > 0"
));
}
if
(
act_method
==
"geglu"
||
act_method
==
"swiglu"
)
{
PADDLE_ENFORCE_EQ
(
...
...
paddle/phi/infermeta/multiary.h
浏览文件 @
95c4bb41
...
...
@@ -318,7 +318,8 @@ void FusedBiasActInferMeta(const MetaTensor& x,
int
quant_round_type
,
float
quant_max_bound
,
float
quant_min_bound
,
MetaTensor
*
out
);
MetaTensor
*
out
,
MetaConfig
config
=
MetaConfig
());
void
FusedLayerNormInferMeta
(
const
MetaTensor
&
x
,
const
MetaTensor
&
bias
,
...
...
python/paddle/distributed/communication/stream/all_reduce.py
浏览文件 @
95c4bb41
...
...
@@ -47,6 +47,7 @@ def _all_reduce_in_static_mode(tensor, op, group, sync_op, use_calc_stream):
'int8'
,
'uint8'
,
'bool'
,
'uint16'
,
],
'all_reduce'
,
)
...
...
python/paddle/distributed/fleet/layers/mpu/mp_ops.py
浏览文件 @
95c4bb41
...
...
@@ -109,7 +109,7 @@ def _c_identity(tensor, group=None):
check_variable_and_dtype
(
tensor
,
'tensor'
,
[
'float16'
,
'float32'
,
'float64'
,
'int32'
,
'int64'
],
[
'float16'
,
'float32'
,
'float64'
,
'int32'
,
'int64'
,
'uint16'
],
'_c_identity'
,
)
...
...
@@ -169,7 +169,7 @@ def _c_concat(tensor, group=None):
check_variable_and_dtype
(
tensor
,
'tensor'
,
[
'float16'
,
'float32'
,
'float64'
,
'int32'
,
'int64'
],
[
'float16'
,
'float32'
,
'float64'
,
'int32'
,
'int64'
,
'uint16'
],
'_c_concat'
,
)
...
...
@@ -235,7 +235,7 @@ def _c_split(tensor, group=None):
check_variable_and_dtype
(
tensor
,
'tensor'
,
[
'float16'
,
'float32'
,
'float64'
,
'int32'
,
'int64'
],
[
'float16'
,
'float32'
,
'float64'
,
'int32'
,
'int64'
,
'uint16'
],
'_c_split'
,
)
...
...
@@ -322,7 +322,7 @@ def _mp_allreduce(
check_variable_and_dtype
(
tensor
,
'tensor'
,
[
'float16'
,
'float32'
,
'float64'
,
'int32'
,
'int64'
],
[
'float16'
,
'float32'
,
'float64'
,
'int32'
,
'int64'
'uint16'
],
op_type
,
)
...
...
python/paddle/incubate/nn/functional/fused_layer_norm.py
浏览文件 @
95c4bb41
...
...
@@ -102,7 +102,11 @@ def fused_layer_norm(
residual_out
=
helper
.
create_variable_for_type_inference
(
dtype
=
x
.
dtype
)
outputs_dict
[
'residual_out'
]
=
residual_out
inputs
=
{
'x'
:
x
,
'norm_weight'
:
norm_weight
,
'norm_bias'
:
norm_bias
}
inputs
=
{
'x'
:
x
}
if
norm_weight
is
not
None
:
inputs
[
'norm_weight'
]
=
norm_weight
if
norm_bias
is
not
None
:
inputs
[
'norm_bias'
]
=
norm_bias
if
residual
is
not
None
:
inputs
[
'residual'
]
=
residual
if
bias
is
not
None
:
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录