Skip to content
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

Merged
merged 11 commits into from
Oct 26, 2021
Merged

Pool3d 2.0 #36545

merged 11 commits into from
Oct 26, 2021

Conversation

fengxiaoshuai
Copy link
Contributor

@fengxiaoshuai fengxiaoshuai commented Oct 19, 2021

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.

@paddle-bot-old
Copy link

Thanks for your contribution!
Please wait for the result of CI firstly. See Paddle CI Manual for details.

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)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

不再trt5,可以不用判断。

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

int8有测试过么

Copy link
Contributor Author

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)
Copy link
Member

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 {
Copy link
Member

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)
}
类似这样加个明确的判断吧,

Copy link
Contributor Author

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);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

以上assert改成PADDLE_ENFORCE的形式

Copy link
Contributor Author

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)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

同上

Copy link
Contributor Author

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 {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PluginTensorRT is deprecated
改成PluginTensorRTV2Ext吧

Copy link
Contributor Author

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)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

同上

Copy link
Contributor Author

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):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

单测改成集成autoscantester的方式

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

单测改成集成autoscantester的方式

下个pr补充

shangzhizhou
shangzhizhou previously approved these changes Oct 25, 2021
Copy link
Member

@shangzhizhou shangzhizhou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

shangzhizhou
shangzhizhou previously approved these changes Oct 25, 2021
Copy link
Member

@shangzhizhou shangzhizhou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@CLAassistant
Copy link

CLAassistant commented Oct 25, 2021

CLA assistant check
All committers have signed the CLA.

Copy link
Contributor

@Superjomn Superjomn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Superjomn Superjomn merged commit 229bae8 into PaddlePaddle:develop Oct 26, 2021
Superjomn pushed a commit that referenced this pull request Oct 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants