Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle
提交
9a04540c
P
Paddle
项目概览
PaddlePaddle
/
Paddle
1 年多 前同步成功
通知
2302
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看板
未验证
提交
9a04540c
编写于
8月 10, 2022
作者:
Z
zhoutianzi666
提交者:
GitHub
8月 10, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[Paddle-TRT] fix conv2d/int64 (#45023)
* fix_conv2d_2_3 * commit * fix_conv2d_2_3 * fix_conv2d_2_3 * fix_conv2d_2_3
上级
cbab0184
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
61 addition
and
0 deletion
+61
-0
paddle/fluid/inference/tensorrt/op_teller.cc
paddle/fluid/inference/tensorrt/op_teller.cc
+61
-0
未找到文件。
paddle/fluid/inference/tensorrt/op_teller.cc
浏览文件 @
9a04540c
...
...
@@ -354,6 +354,22 @@ bool OpTeller::Tell(const framework::ir::Node* node,
}
}
#endif
// In fact, this should include all conv, not only conv2d
if
(
op_type
==
"conv2d"
)
{
auto
*
block
=
desc
.
Block
();
if
(
block
==
nullptr
)
{
VLOG
(
3
)
<<
"The block desc is nullptr, we can't continue to analyze. "
"Developers need to check whether block_desc is passed in "
"the pass."
;
return
false
;
}
auto
*
filter_var_desc
=
block
->
FindVar
(
desc
.
Input
(
"Filter"
)[
0
]);
if
(
!
filter_var_desc
->
Persistable
())
{
VLOG
(
3
)
<<
"Trt not support filter is a intermediate tensor in "
"conv2d op."
;
return
false
;
}
}
}
if
(
op_type
==
"deformable_conv"
)
{
...
...
@@ -912,6 +928,19 @@ bool OpTeller::Tell(const framework::ir::Node* node,
return
false
;
}
}
auto
*
block
=
desc
.
Block
();
if
(
block
==
nullptr
)
{
VLOG
(
3
)
<<
"The block desc is nullptr, we can't continue to analyze. "
"Developers need to check whether block_desc is passed in "
"the pass."
;
return
false
;
}
auto
*
x_var_desc
=
block
->
FindVar
(
desc
.
Input
(
"X"
)[
0
]);
auto
dtype
=
x_var_desc
->
GetDataType
();
// At present, forbid int64_t into trt.
if
(
dtype
==
3
)
{
return
false
;
}
}
if
(
op_type
==
"unsqueeze2"
)
{
...
...
@@ -931,6 +960,19 @@ bool OpTeller::Tell(const framework::ir::Node* node,
return
false
;
}
}
auto
*
block
=
desc
.
Block
();
if
(
block
==
nullptr
)
{
VLOG
(
3
)
<<
"The block desc is nullptr, we can't continue to analyze. "
"Developers need to check whether block_desc is passed in "
"the pass."
;
return
false
;
}
auto
*
x_var_desc
=
block
->
FindVar
(
desc
.
Input
(
"X"
)[
0
]);
auto
dtype
=
x_var_desc
->
GetDataType
();
// At present, forbid int64_t into trt.
if
(
dtype
==
3
)
{
return
false
;
}
}
if
(
op_type
==
"batch_norm"
)
{
...
...
@@ -1073,6 +1115,11 @@ bool OpTeller::Tell(const framework::ir::Node* node,
auto
x_var_name
=
desc
.
Input
(
"X"
)[
0
];
auto
*
x_var_desc
=
block
->
FindVar
(
x_var_name
);
const
auto
x_shape
=
x_var_desc
->
GetShape
();
auto
dtype
=
x_var_desc
->
GetDataType
();
// At present, only support float32 or float16 into trt.
if
(
!
(
dtype
==
5
||
dtype
==
4
))
{
return
false
;
}
if
(
!
with_dynamic_shape
&&
x_shape
.
size
()
==
1
)
{
VLOG
(
3
)
<<
"Scale op does not support 1-dimensional input in tensorrt"
;
return
false
;
...
...
@@ -1163,6 +1210,20 @@ bool OpTeller::Tell(const framework::ir::Node* node,
return
false
;
}
}
auto
*
block
=
desc
.
Block
();
if
(
block
==
nullptr
)
{
VLOG
(
3
)
<<
"The block desc is nullptr, we can't continue to analyze. "
"Developers need to check whether block_desc is passed in "
"the pass."
;
return
false
;
}
auto
*
x_var_desc
=
block
->
FindVar
(
desc
.
Input
(
"Input"
)[
0
]);
auto
dtype
=
x_var_desc
->
GetDataType
();
// At present, forbid int64_t into trt.
if
(
dtype
==
3
)
{
return
false
;
}
}
if
(
op_type
==
"elementwise_add"
||
op_type
==
"elementwise_mul"
||
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录