未验证 提交 48b3e869 编写于 作者: H HongyuJia 提交者: GitHub

[Decouple phi] Decouple custom_op in fluid and phi (#49866)

* decouple phi custom_op

* decouple phi custom_op, remove codes

* delete custom symbol of inference
上级 a48ef360
...@@ -39,9 +39,6 @@ ...@@ -39,9 +39,6 @@
*paddle::GPUContextResource*; *paddle::GPUContextResource*;
*paddle::CPUContextResource*; *paddle::CPUContextResource*;
*paddle::LoadCustomOperatorLib*;
*paddle::RegisterAllCustomOperator*;
/* ut needs the following symbol, we need to modify all the ut to hidden such symbols */ /* ut needs the following symbol, we need to modify all the ut to hidden such symbols */
/* Another question: the ut size will grow from 50M to 80M, why? */ /* Another question: the ut size will grow from 50M to 80M, why? */
......
...@@ -39,9 +39,6 @@ ...@@ -39,9 +39,6 @@
*paddle::GPUContextResource*; *paddle::GPUContextResource*;
*paddle::CPUContextResource*; *paddle::CPUContextResource*;
*paddle::LoadCustomOperatorLib*;
*paddle::RegisterAllCustomOperator*;
/* ut needs the following symbol, we need to modify all the ut to hidden such symbols */ /* ut needs the following symbol, we need to modify all the ut to hidden such symbols */
/* Another question: the ut size will grow from 50M to 80M, why? */ /* Another question: the ut size will grow from 50M to 80M, why? */
......
...@@ -619,16 +619,6 @@ class PADDLE_API OpMetaInfoBuilder { ...@@ -619,16 +619,6 @@ class PADDLE_API OpMetaInfoBuilder {
size_t index_; size_t index_;
}; };
/////////////////////// Op register API /////////////////////////
// For inference: compile directly with framework
// Call after PD_BUILD_OP(...)
void RegisterAllCustomOperator();
// Using this api to load compiled custom operator's dynamic library and
// register Custom Operator into it
void LoadCustomOperatorLib(const std::string& dso_name);
/////////////////////// Op register Macro ///////////////////////// /////////////////////// Op register Macro /////////////////////////
#define PD_BUILD_OP(op_name) \ #define PD_BUILD_OP(op_name) \
......
...@@ -19,7 +19,6 @@ limitations under the License. */ ...@@ -19,7 +19,6 @@ limitations under the License. */
#include <vector> #include <vector>
#include "glog/logging.h" #include "glog/logging.h"
#include "paddle/fluid/framework/custom_operator.h"
#include "paddle/phi/core/dense_tensor.h" #include "paddle/phi/core/dense_tensor.h"
#include "paddle/phi/core/enforce.h" #include "paddle/phi/core/enforce.h"
...@@ -244,17 +243,6 @@ OpMetaInfoBuilder& OpMetaInfoBuilder::SetInferDtypeFn(InferDtypeFunc func) { ...@@ -244,17 +243,6 @@ OpMetaInfoBuilder& OpMetaInfoBuilder::SetInferDtypeFn(InferDtypeFunc func) {
info_ptr_->SetInferDtypeFn(std::forward<InferDtypeFunc>(func)); info_ptr_->SetInferDtypeFn(std::forward<InferDtypeFunc>(func));
return *this; return *this;
} }
/////////////////////// Op register API /////////////////////////
void RegisterAllCustomOperator() {
auto& op_meta_info_map = OpMetaInfoMap::Instance();
framework::RegisterOperatorWithMetaInfoMap(op_meta_info_map);
}
void LoadCustomOperatorLib(const std::string& dso_name) {
paddle::framework::LoadOpMetaInfoAndRegisterOp(dso_name);
}
} // namespace paddle } // namespace paddle
#ifdef __cplusplus #ifdef __cplusplus
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册