-
Notifications
You must be signed in to change notification settings - Fork 5.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pool3d 2.0 #36545
Pool3d 2.0 #36545
Conversation
Thanks for your contribution! |
nvinfer1::DimsCHW nv_paddings(paddings[0], paddings[1], paddings[2]); | ||
nvinfer1::ILayer *layer = nullptr; | ||
if (op_desc.HasAttr("enable_int8")) { | ||
#if IS_TRT_VERSION_GE(5000) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
不再trt5,可以不用判断。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
int8有测试过么
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
int8有测试过么
int8目前没有测
reduce_operation, 28, true); | ||
layer = reduce_layer; | ||
} else { | ||
#if IS_TRT_VERSION_GE(6000) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
同上,可以默认trt >= 6
"trt pool3d plugin layer in converter could not be created.")); | ||
layer = pool_layer; | ||
} | ||
} else { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
else if == average {
} else {
error(not support)
}
类似这样加个明确的判断吧,
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
else if == average { } else { error(not support) } 类似这样加个明确的判断吧,
好的
int index, const nvinfer1::Dims *inputDims, int nbInputs) TRT_NOEXCEPT { | ||
assert(nbInputs == 1); | ||
assert(index == 0); | ||
assert(inputDims[0].nbDims == 4); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
以上assert改成PADDLE_ENFORCE的形式
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
以上assert改成PADDLE_ENFORCE的形式
好的,已修改
} | ||
|
||
// Dynamic Plugin below. | ||
#if IS_TRT_VERSION_GE(6000) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
同上
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
同上
好的,已经去掉
return output_shape; | ||
} | ||
|
||
class Pool3DPlugin : public PluginTensorRT { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PluginTensorRT is deprecated
改成PluginTensorRTV2Ext吧
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PluginTensorRT is deprecated 改成PluginTensorRTV2Ext吧
好的,已修改
}; | ||
REGISTER_TRT_PLUGIN_V2(Pool3DPluginCreator); | ||
|
||
#if IS_TRT_VERSION_GE(6000) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
同上
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
同上
已删除
from paddle.fluid.core import AnalysisConfig | ||
|
||
|
||
class TensorRTPool3dTest(InferencePassTest): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
单测改成集成autoscantester的方式
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
单测改成集成autoscantester的方式
下个pr补充
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
PR types
Others
PR changes
OPs
Describe
In order to use TensorRT to accelerate the pool3d operator, I have added the Converter and Plugin corresponding to the operator, which supports fp32 and fp16.