未验证 提交 ba411960 编写于 作者: Z zlsh80826 提交者: GitHub

plugin terminate should be called by TensorRT (#38374)

上级 26b845e2
...@@ -32,9 +32,7 @@ namespace plugin { ...@@ -32,9 +32,7 @@ namespace plugin {
template <typename T> template <typename T>
EmbEltwiseLayernormPluginDynamicImpl< EmbEltwiseLayernormPluginDynamicImpl<
T>::~EmbEltwiseLayernormPluginDynamicImpl() { T>::~EmbEltwiseLayernormPluginDynamicImpl() {}
this->terminate();
}
inline half fp32tofp16(float x) { return static_cast<half>(x); } inline half fp32tofp16(float x) { return static_cast<half>(x); }
......
...@@ -192,10 +192,7 @@ bool QkvToContextPluginDynamic::supportsFormatCombination( ...@@ -192,10 +192,7 @@ bool QkvToContextPluginDynamic::supportsFormatCombination(
if (pos == 0) { if (pos == 0) {
if (with_fp16_) { if (with_fp16_) {
#ifdef TRT_PLUGIN_FP16_AVALIABLE #ifdef TRT_PLUGIN_FP16_AVALIABLE
return ( return (in.type == nvinfer1::DataType::kFLOAT ||
#if IS_TRT_VERSION_LT(8000)
in.type == nvinfer1::DataType::kFLOAT ||
#endif
in.type == nvinfer1::DataType::kHALF) && in.type == nvinfer1::DataType::kHALF) &&
(in.format == nvinfer1::TensorFormat::kLINEAR); (in.format == nvinfer1::TensorFormat::kLINEAR);
#else #else
......
...@@ -73,10 +73,7 @@ bool SkipLayerNormPluginDynamic::supportsFormatCombination( ...@@ -73,10 +73,7 @@ bool SkipLayerNormPluginDynamic::supportsFormatCombination(
if (pos == 0) { if (pos == 0) {
if (with_fp16_) { if (with_fp16_) {
#ifdef TRT_PLUGIN_FP16_AVALIABLE #ifdef TRT_PLUGIN_FP16_AVALIABLE
return ( return (in.type == nvinfer1::DataType::kFLOAT ||
#if IS_TRT_VERSION_LT(8000)
in.type == nvinfer1::DataType::kFLOAT ||
#endif
in.type == nvinfer1::DataType::kHALF) && in.type == nvinfer1::DataType::kHALF) &&
(in.format == nvinfer1::TensorFormat::kLINEAR); (in.format == nvinfer1::TensorFormat::kLINEAR);
#else #else
......
...@@ -83,10 +83,7 @@ SlicePlugin *SlicePlugin::clone() const TRT_NOEXCEPT { ...@@ -83,10 +83,7 @@ SlicePlugin *SlicePlugin::clone() const TRT_NOEXCEPT {
bool SlicePlugin::supportsFormat( bool SlicePlugin::supportsFormat(
nvinfer1::DataType type, nvinfer1::PluginFormat format) const TRT_NOEXCEPT { nvinfer1::DataType type, nvinfer1::PluginFormat format) const TRT_NOEXCEPT {
if (with_fp16_) { if (with_fp16_) {
return (( return ((type == nvinfer1::DataType::kFLOAT ||
#if IS_TRT_VERSION_LT(8000)
type == nvinfer1::DataType::kFLOAT ||
#endif
type == nvinfer1::DataType::kHALF) && type == nvinfer1::DataType::kHALF) &&
(format == nvinfer1::PluginFormat::kLINEAR)); (format == nvinfer1::PluginFormat::kLINEAR));
} else { } else {
...@@ -287,10 +284,7 @@ bool SlicePluginDynamic::supportsFormatCombination( ...@@ -287,10 +284,7 @@ bool SlicePluginDynamic::supportsFormatCombination(
const nvinfer1::PluginTensorDesc &in = in_out[pos]; const nvinfer1::PluginTensorDesc &in = in_out[pos];
if (pos == 0) { if (pos == 0) {
if (with_fp16_) { if (with_fp16_) {
return ( return (in.type == nvinfer1::DataType::kFLOAT ||
#if IS_TRT_VERSION_LT(8000)
in.type == nvinfer1::DataType::kFLOAT ||
#endif
in.type == nvinfer1::DataType::kHALF) && in.type == nvinfer1::DataType::kHALF) &&
(in.format == nvinfer1::TensorFormat::kLINEAR); (in.format == nvinfer1::TensorFormat::kLINEAR);
} else { } else {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册