未验证 提交 c32a3002 编写于 作者: W winter-wang 提交者: GitHub

[IR] refine the ir folder in fluid. (#54292)

上级 b8352611
...@@ -96,4 +96,4 @@ paddle/phi/api/profiler/__init__.py ...@@ -96,4 +96,4 @@ paddle/phi/api/profiler/__init__.py
python/paddle/incubate/fleet/parameter_server/pslib/ps_pb2.py python/paddle/incubate/fleet/parameter_server/pslib/ps_pb2.py
paddle/phi/kernels/fusion/cutlass/conv2d/generated/* paddle/phi/kernels/fusion/cutlass/conv2d/generated/*
python/paddle/fluid/incubate/fleet/parameter_server/pslib/ps_pb2.py python/paddle/fluid/incubate/fleet/parameter_server/pslib/ps_pb2.py
paddle/fluid/translator/op_compat_info.cc paddle/fluid/ir_adaptor/translator/op_compat_info.cc
...@@ -9,8 +9,8 @@ add_subdirectory(eager) ...@@ -9,8 +9,8 @@ add_subdirectory(eager)
add_subdirectory(prim) add_subdirectory(prim)
add_subdirectory(jit) add_subdirectory(jit)
if(WITH_NEWIR) if(WITH_NEWIR)
add_subdirectory(dialect) add_subdirectory(ir)
add_subdirectory(translator) add_subdirectory(ir_adaptor)
endif() endif()
# NOTE: please add subdirectory inference at last. # NOTE: please add subdirectory inference at last.
add_subdirectory(inference) add_subdirectory(inference)
add_subdirectory(interface)
add_subdirectory(dialect)
set(PD_DIALECT_SOURCE_DIR "${PADDLE_SOURCE_DIR}/paddle/fluid/dialect") set(PD_DIALECT_SOURCE_DIR "${PADDLE_SOURCE_DIR}/paddle/fluid/ir/dialect")
set(PD_DIALECT_BINARY_DIR "${PADDLE_BINARY_DIR}/paddle/fluid/dialect") set(PD_DIALECT_BINARY_DIR "${PADDLE_BINARY_DIR}/paddle/fluid/ir/dialect")
# Generate pd_dialect files defining op using op_gen_file # Generate pd_dialect files defining op using op_gen_file
set(op_gen_file ${PADDLE_SOURCE_DIR}/paddle/fluid/dialect/op_gen.py) set(op_gen_file ${PADDLE_SOURCE_DIR}/paddle/fluid/ir/dialect/op_gen.py)
set(op_compat_yaml_file ${PADDLE_SOURCE_DIR}/paddle/phi/api/yaml/op_compat.yaml) set(op_compat_yaml_file ${PADDLE_SOURCE_DIR}/paddle/phi/api/yaml/op_compat.yaml)
set(op_forward_yaml_file1 set(op_forward_yaml_file1
${PADDLE_SOURCE_DIR}/paddle/fluid/operators/generator/parsed_ops/ops.parsed.yaml ${PADDLE_SOURCE_DIR}/paddle/fluid/operators/generator/parsed_ops/ops.parsed.yaml
...@@ -16,7 +16,7 @@ set(op_backward_yaml_file1 ...@@ -16,7 +16,7 @@ set(op_backward_yaml_file1
set(op_backward_yaml_file2 set(op_backward_yaml_file2
${PADDLE_SOURCE_DIR}/paddle/fluid/operators/generator/parsed_ops/legacy_backward_ops.parsed.yaml ${PADDLE_SOURCE_DIR}/paddle/fluid/operators/generator/parsed_ops/legacy_backward_ops.parsed.yaml
) )
set(op_yaml_file3 ${PADDLE_SOURCE_DIR}/paddle/fluid/dialect/pd_op.yaml) set(op_yaml_file3 ${PADDLE_SOURCE_DIR}/paddle/fluid/ir/dialect/pd_op.yaml)
set(op_yaml_files set(op_yaml_files
${op_forward_yaml_file1},${op_forward_yaml_file2},${op_backward_yaml_file1},${op_backward_yaml_file2},${op_yaml_file3} ${op_forward_yaml_file1},${op_forward_yaml_file2},${op_backward_yaml_file1},${op_backward_yaml_file2},${op_yaml_file3}
) )
......
...@@ -34,10 +34,10 @@ H_FILE_TEMPLATE = """#ifdef GET_OP_LIST ...@@ -34,10 +34,10 @@ H_FILE_TEMPLATE = """#ifdef GET_OP_LIST
#include "paddle/ir/core/builder.h" #include "paddle/ir/core/builder.h"
#include "paddle/ir/core/operation_utils.h" #include "paddle/ir/core/operation_utils.h"
#include "paddle/ir/core/op_base.h" #include "paddle/ir/core/op_base.h"
#include "paddle/fluid/dialect/utils.h" #include "paddle/fluid/ir/dialect/utils.h"
#include "paddle/fluid/dialect/pd_interface.h" #include "paddle/fluid/ir/dialect/pd_interface.h"
#include "paddle/fluid/interface/infershape.h" #include "paddle/fluid/ir/interface/infershape.h"
#include "paddle/fluid/framework/infershape_utils.h" #include "paddle/fluid/framework/infershape_utils.h"
#include "paddle/phi/core/infermeta_utils.h" #include "paddle/phi/core/infermeta_utils.h"
...@@ -78,8 +78,8 @@ OP_GET_OUTPUT_TEMPLATE = """ ir::OpResult {output_name}() {{ return operation() ...@@ -78,8 +78,8 @@ OP_GET_OUTPUT_TEMPLATE = """ ir::OpResult {output_name}() {{ return operation()
# String Template for cc file code gen # String Template for cc file code gen
# ===================================== # =====================================
CC_FILE_TEMPLATE = """#include "{h_file}" CC_FILE_TEMPLATE = """#include "{h_file}"
#include "paddle/fluid/dialect/pd_type.h" #include "paddle/fluid/ir/dialect/pd_type.h"
#include "paddle/fluid/dialect/pd_attribute.h" #include "paddle/fluid/ir/dialect/pd_attribute.h"
#include "paddle/ir/core/builtin_attribute.h" #include "paddle/ir/core/builtin_attribute.h"
#include "paddle/ir/core/builtin_type.h" #include "paddle/ir/core/builtin_type.h"
#include "paddle/ir/core/ir_context.h" #include "paddle/ir/core/ir_context.h"
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
#include "paddle/fluid/dialect/pd_attribute.h" #include "paddle/fluid/ir/dialect/pd_attribute.h"
namespace paddle { namespace paddle {
namespace dialect { namespace dialect {
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
#pragma once #pragma once
#include "paddle/fluid/dialect/pd_attribute_storage.h" #include "paddle/fluid/ir/dialect/pd_attribute_storage.h"
#include "paddle/ir/core/attribute.h" #include "paddle/ir/core/attribute.h"
namespace paddle { namespace paddle {
......
...@@ -12,16 +12,16 @@ ...@@ -12,16 +12,16 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
#include "paddle/fluid/dialect/pd_dialect.h" #include "paddle/fluid/ir/dialect/pd_dialect.h"
#include "paddle/fluid/dialect/pd_attribute.h" #include "paddle/fluid/ir/dialect/pd_attribute.h"
// NOTE(zhangbo9674): File pd_op.h is generated by op_gen.py, see details in // NOTE(zhangbo9674): File pd_op.h is generated by op_gen.py, see details in
// paddle/fluid/dialect/CMakeLists.txt. // paddle/fluid/ir/dialect/CMakeLists.txt.
#include "paddle/fluid/dialect/pd_op.h"
#include "paddle/fluid/dialect/pd_type.h"
#include "paddle/fluid/dialect/pd_type_storage.h"
#include "paddle/fluid/dialect/utils.h"
#include "paddle/fluid/framework/convert_utils.h" #include "paddle/fluid/framework/convert_utils.h"
#include "paddle/fluid/framework/data_type.h" #include "paddle/fluid/framework/data_type.h"
#include "paddle/fluid/ir/dialect/pd_op.h"
#include "paddle/fluid/ir/dialect/pd_type.h"
#include "paddle/fluid/ir/dialect/pd_type_storage.h"
#include "paddle/fluid/ir/dialect/utils.h"
#include "paddle/ir/core/dialect_interface.h" #include "paddle/ir/core/dialect_interface.h"
#include "paddle/phi/core/dense_tensor.h" #include "paddle/phi/core/dense_tensor.h"
...@@ -99,10 +99,10 @@ void PaddleDialect::initialize() { ...@@ -99,10 +99,10 @@ void PaddleDialect::initialize() {
// NOTE(zhangbo9674): GET_OP_LIST is defined in pd_op.h which is // NOTE(zhangbo9674): GET_OP_LIST is defined in pd_op.h which is
// generated by op_gen.py, see details in // generated by op_gen.py, see details in
// paddle/fluid/dialect/CMakeLists.txt. // paddle/fluid/ir/dialect/CMakeLists.txt.
RegisterOps< RegisterOps<
#define GET_OP_LIST #define GET_OP_LIST
#include "paddle/fluid/dialect/pd_op.h" // NOLINT #include "paddle/fluid/ir/dialect/pd_op.h" // NOLINT
>(); >();
RegisterInterfaces<ParameterConvertInterface>(); RegisterInterfaces<ParameterConvertInterface>();
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
#pragma once #pragma once
#include "paddle/fluid/dialect/utils.h" #include "paddle/fluid/ir/dialect/utils.h"
#include "paddle/ir/core/op_base.h" #include "paddle/ir/core/op_base.h"
using OpInfoTuple = std::tuple<std::vector<paddle::dialect::OpInputInfo>, using OpInfoTuple = std::tuple<std::vector<paddle::dialect::OpInputInfo>,
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
#include "paddle/fluid/dialect/pd_type.h" #include "paddle/fluid/ir/dialect/pd_type.h"
namespace paddle { namespace paddle {
namespace dialect { namespace dialect {
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
#pragma once #pragma once
#include "paddle/fluid/dialect/pd_type_storage.h" #include "paddle/fluid/ir/dialect/pd_type_storage.h"
#include "paddle/ir/core/type.h" #include "paddle/ir/core/type.h"
namespace paddle { namespace paddle {
......
...@@ -14,9 +14,9 @@ ...@@ -14,9 +14,9 @@
#pragma once #pragma once
#include "paddle/fluid/dialect/pd_type_storage.h"
#include "paddle/fluid/framework/convert_utils.h" #include "paddle/fluid/framework/convert_utils.h"
#include "paddle/fluid/framework/data_type.h" #include "paddle/fluid/framework/data_type.h"
#include "paddle/fluid/ir/dialect/pd_type_storage.h"
#include "paddle/ir/core/builtin_type.h" #include "paddle/ir/core/builtin_type.h"
#include "paddle/phi/core/dense_tensor.h" #include "paddle/phi/core/dense_tensor.h"
......
set(PD_PROGRAM_TRANSLATOR_SOURCE_DIR "${CMAKE_CURRENT_LIST_DIR}") set(PD_PROGRAM_TRANSLATOR_SOURCE_DIR "${CMAKE_CURRENT_LIST_DIR}")
set(PD_PROGRAM_TRANSLATOR_BINARY_DIR set(PD_PROGRAM_TRANSLATOR_BINARY_DIR
"${PADDLE_BINARY_DIR}/paddle/fluid/translator") "${PADDLE_BINARY_DIR}/paddle/fluid/ir_adaptor/translator/")
set(op_gen_file ${PD_PROGRAM_TRANSLATOR_SOURCE_DIR}/op_compat_gen.py) set(op_gen_file ${PD_PROGRAM_TRANSLATOR_SOURCE_DIR}/op_compat_gen.py)
set(op_compat_yaml_file ${PADDLE_SOURCE_DIR}/paddle/phi/api/yaml/op_compat.yaml) set(op_compat_yaml_file ${PADDLE_SOURCE_DIR}/paddle/phi/api/yaml/op_compat.yaml)
......
...@@ -12,12 +12,12 @@ ...@@ -12,12 +12,12 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
#include "paddle/fluid/translator/attribute_translator.h" #include "paddle/fluid/ir_adaptor/translator/attribute_translator.h"
#include <string> #include <string>
#include <vector> #include <vector>
#include "paddle/fluid/dialect/pd_attribute.h" #include "paddle/fluid/ir/dialect/pd_attribute.h"
#include "paddle/phi/common/data_type.h" #include "paddle/phi/common/data_type.h"
#include "paddle/phi/common/int_array.h" #include "paddle/phi/common/int_array.h"
#include "paddle/phi/common/layout.h" #include "paddle/phi/common/layout.h"
......
#include "paddle/fluid/translator/op_compat_info.h" #include "paddle/fluid/ir_adaptor/translator/op_compat_info.h"
namespace paddle { namespace paddle {
namespace translator { namespace translator {
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
#include "glog/logging.h" #include "glog/logging.h"
#include "paddle/fluid/translator/utils.h" #include "paddle/fluid/ir_adaptor/translator/utils.h"
#pragma once #pragma once
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
#include "paddle/fluid/translator/op_translator.h" #include "paddle/fluid/ir_adaptor/translator/op_translator.h"
#include <algorithm> #include <algorithm>
#include <cctype> #include <cctype>
...@@ -22,12 +22,12 @@ ...@@ -22,12 +22,12 @@
#include <unordered_map> #include <unordered_map>
#include <vector> #include <vector>
#include "paddle/fluid/dialect/pd_interface.h"
#include "paddle/fluid/framework/op_desc.h" #include "paddle/fluid/framework/op_desc.h"
#include "paddle/fluid/translator/attribute_translator.h" #include "paddle/fluid/ir/dialect/pd_interface.h"
#include "paddle/fluid/translator/op_compat_info.h" #include "paddle/fluid/ir_adaptor/translator/attribute_translator.h"
#include "paddle/fluid/translator/program_translator.h" #include "paddle/fluid/ir_adaptor/translator/op_compat_info.h"
#include "paddle/fluid/translator/type_translator.h" #include "paddle/fluid/ir_adaptor/translator/program_translator.h"
#include "paddle/fluid/ir_adaptor/translator/type_translator.h"
#include "paddle/ir/core/builtin_op.h" #include "paddle/ir/core/builtin_op.h"
#include "paddle/ir/core/builtin_type.h" #include "paddle/ir/core/builtin_type.h"
#include "paddle/ir/core/ir_context.h" #include "paddle/ir/core/ir_context.h"
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
#include "paddle/fluid/framework/block_desc.h" #include "paddle/fluid/framework/block_desc.h"
#include "paddle/fluid/framework/op_desc.h" #include "paddle/fluid/framework/op_desc.h"
#include "paddle/fluid/framework/var_desc.h" #include "paddle/fluid/framework/var_desc.h"
#include "paddle/fluid/translator/program_translator.h" #include "paddle/fluid/ir_adaptor/translator/program_translator.h"
#include "paddle/ir/core/ir_context.h" #include "paddle/ir/core/ir_context.h"
#include "paddle/ir/core/operation.h" #include "paddle/ir/core/operation.h"
#include "paddle/ir/core/program.h" #include "paddle/ir/core/program.h"
......
...@@ -12,15 +12,15 @@ ...@@ -12,15 +12,15 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
#include "paddle/fluid/translator/program_translator.h" #include "paddle/fluid/ir_adaptor/translator/program_translator.h"
#include <unordered_map> #include <unordered_map>
#include "glog/logging.h" #include "glog/logging.h"
#include "paddle/fluid/framework/program_desc.h" #include "paddle/fluid/framework/program_desc.h"
#include "paddle/fluid/translator/op_translator.h" #include "paddle/fluid/ir_adaptor/translator/op_translator.h"
#include "paddle/fluid/translator/type_translator.h" #include "paddle/fluid/ir_adaptor/translator/type_translator.h"
#include "paddle/ir/core/attribute.h" #include "paddle/ir/core/attribute.h"
#include "paddle/ir/core/block.h" #include "paddle/ir/core/block.h"
#include "paddle/ir/core/builtin_op.h" #include "paddle/ir/core/builtin_op.h"
......
...@@ -12,13 +12,13 @@ ...@@ -12,13 +12,13 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
#include "paddle/fluid/translator/translate.h" #include "paddle/fluid/ir_adaptor/translator/translate.h"
#include <memory> #include <memory>
#include "paddle/fluid/dialect/pd_dialect.h"
#include "paddle/fluid/framework/program_desc.h" #include "paddle/fluid/framework/program_desc.h"
#include "paddle/fluid/translator/program_translator.h" #include "paddle/fluid/ir/dialect/pd_dialect.h"
#include "paddle/fluid/ir_adaptor/translator/program_translator.h"
#include "paddle/ir/core/program.h" #include "paddle/ir/core/program.h"
namespace paddle { namespace paddle {
......
...@@ -16,8 +16,8 @@ ...@@ -16,8 +16,8 @@
#include <memory> #include <memory>
#include "paddle/fluid/dialect/pd_dialect.h"
#include "paddle/fluid/framework/program_desc.h" #include "paddle/fluid/framework/program_desc.h"
#include "paddle/fluid/ir/dialect/pd_dialect.h"
#include "paddle/ir/core/program.h" #include "paddle/ir/core/program.h"
namespace paddle { namespace paddle {
......
...@@ -12,11 +12,11 @@ ...@@ -12,11 +12,11 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
#include "paddle/fluid/translator/type_translator.h" #include "paddle/fluid/ir_adaptor/translator/type_translator.h"
#include "paddle/fluid/dialect/pd_type.h"
#include "paddle/fluid/dialect/pd_type_storage.h"
#include "paddle/fluid/framework/framework.pb.h" #include "paddle/fluid/framework/framework.pb.h"
#include "paddle/fluid/ir/dialect/pd_type.h"
#include "paddle/fluid/ir/dialect/pd_type_storage.h"
#include "paddle/ir/core/builtin_type.h" #include "paddle/ir/core/builtin_type.h"
namespace paddle { namespace paddle {
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
#include "paddle/fluid/framework/op_desc.h" #include "paddle/fluid/framework/op_desc.h"
#include "paddle/fluid/framework/var_desc.h" #include "paddle/fluid/framework/var_desc.h"
#include "paddle/fluid/translator/program_translator.h" #include "paddle/fluid/ir_adaptor/translator/program_translator.h"
#include "paddle/ir/core/builtin_type.h" #include "paddle/ir/core/builtin_type.h"
#include "paddle/ir/core/dialect.h" #include "paddle/ir/core/dialect.h"
#include "paddle/ir/core/ir_context.h" #include "paddle/ir/core/ir_context.h"
......
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
#include "paddle/phi/core/kernel_context.h" #include "paddle/phi/core/kernel_context.h"
#include "paddle/phi/core/kernel_factory.h" #include "paddle/phi/core/kernel_factory.h"
#include "paddle/fluid/interface/infershape.h" #include "paddle/fluid/ir/interface/infershape.h"
#include "paddle/fluid/platform/init.h" #include "paddle/fluid/platform/init.h"
#include "paddle/phi/core/infermeta_utils.h" #include "paddle/phi/core/infermeta_utils.h"
#include "paddle/phi/infermeta/nullary.h" #include "paddle/phi/infermeta/nullary.h"
......
...@@ -14,10 +14,10 @@ ...@@ -14,10 +14,10 @@
#include <gtest/gtest.h> #include <gtest/gtest.h>
#include "paddle/fluid/dialect/pd_dialect.h" #include "paddle/fluid/ir/dialect/pd_dialect.h"
#include "paddle/fluid/dialect/pd_interface.h" #include "paddle/fluid/ir/dialect/pd_interface.h"
#include "paddle/fluid/dialect/pd_type.h" #include "paddle/fluid/ir/dialect/pd_type.h"
#include "paddle/fluid/dialect/utils.h" #include "paddle/fluid/ir/dialect/utils.h"
#include "paddle/ir/core/block.h" #include "paddle/ir/core/block.h"
#include "paddle/ir/core/builtin_attribute.h" #include "paddle/ir/core/builtin_attribute.h"
#include "paddle/ir/core/builtin_dialect.h" #include "paddle/ir/core/builtin_dialect.h"
......
...@@ -18,11 +18,11 @@ ...@@ -18,11 +18,11 @@
#include <map> #include <map>
#include <string> #include <string>
#include "paddle/fluid/dialect/pd_dialect.h"
#include "paddle/fluid/framework/framework.pb.h" #include "paddle/fluid/framework/framework.pb.h"
#include "paddle/fluid/framework/operator.h" #include "paddle/fluid/framework/operator.h"
#include "paddle/fluid/framework/program_desc.h" #include "paddle/fluid/framework/program_desc.h"
#include "paddle/fluid/translator/translate.h" #include "paddle/fluid/ir/dialect/pd_dialect.h"
#include "paddle/fluid/ir_adaptor/translator/translate.h"
#include "paddle/ir/core/builtin_dialect.h" #include "paddle/ir/core/builtin_dialect.h"
#include "paddle/ir/core/dialect.h" #include "paddle/ir/core/dialect.h"
#include "paddle/ir/core/ir_context.h" #include "paddle/ir/core/ir_context.h"
......
...@@ -14,10 +14,10 @@ ...@@ -14,10 +14,10 @@
#include <gtest/gtest.h> #include <gtest/gtest.h>
#include "paddle/fluid/dialect/pd_dialect.h" #include "paddle/fluid/ir/dialect/pd_dialect.h"
#include "paddle/fluid/dialect/pd_interface.h" #include "paddle/fluid/ir/dialect/pd_interface.h"
#include "paddle/fluid/dialect/pd_type.h" #include "paddle/fluid/ir/dialect/pd_type.h"
#include "paddle/fluid/dialect/utils.h" #include "paddle/fluid/ir/dialect/utils.h"
#include "paddle/ir/core/builtin_dialect.h" #include "paddle/ir/core/builtin_dialect.h"
#include "paddle/ir/core/builtin_op.h" #include "paddle/ir/core/builtin_op.h"
#include "paddle/ir/core/builtin_type.h" #include "paddle/ir/core/builtin_type.h"
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册