Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Crayon鑫
Paddle
提交
a540769b
P
Paddle
项目概览
Crayon鑫
/
Paddle
与 Fork 源项目一致
Fork自
PaddlePaddle / Paddle
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
a540769b
编写于
10月 25, 2021
作者:
W
Wilber
提交者:
GitHub
10月 25, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[cherry-pick] enable trt test check and fix trt ut error (#36549) (#36655)
上级
0951bfd1
变更
15
隐藏空白更改
内联
并排
Showing
15 changed file
with
87 addition
and
12 deletion
+87
-12
paddle/fluid/inference/tensorrt/op_teller.cc
paddle/fluid/inference/tensorrt/op_teller.cc
+8
-0
python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_activation.py
...sts/unittests/ir/inference/test_trt_convert_activation.py
+1
-0
python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_affine_channel.py
...unittests/ir/inference/test_trt_convert_affine_channel.py
+1
-0
python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_elementwise.py
...ts/unittests/ir/inference/test_trt_convert_elementwise.py
+1
-0
python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_flatten.py
.../tests/unittests/ir/inference/test_trt_convert_flatten.py
+53
-12
python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_gather.py
...d/tests/unittests/ir/inference/test_trt_convert_gather.py
+1
-0
python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_gather_nd.py
...ests/unittests/ir/inference/test_trt_convert_gather_nd.py
+1
-0
python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_gelu.py
...uid/tests/unittests/ir/inference/test_trt_convert_gelu.py
+1
-0
python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_group_norm.py
...sts/unittests/ir/inference/test_trt_convert_group_norm.py
+1
-0
python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_prelu.py
...id/tests/unittests/ir/inference/test_trt_convert_prelu.py
+14
-0
python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_reshape.py
.../tests/unittests/ir/inference/test_trt_convert_reshape.py
+1
-0
python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_scale.py
...id/tests/unittests/ir/inference/test_trt_convert_scale.py
+1
-0
python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_shuffle_channel.py
...nittests/ir/inference/test_trt_convert_shuffle_channel.py
+1
-0
python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_swish.py
...id/tests/unittests/ir/inference/test_trt_convert_swish.py
+1
-0
python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_transpose.py
...ests/unittests/ir/inference/test_trt_convert_transpose.py
+1
-0
未找到文件。
paddle/fluid/inference/tensorrt/op_teller.cc
浏览文件 @
a540769b
...
...
@@ -1155,6 +1155,14 @@ bool OpTeller::Tell(const framework::ir::Node* node, bool use_no_calib_int8,
return
false
;
}
}
#if IS_TRT_VERSION_LT(7000)
if
(
!
with_dynamic_shape
)
{
// TODO(inference): fix trt6 static plugin error.
VLOG
(
3
)
<<
"prelu static plugin in trt6 has bug."
;
return
false
;
}
#endif
}
if
(
op_type
==
"roi_align"
)
{
...
...
python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_activation.py
浏览文件 @
a540769b
...
...
@@ -14,6 +14,7 @@
from
trt_layer_auto_scan_test
import
TrtLayerAutoScanTest
,
SkipReasons
from
program_config
import
TensorConfig
,
ProgramConfig
import
unittest
import
numpy
as
np
import
paddle.inference
as
paddle_infer
from
functools
import
partial
...
...
python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_affine_channel.py
浏览文件 @
a540769b
...
...
@@ -14,6 +14,7 @@
from
trt_layer_auto_scan_test
import
TrtLayerAutoScanTest
,
SkipReasons
from
program_config
import
TensorConfig
,
ProgramConfig
import
unittest
import
numpy
as
np
import
paddle.inference
as
paddle_infer
from
functools
import
partial
...
...
python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_elementwise.py
浏览文件 @
a540769b
...
...
@@ -14,6 +14,7 @@
from
trt_layer_auto_scan_test
import
TrtLayerAutoScanTest
,
SkipReasons
from
program_config
import
TensorConfig
,
ProgramConfig
import
unittest
import
numpy
as
np
import
paddle.inference
as
paddle_infer
from
functools
import
partial
...
...
python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_flatten.py
浏览文件 @
a540769b
...
...
@@ -14,6 +14,7 @@
from
trt_layer_auto_scan_test
import
TrtLayerAutoScanTest
,
SkipReasons
from
program_config
import
TensorConfig
,
ProgramConfig
import
unittest
import
numpy
as
np
import
paddle.inference
as
paddle_infer
from
functools
import
partial
...
...
@@ -73,10 +74,20 @@ class TrtConvertFlattenTest_dim_2(TrtLayerAutoScanTest):
self
.
dynamic_shape
.
opt_input_shape
=
{}
def
generate_trt_nodes_num
(
attrs
,
dynamic_shape
):
if
attrs
[
0
][
'axis'
]
==
1
:
return
1
,
2
ver
=
paddle_infer
.
get_trt_compile_version
()
if
ver
[
0
]
*
1000
+
ver
[
1
]
*
100
+
ver
[
0
]
*
10
>=
7130
:
if
attrs
[
0
][
'axis'
]
==
1
:
return
1
,
2
else
:
return
0
,
3
else
:
return
0
,
3
if
dynamic_shape
:
return
0
,
3
if
attrs
[
0
][
'axis'
]
==
1
:
return
1
,
2
else
:
return
0
,
3
attrs
=
[
program_config
.
ops
[
i
].
attrs
...
...
@@ -157,10 +168,20 @@ class TrtConvertFlattenTest_dim_3(TrtLayerAutoScanTest):
self
.
dynamic_shape
.
opt_input_shape
=
{}
def
generate_trt_nodes_num
(
attrs
,
dynamic_shape
):
if
attrs
[
0
][
'axis'
]
==
1
:
return
1
,
2
ver
=
paddle_infer
.
get_trt_compile_version
()
if
ver
[
0
]
*
1000
+
ver
[
1
]
*
100
+
ver
[
0
]
*
10
>=
7130
:
if
attrs
[
0
][
'axis'
]
==
1
:
return
1
,
2
else
:
return
0
,
3
else
:
return
0
,
3
if
dynamic_shape
:
return
0
,
3
if
attrs
[
0
][
'axis'
]
==
1
:
return
1
,
2
else
:
return
0
,
3
attrs
=
[
program_config
.
ops
[
i
].
attrs
...
...
@@ -241,10 +262,20 @@ class TrtConvertFlattenTest_dim_4(TrtLayerAutoScanTest):
self
.
dynamic_shape
.
opt_input_shape
=
{}
def
generate_trt_nodes_num
(
attrs
,
dynamic_shape
):
if
attrs
[
0
][
'axis'
]
==
1
:
return
1
,
2
ver
=
paddle_infer
.
get_trt_compile_version
()
if
ver
[
0
]
*
1000
+
ver
[
1
]
*
100
+
ver
[
0
]
*
10
>=
7130
:
if
attrs
[
0
][
'axis'
]
==
1
:
return
1
,
2
else
:
return
0
,
3
else
:
return
0
,
3
if
dynamic_shape
:
return
0
,
3
if
attrs
[
0
][
'axis'
]
==
1
:
return
1
,
2
else
:
return
0
,
3
attrs
=
[
program_config
.
ops
[
i
].
attrs
...
...
@@ -325,10 +356,20 @@ class TrtConvertFlattenTest_dim_5(TrtLayerAutoScanTest):
self
.
dynamic_shape
.
opt_input_shape
=
{}
def
generate_trt_nodes_num
(
attrs
,
dynamic_shape
):
if
attrs
[
0
][
'axis'
]
==
1
:
return
1
,
2
ver
=
paddle_infer
.
get_trt_compile_version
()
if
ver
[
0
]
*
1000
+
ver
[
1
]
*
100
+
ver
[
0
]
*
10
>=
7130
:
if
attrs
[
0
][
'axis'
]
==
1
:
return
1
,
2
else
:
return
0
,
3
else
:
return
0
,
3
if
dynamic_shape
:
return
0
,
3
if
attrs
[
0
][
'axis'
]
==
1
:
return
1
,
2
else
:
return
0
,
3
attrs
=
[
program_config
.
ops
[
i
].
attrs
...
...
python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_gather.py
浏览文件 @
a540769b
...
...
@@ -19,6 +19,7 @@ import paddle.inference as paddle_infer
from
functools
import
partial
from
typing
import
Optional
,
List
,
Callable
,
Dict
,
Any
,
Set
import
logging
import
unittest
class
TrtConvertGatherTest
(
TrtLayerAutoScanTest
):
...
...
python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_gather_nd.py
浏览文件 @
a540769b
...
...
@@ -18,6 +18,7 @@ import numpy as np
import
paddle.inference
as
paddle_infer
from
functools
import
partial
from
typing
import
Optional
,
List
,
Callable
,
Dict
,
Any
,
Set
import
unittest
class
TrtConvertGatherNdTest_dim_4_1
(
TrtLayerAutoScanTest
):
...
...
python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_gelu.py
浏览文件 @
a540769b
...
...
@@ -18,6 +18,7 @@ import numpy as np
import
paddle.inference
as
paddle_infer
from
functools
import
partial
from
typing
import
Optional
,
List
,
Callable
,
Dict
,
Any
,
Set
import
unittest
class
TrtConvertGeluTest
(
TrtLayerAutoScanTest
):
...
...
python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_group_norm.py
浏览文件 @
a540769b
...
...
@@ -18,6 +18,7 @@ import numpy as np
import
paddle.inference
as
paddle_infer
from
functools
import
partial
from
typing
import
Optional
,
List
,
Callable
,
Dict
,
Any
,
Set
import
unittest
class
TrtConvertGroupNormTest
(
TrtLayerAutoScanTest
):
...
...
python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_prelu.py
浏览文件 @
a540769b
...
...
@@ -18,6 +18,7 @@ import numpy as np
import
paddle.inference
as
paddle_infer
from
functools
import
partial
from
typing
import
Optional
,
List
,
Callable
,
Dict
,
Any
,
Set
import
unittest
class
TrtConvertPreluTest
(
TrtLayerAutoScanTest
):
...
...
@@ -186,6 +187,19 @@ class TrtConvertPreluTest(TrtLayerAutoScanTest):
"Need to repair the case: the output of GPU and tensorrt has diff when the input dimension is 2 in static shape mode."
)
ver
=
paddle_infer
.
get_trt_compile_version
()
if
ver
[
0
]
*
1000
+
ver
[
1
]
*
100
+
ver
[
0
]
*
10
<
7000
:
def
teller
(
program_config
,
predictor_config
):
if
not
predictor_config
.
tensorrt_dynamic_shape_enabled
():
return
True
return
False
self
.
add_skip_case
(
teller
,
SkipReasons
.
TRT_NOT_IMPLEMENTED
,
"Need to repair the case: the output of GPU and tensorrt has diff in trt6, the prelu static plugin has bug."
)
def
test
(
self
):
self
.
add_skip_trt_case
()
self
.
run_test
()
...
...
python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_reshape.py
浏览文件 @
a540769b
...
...
@@ -18,6 +18,7 @@ import numpy as np
import
paddle.inference
as
paddle_infer
from
functools
import
partial
from
typing
import
Optional
,
List
,
Callable
,
Dict
,
Any
,
Set
import
unittest
class
TrtConvertReshapeTest
(
TrtLayerAutoScanTest
):
...
...
python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_scale.py
浏览文件 @
a540769b
...
...
@@ -18,6 +18,7 @@ import numpy as np
import
paddle.inference
as
paddle_infer
from
functools
import
partial
from
typing
import
Optional
,
List
,
Callable
,
Dict
,
Any
,
Set
import
unittest
class
TrtConvertScaleTest
(
TrtLayerAutoScanTest
):
...
...
python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_shuffle_channel.py
浏览文件 @
a540769b
...
...
@@ -18,6 +18,7 @@ import numpy as np
import
paddle.inference
as
paddle_infer
from
functools
import
partial
from
typing
import
Optional
,
List
,
Callable
,
Dict
,
Any
,
Set
import
unittest
class
TrtConvertShuffleChannelTest
(
TrtLayerAutoScanTest
):
...
...
python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_swish.py
浏览文件 @
a540769b
...
...
@@ -18,6 +18,7 @@ import numpy as np
import
paddle.inference
as
paddle_infer
from
functools
import
partial
from
typing
import
Optional
,
List
,
Callable
,
Dict
,
Any
,
Set
import
unittest
class
TrtConvertSwishTest
(
TrtLayerAutoScanTest
):
...
...
python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_transpose.py
浏览文件 @
a540769b
...
...
@@ -18,6 +18,7 @@ import numpy as np
import
paddle.inference
as
paddle_infer
from
functools
import
partial
from
typing
import
Optional
,
List
,
Callable
,
Dict
,
Any
,
Set
import
unittest
class
TrtConvertTransposeTest
(
TrtLayerAutoScanTest
):
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录