Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
BaiXuePrincess
Paddle
提交
d9187869
P
Paddle
项目概览
BaiXuePrincess
/
Paddle
与 Fork 源项目一致
Fork自
PaddlePaddle / Paddle
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
d9187869
编写于
4月 02, 2021
作者:
W
Wilber
提交者:
GitHub
4月 02, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update trt engine addplugin name. (#32018)
* update trt engine addplugin name. * update
上级
94736d60
变更
13
隐藏空白更改
内联
并排
Showing
13 changed file
with
17 addition
and
16 deletion
+17
-16
paddle/fluid/inference/tensorrt/convert/elementwise_op.cc
paddle/fluid/inference/tensorrt/convert/elementwise_op.cc
+1
-1
paddle/fluid/inference/tensorrt/convert/emb_eltwise_layernorm.cc
...fluid/inference/tensorrt/convert/emb_eltwise_layernorm.cc
+1
-1
paddle/fluid/inference/tensorrt/convert/gelu_op.cc
paddle/fluid/inference/tensorrt/convert/gelu_op.cc
+1
-1
paddle/fluid/inference/tensorrt/convert/multihead_matmul_op.cc
...e/fluid/inference/tensorrt/convert/multihead_matmul_op.cc
+1
-1
paddle/fluid/inference/tensorrt/convert/pool2d_op.cc
paddle/fluid/inference/tensorrt/convert/pool2d_op.cc
+1
-1
paddle/fluid/inference/tensorrt/convert/prelu_op.cc
paddle/fluid/inference/tensorrt/convert/prelu_op.cc
+1
-1
paddle/fluid/inference/tensorrt/convert/skip_layernorm.cc
paddle/fluid/inference/tensorrt/convert/skip_layernorm.cc
+1
-1
paddle/fluid/inference/tensorrt/convert/slice_op.cc
paddle/fluid/inference/tensorrt/convert/slice_op.cc
+3
-3
paddle/fluid/inference/tensorrt/convert/split_op.cc
paddle/fluid/inference/tensorrt/convert/split_op.cc
+1
-1
paddle/fluid/inference/tensorrt/convert/stack_op.cc
paddle/fluid/inference/tensorrt/convert/stack_op.cc
+1
-1
paddle/fluid/inference/tensorrt/convert/swish_op.cc
paddle/fluid/inference/tensorrt/convert/swish_op.cc
+1
-1
paddle/fluid/inference/tensorrt/engine.h
paddle/fluid/inference/tensorrt/engine.h
+3
-3
paddle/fluid/inference/tensorrt/plugin/roi_align_op_plugin.cu
...le/fluid/inference/tensorrt/plugin/roi_align_op_plugin.cu
+1
-0
未找到文件。
paddle/fluid/inference/tensorrt/convert/elementwise_op.cc
浏览文件 @
d9187869
...
@@ -251,7 +251,7 @@ class ElementwiseTensorOpConverter : public OpConverter {
...
@@ -251,7 +251,7 @@ class ElementwiseTensorOpConverter : public OpConverter {
#if IS_TRT_VERSION_GE(6000)
#if IS_TRT_VERSION_GE(6000)
plugin
::
ElementwisePluginDynamic
*
plugin
=
plugin
::
ElementwisePluginDynamic
*
plugin
=
new
plugin
::
ElementwisePluginDynamic
(
op_type_
,
axis
);
new
plugin
::
ElementwisePluginDynamic
(
op_type_
,
axis
);
layer
=
engine_
->
Add
PluginV2
(
itensors
.
data
(),
2
,
plugin
);
layer
=
engine_
->
Add
DynamicPlugin
(
itensors
.
data
(),
2
,
plugin
);
#else
#else
PADDLE_THROW
(
platform
::
errors
::
Fatal
(
PADDLE_THROW
(
platform
::
errors
::
Fatal
(
"You are running the TRT Dynamic Shape mode, need to confirm that "
"You are running the TRT Dynamic Shape mode, need to confirm that "
...
...
paddle/fluid/inference/tensorrt/convert/emb_eltwise_layernorm.cc
浏览文件 @
d9187869
...
@@ -169,7 +169,7 @@ class EmbEltwiseLayerNormOpConverter : public OpConverter {
...
@@ -169,7 +169,7 @@ class EmbEltwiseLayerNormOpConverter : public OpConverter {
plugin
=
new
plugin
::
EmbEltwiseLayernormPluginDynamic
(
plugin
=
new
plugin
::
EmbEltwiseLayernormPluginDynamic
(
input_embs
,
bias
,
scale
,
emb_sizes
,
bias_size
,
scale_size
,
hidden
,
input_embs
,
bias
,
scale
,
emb_sizes
,
bias_size
,
scale_size
,
hidden
,
eps
,
with_fp16
);
eps
,
with_fp16
);
layer
=
engine_
->
Add
PluginV2
(
input_ids
.
data
(),
input_num
,
plugin
);
layer
=
engine_
->
Add
DynamicPlugin
(
input_ids
.
data
(),
input_num
,
plugin
);
auto
output_name
=
op_desc
.
Output
(
"Out"
)[
0
];
auto
output_name
=
op_desc
.
Output
(
"Out"
)[
0
];
RreplenishLayerAndOutput
(
layer
,
"emb_eltwise_layernorm"
,
{
output_name
},
RreplenishLayerAndOutput
(
layer
,
"emb_eltwise_layernorm"
,
{
output_name
},
test_mode
);
test_mode
);
...
...
paddle/fluid/inference/tensorrt/convert/gelu_op.cc
浏览文件 @
d9187869
...
@@ -64,7 +64,7 @@ class GeluOpConverter : public OpConverter {
...
@@ -64,7 +64,7 @@ class GeluOpConverter : public OpConverter {
engine_
->
WithFp16
()
&&
!
engine_
->
disable_trt_plugin_fp16
();
engine_
->
WithFp16
()
&&
!
engine_
->
disable_trt_plugin_fp16
();
plugin
::
GeluPluginDynamic
*
plugin
=
plugin
::
GeluPluginDynamic
*
plugin
=
new
plugin
::
GeluPluginDynamic
(
with_fp16
);
new
plugin
::
GeluPluginDynamic
(
with_fp16
);
layer
=
engine_
->
Add
PluginV2
(
&
input
,
input_num
,
plugin
);
layer
=
engine_
->
Add
DynamicPlugin
(
&
input
,
input_num
,
plugin
);
#else
#else
PADDLE_THROW
(
platform
::
errors
::
Fatal
(
PADDLE_THROW
(
platform
::
errors
::
Fatal
(
"You are running the TRT Dynamic Shape mode, need to confirm that "
"You are running the TRT Dynamic Shape mode, need to confirm that "
...
...
paddle/fluid/inference/tensorrt/convert/multihead_matmul_op.cc
浏览文件 @
d9187869
...
@@ -227,7 +227,7 @@ class MultiheadMatMulOpConverter : public OpConverter {
...
@@ -227,7 +227,7 @@ class MultiheadMatMulOpConverter : public OpConverter {
plugin
::
DynamicPluginTensorRT
*
plugin
=
plugin
::
DynamicPluginTensorRT
*
plugin
=
new
plugin
::
QkvToContextPluginDynamic
(
hidden_in
,
head_number
,
new
plugin
::
QkvToContextPluginDynamic
(
hidden_in
,
head_number
,
head_size
,
scale
,
with_fp16
);
head_size
,
scale
,
with_fp16
);
layer
=
engine_
->
Add
PluginV2
(
plugin_inputs
.
data
(),
2
,
plugin
);
layer
=
engine_
->
Add
DynamicPlugin
(
plugin_inputs
.
data
(),
2
,
plugin
);
}
}
}
else
{
}
else
{
PADDLE_THROW
(
platform
::
errors
::
Fatal
(
PADDLE_THROW
(
platform
::
errors
::
Fatal
(
...
...
paddle/fluid/inference/tensorrt/convert/pool2d_op.cc
浏览文件 @
d9187869
...
@@ -147,7 +147,7 @@ class Pool2dOpConverter : public OpConverter {
...
@@ -147,7 +147,7 @@ class Pool2dOpConverter : public OpConverter {
plugin
::
PoolPluginDynamic
*
plugin
=
plugin
::
PoolPluginDynamic
*
plugin
=
new
plugin
::
PoolPluginDynamic
(
ceil_mode
,
pool_type
,
adaptive
,
ksize
,
new
plugin
::
PoolPluginDynamic
(
ceil_mode
,
pool_type
,
adaptive
,
ksize
,
strides
,
paddings
,
global_pooling
);
strides
,
paddings
,
global_pooling
);
layer
=
engine_
->
Add
PluginV2
(
&
input1
,
1
,
plugin
);
layer
=
engine_
->
Add
DynamicPlugin
(
&
input1
,
1
,
plugin
);
#endif
#endif
}
}
auto
output_name
=
op_desc
.
Output
(
"Out"
)[
0
];
auto
output_name
=
op_desc
.
Output
(
"Out"
)[
0
];
...
...
paddle/fluid/inference/tensorrt/convert/prelu_op.cc
浏览文件 @
d9187869
...
@@ -65,7 +65,7 @@ class PReluOpConverter : public OpConverter {
...
@@ -65,7 +65,7 @@ class PReluOpConverter : public OpConverter {
#if IS_TRT_VERSION_GE(6000)
#if IS_TRT_VERSION_GE(6000)
plugin
::
PReluPluginDynamic
*
plugin
=
new
plugin
::
PReluPluginDynamic
(
plugin
::
PReluPluginDynamic
*
plugin
=
new
plugin
::
PReluPluginDynamic
(
alpha_data
,
alpha_tensor_temp
->
numel
(),
mode
);
alpha_data
,
alpha_tensor_temp
->
numel
(),
mode
);
layer
=
engine_
->
Add
PluginV2
(
&
input
,
input_num
,
plugin
);
layer
=
engine_
->
Add
DynamicPlugin
(
&
input
,
input_num
,
plugin
);
#else
#else
PADDLE_THROW
(
platform
::
errors
::
Fatal
(
PADDLE_THROW
(
platform
::
errors
::
Fatal
(
"You are running the TRT Dynamic Shape mode, need to confirm that "
"You are running the TRT Dynamic Shape mode, need to confirm that "
...
...
paddle/fluid/inference/tensorrt/convert/skip_layernorm.cc
浏览文件 @
d9187869
...
@@ -90,7 +90,7 @@ class SkipLayerNormOpConverter : public OpConverter {
...
@@ -90,7 +90,7 @@ class SkipLayerNormOpConverter : public OpConverter {
plugin
::
SkipLayerNormPluginDynamic
*
plugin
=
plugin
::
SkipLayerNormPluginDynamic
*
plugin
=
new
plugin
::
SkipLayerNormPluginDynamic
(
bias
,
scale
,
bias_size
,
new
plugin
::
SkipLayerNormPluginDynamic
(
bias
,
scale
,
bias_size
,
scale_size
,
eps
,
with_fp16
);
scale_size
,
eps
,
with_fp16
);
layer
=
engine_
->
Add
PluginV2
(
inputs
.
data
(),
2
,
plugin
);
layer
=
engine_
->
Add
DynamicPlugin
(
inputs
.
data
(),
2
,
plugin
);
}
}
}
else
{
}
else
{
PADDLE_THROW
(
platform
::
errors
::
Fatal
(
PADDLE_THROW
(
platform
::
errors
::
Fatal
(
...
...
paddle/fluid/inference/tensorrt/convert/slice_op.cc
浏览文件 @
d9187869
...
@@ -90,14 +90,14 @@ class SliceOpConverter : public OpConverter {
...
@@ -90,14 +90,14 @@ class SliceOpConverter : public OpConverter {
// bool ban_fp16 = engine_->disable_trt_plugin_fp16();
// bool ban_fp16 = engine_->disable_trt_plugin_fp16();
plugin
::
SpecialSlicePluginDynamic
*
plugin
=
plugin
::
SpecialSlicePluginDynamic
*
plugin
=
new
plugin
::
SpecialSlicePluginDynamic
();
new
plugin
::
SpecialSlicePluginDynamic
();
layer
=
engine_
->
Add
PluginV2
(
plugin_inputs
.
data
(),
plugin_inputs
.
size
(),
layer
=
engine_
->
Add
DynamicPlugin
(
plugin_inputs
.
data
(),
plugin
);
plugin_inputs
.
size
(),
plugin
);
}
else
{
}
else
{
bool
with_fp16
=
bool
with_fp16
=
engine_
->
WithFp16
()
&&
!
engine_
->
disable_trt_plugin_fp16
();
engine_
->
WithFp16
()
&&
!
engine_
->
disable_trt_plugin_fp16
();
plugin
::
SlicePluginDynamic
*
plugin
=
plugin
::
SlicePluginDynamic
*
plugin
=
new
plugin
::
SlicePluginDynamic
(
starts
,
ends
,
axes
,
with_fp16
);
new
plugin
::
SlicePluginDynamic
(
starts
,
ends
,
axes
,
with_fp16
);
layer
=
engine_
->
Add
PluginV2
(
&
input
,
1
,
plugin
);
layer
=
engine_
->
Add
DynamicPlugin
(
&
input
,
1
,
plugin
);
}
}
#else
#else
PADDLE_THROW
(
platform
::
errors
::
Fatal
(
PADDLE_THROW
(
platform
::
errors
::
Fatal
(
...
...
paddle/fluid/inference/tensorrt/convert/split_op.cc
浏览文件 @
d9187869
...
@@ -90,7 +90,7 @@ class SplitOpConverter : public OpConverter {
...
@@ -90,7 +90,7 @@ class SplitOpConverter : public OpConverter {
engine_
->
WithFp16
()
&&
!
engine_
->
disable_trt_plugin_fp16
();
engine_
->
WithFp16
()
&&
!
engine_
->
disable_trt_plugin_fp16
();
plugin
::
SplitPluginDynamic
*
plugin
=
plugin
::
SplitPluginDynamic
*
plugin
=
new
plugin
::
SplitPluginDynamic
(
axis
,
output_lengths
,
with_fp16
);
new
plugin
::
SplitPluginDynamic
(
axis
,
output_lengths
,
with_fp16
);
layer
=
engine_
->
Add
PluginV2
(
&
input
,
input_num
,
plugin
);
layer
=
engine_
->
Add
DynamicPlugin
(
&
input
,
input_num
,
plugin
);
#else
#else
PADDLE_THROW
(
platform
::
errors
::
Fatal
(
PADDLE_THROW
(
platform
::
errors
::
Fatal
(
"You are running the TRT Dynamic Shape mode, need to confirm that "
"You are running the TRT Dynamic Shape mode, need to confirm that "
...
...
paddle/fluid/inference/tensorrt/convert/stack_op.cc
浏览文件 @
d9187869
...
@@ -59,7 +59,7 @@ class StackOpConverter : public OpConverter {
...
@@ -59,7 +59,7 @@ class StackOpConverter : public OpConverter {
engine_
->
WithFp16
()
&&
!
engine_
->
disable_trt_plugin_fp16
();
engine_
->
WithFp16
()
&&
!
engine_
->
disable_trt_plugin_fp16
();
plugin
::
StackPluginDynamic
*
plugin
=
plugin
::
StackPluginDynamic
*
plugin
=
new
plugin
::
StackPluginDynamic
(
axis
,
input_num
,
with_fp16
);
new
plugin
::
StackPluginDynamic
(
axis
,
input_num
,
with_fp16
);
layer
=
engine_
->
Add
PluginV2
(
inputs
,
input_num
,
plugin
);
layer
=
engine_
->
Add
DynamicPlugin
(
inputs
,
input_num
,
plugin
);
assert
(
layer
!=
nullptr
);
assert
(
layer
!=
nullptr
);
#else
#else
PADDLE_THROW
(
platform
::
errors
::
Fatal
(
PADDLE_THROW
(
platform
::
errors
::
Fatal
(
...
...
paddle/fluid/inference/tensorrt/convert/swish_op.cc
浏览文件 @
d9187869
...
@@ -65,7 +65,7 @@ class SwishOpConverter : public OpConverter {
...
@@ -65,7 +65,7 @@ class SwishOpConverter : public OpConverter {
engine_
->
WithFp16
()
&&
!
engine_
->
disable_trt_plugin_fp16
();
engine_
->
WithFp16
()
&&
!
engine_
->
disable_trt_plugin_fp16
();
plugin
::
SwishPluginDynamic
*
plugin
=
plugin
::
SwishPluginDynamic
*
plugin
=
new
plugin
::
SwishPluginDynamic
(
beta
,
with_fp16
);
new
plugin
::
SwishPluginDynamic
(
beta
,
with_fp16
);
layer
=
engine_
->
Add
PluginV2
(
&
input
,
input_num
,
plugin
);
layer
=
engine_
->
Add
DynamicPlugin
(
&
input
,
input_num
,
plugin
);
#else
#else
PADDLE_THROW
(
platform
::
errors
::
Fatal
(
PADDLE_THROW
(
platform
::
errors
::
Fatal
(
"You are running the TRT Dynamic Shape mode, need to confirm that "
"You are running the TRT Dynamic Shape mode, need to confirm that "
...
...
paddle/fluid/inference/tensorrt/engine.h
浏览文件 @
d9187869
...
@@ -378,9 +378,9 @@ class TensorRTEngine {
...
@@ -378,9 +378,9 @@ class TensorRTEngine {
bool
with_dynamic_shape
()
{
return
with_dynamic_shape_
;
}
bool
with_dynamic_shape
()
{
return
with_dynamic_shape_
;
}
#if IS_TRT_VERSION_GE(6000)
#if IS_TRT_VERSION_GE(6000)
nvinfer1
::
IPluginV2Layer
*
Add
PluginV2
(
nvinfer1
::
ITensor
*
const
*
inputs
,
nvinfer1
::
IPluginV2Layer
*
Add
DynamicPlugin
(
int
num_inputs
,
nvinfer1
::
ITensor
*
const
*
inputs
,
int
num_inputs
,
plugin
::
DynamicPluginTensorRT
*
plugin
)
{
plugin
::
DynamicPluginTensorRT
*
plugin
)
{
owned_pluginv2_
.
emplace_back
(
plugin
);
owned_pluginv2_
.
emplace_back
(
plugin
);
return
network
()
->
addPluginV2
(
inputs
,
num_inputs
,
*
plugin
);
return
network
()
->
addPluginV2
(
inputs
,
num_inputs
,
*
plugin
);
}
}
...
...
paddle/fluid/inference/tensorrt/plugin/roi_align_op_plugin.cu
浏览文件 @
d9187869
...
@@ -364,6 +364,7 @@ RoiAlignPluginDynamicCreator::getFieldNames() {
...
@@ -364,6 +364,7 @@ RoiAlignPluginDynamicCreator::getFieldNames() {
nvinfer1
::
IPluginV2Ext
*
RoiAlignPluginDynamicCreator
::
createPlugin
(
nvinfer1
::
IPluginV2Ext
*
RoiAlignPluginDynamicCreator
::
createPlugin
(
const
char
*
name
,
const
nvinfer1
::
PluginFieldCollection
*
fc
)
{
const
char
*
name
,
const
nvinfer1
::
PluginFieldCollection
*
fc
)
{
const
nvinfer1
::
PluginField
*
fields
=
fc
->
fields
;
const
nvinfer1
::
PluginField
*
fields
=
fc
->
fields
;
return
nullptr
;
}
}
nvinfer1
::
IPluginV2Ext
*
RoiAlignPluginDynamicCreator
::
deserializePlugin
(
nvinfer1
::
IPluginV2Ext
*
RoiAlignPluginDynamicCreator
::
deserializePlugin
(
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录