From 03bdd1cf62d9d490a84da913b4f91fbe631fc560 Mon Sep 17 00:00:00 2001 From: Ryan Hill Date: Mon, 19 Apr 2021 14:26:38 -0700 Subject: [PATCH] Another build test --- .../contrib_ops/cpu/bert/embed_layer_norm.cc | 2 -- .../cpu/bert/embed_layer_norm_helper.cc | 15 ++++++++++++++- .../cpu/bert/longformer_attention_base.cc | 7 ------- onnxruntime/core/framework/provider_bridge_ort.cc | 13 ++++++------- 4 files changed, 20 insertions(+), 17 deletions(-) diff --git a/onnxruntime/contrib_ops/cpu/bert/embed_layer_norm.cc b/onnxruntime/contrib_ops/cpu/bert/embed_layer_norm.cc index 4eabb957ee..5bc974711d 100644 --- a/onnxruntime/contrib_ops/cpu/bert/embed_layer_norm.cc +++ b/onnxruntime/contrib_ops/cpu/bert/embed_layer_norm.cc @@ -11,8 +11,6 @@ namespace onnxruntime { namespace contrib { -void Link_embed_layer_norm() {} - // These ops are internal-only, so register outside of onnx #define REGISTER_KERNEL_TYPED(T) \ ONNX_OPERATOR_TYPED_KERNEL_EX( \ diff --git a/onnxruntime/contrib_ops/cpu/bert/embed_layer_norm_helper.cc b/onnxruntime/contrib_ops/cpu/bert/embed_layer_norm_helper.cc index aa90bdfe4c..e991502745 100644 --- a/onnxruntime/contrib_ops/cpu/bert/embed_layer_norm_helper.cc +++ b/onnxruntime/contrib_ops/cpu/bert/embed_layer_norm_helper.cc @@ -5,9 +5,22 @@ #include "core/framework/tensorprotoutils.h" #include "onnx/defs/tensor_proto_util.h" +#include "longformer_attention_base.h" + namespace onnxruntime { namespace contrib { -void Link_embed_layer_norm_helper() {} + +Status LongformerAttentionBase__CheckInputs(const LongformerAttentionBase* p, + const TensorShape& input_shape, + const TensorShape& weights_shape, + const TensorShape& bias_shape, + const TensorShape& mask_shape, + const TensorShape& global_weights_shape, + const TensorShape& global_bias_shape, + const TensorShape& global_shape) { + return p->CheckInputs(input_shape, weights_shape, bias_shape, mask_shape, global_weights_shape, global_bias_shape, global_shape); +} + namespace embed_layer_norm { Status CheckInputs(const OpKernelContext* context) { diff --git a/onnxruntime/contrib_ops/cpu/bert/longformer_attention_base.cc b/onnxruntime/contrib_ops/cpu/bert/longformer_attention_base.cc index 18e1486955..6a6685ac3f 100644 --- a/onnxruntime/contrib_ops/cpu/bert/longformer_attention_base.cc +++ b/onnxruntime/contrib_ops/cpu/bert/longformer_attention_base.cc @@ -1,13 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -namespace onnxruntime { -namespace contrib { - -void Link_longformer_attention_base() {} -} // namespace contrib -} // namespace onnxruntime - #include "longformer_attention_base.h" namespace onnxruntime { diff --git a/onnxruntime/core/framework/provider_bridge_ort.cc b/onnxruntime/core/framework/provider_bridge_ort.cc index 04c323c502..412b0fb882 100644 --- a/onnxruntime/core/framework/provider_bridge_ort.cc +++ b/onnxruntime/core/framework/provider_bridge_ort.cc @@ -45,6 +45,11 @@ #include "contrib_ops/cpu/bert/bias_gelu_helper.h" #include "contrib_ops/cpu/bert/embed_layer_norm_helper.h" #include "contrib_ops/cpu/bert/longformer_attention_base.h" +namespace onnxruntime { +namespace contrib { +Status LongformerAttentionBase__CheckInputs(const LongformerAttentionBase* p, const TensorShape& input_shape, const TensorShape& weights_shape, const TensorShape& bias_shape, const TensorShape& mask_shape, const TensorShape& global_weights_shape, const TensorShape& global_bias_shape, const TensorShape& global_shape); +} +} // namespace onnxruntime #include "contrib_ops/cpu/bert/attention_base.h" #endif @@ -98,8 +103,6 @@ using IndexedSubGraph_MetaDef = IndexedSubGraph::MetaDef; namespace onnxruntime { namespace contrib { -void Link_embed_layer_norm(); -void Link_longformer_attention_base(); void Link_embed_layer_norm_helper(); } // namespace contrib @@ -832,11 +835,7 @@ struct ProviderHostImpl : ProviderHost { Status embed_layer_norm__CheckInputs(const OpKernelContext* context) override { return contrib::embed_layer_norm::CheckInputs(context); } Status bias_gelu_helper__CheckInputs(const OpKernelContext* context) override { return contrib::bias_gelu_helper::CheckInputs(context); } Status LongformerAttentionBase__CheckInputs(const contrib::LongformerAttentionBase* p, const TensorShape& input_shape, const TensorShape& weights_shape, const TensorShape& bias_shape, const TensorShape& mask_shape, const TensorShape& global_weights_shape, const TensorShape& global_bias_shape, const TensorShape& global_shape) override { - contrib::Link_embed_layer_norm(); - contrib::Link_longformer_attention_base(); - contrib::Link_embed_layer_norm_helper(); - - return p->CheckInputs(input_shape, weights_shape, bias_shape, mask_shape, global_weights_shape, global_bias_shape, global_shape); + return contrib::LongformerAttentionBase__CheckInputs(p, input_shape, weights_shape, bias_shape, mask_shape, global_weights_shape, global_bias_shape, global_shape); } Status AttentionBase__CheckInputs(const contrib::AttentionBase* p, const TensorShape& input_shape, const TensorShape& weights_shape, const TensorShape& bias_shape, const Tensor*& mask_index, const Tensor* past, const int max_threads_per_block) override { return p->CheckInputs(input_shape, weights_shape, bias_shape, mask_index, past, max_threads_per_block); } Tensor* AttentionBase__GetPresent(const contrib::AttentionBase* p, OpKernelContext* context, const Tensor* past, int batch_size, int head_size, int sequence_length, int& past_sequence_length) override { return p->GetPresent(context, past, batch_size, head_size, sequence_length, past_sequence_length); }