diff --git a/paddle/fluid/eager/grad_node_info.h b/paddle/fluid/eager/grad_node_info.h index 25d158a8cd1a8..1ad01ce8f5d4f 100644 --- a/paddle/fluid/eager/grad_node_info.h +++ b/paddle/fluid/eager/grad_node_info.h @@ -21,7 +21,7 @@ #include "paddle/fluid/eager/hooks.h" #include "paddle/phi/api/all.h" #include "paddle/phi/core/distributed/auto_parallel/dist_attr.h" -#include "paddle/phi/core/distributed/auto_parallel/reshard_utils.h" +#include "paddle/phi/core/distributed/auto_parallel/reshard/reshard_utils.h" #include "paddle/utils/test_macros.h" namespace egr { diff --git a/paddle/fluid/operators/collective/c_comm_init_op.cc b/paddle/fluid/operators/collective/c_comm_init_op.cc index e6815115865aa..8f2ff85fed5aa 100644 --- a/paddle/fluid/operators/collective/c_comm_init_op.cc +++ b/paddle/fluid/operators/collective/c_comm_init_op.cc @@ -34,7 +34,7 @@ limitations under the License. */ PHI_DECLARE_bool(dynamic_static_unified_comm); #endif -#include "paddle/phi/core/distributed/auto_parallel/reshard_utils.h" +#include "paddle/phi/core/distributed/auto_parallel/reshard/reshard_utils.h" #include "paddle/phi/core/distributed/comm_context_manager.h" #include "paddle/phi/core/distributed/store/store_utils.h" #include "paddle/phi/core/distributed/store/tcp_store.h" diff --git a/paddle/fluid/pybind/auto_parallel_py.cc b/paddle/fluid/pybind/auto_parallel_py.cc index 8134091e99f31..47162f97f9082 100644 --- a/paddle/fluid/pybind/auto_parallel_py.cc +++ b/paddle/fluid/pybind/auto_parallel_py.cc @@ -40,13 +40,13 @@ #include "paddle/phi/backends/context_pool.h" #include "paddle/phi/core/dense_tensor.h" #include "paddle/phi/core/distributed/auto_parallel/dist_tensor.h" -#include "paddle/phi/core/distributed/auto_parallel/nd_mesh_reshard_function.h" -#include "paddle/phi/core/distributed/auto_parallel/p_to_r_reshard_function.h" -#include "paddle/phi/core/distributed/auto_parallel/r_to_p_reshard_function.h" -#include "paddle/phi/core/distributed/auto_parallel/r_to_s_reshard_function.h" -#include "paddle/phi/core/distributed/auto_parallel/s_to_r_reshard_function.h" -#include "paddle/phi/core/distributed/auto_parallel/s_to_s_reshard_function.h" -#include "paddle/phi/core/distributed/auto_parallel/same_status_reshard_function.h" +#include "paddle/phi/core/distributed/auto_parallel/reshard/nd_mesh_reshard_function.h" +#include "paddle/phi/core/distributed/auto_parallel/reshard/p_to_r_reshard_function.h" +#include "paddle/phi/core/distributed/auto_parallel/reshard/r_to_p_reshard_function.h" +#include "paddle/phi/core/distributed/auto_parallel/reshard/r_to_s_reshard_function.h" +#include "paddle/phi/core/distributed/auto_parallel/reshard/s_to_r_reshard_function.h" +#include "paddle/phi/core/distributed/auto_parallel/reshard/s_to_s_reshard_function.h" +#include "paddle/phi/core/distributed/auto_parallel/reshard/same_status_reshard_function.h" #include "paddle/phi/core/enforce.h" #ifdef PADDLE_WITH_DISTRIBUTE diff --git a/paddle/fluid/pybind/eager_method.cc b/paddle/fluid/pybind/eager_method.cc index 897edf033aa94..8de8d4d64e18e 100644 --- a/paddle/fluid/pybind/eager_method.cc +++ b/paddle/fluid/pybind/eager_method.cc @@ -61,8 +61,8 @@ typedef SSIZE_T ssize_t; #include "paddle/phi/api/lib/data_transform.h" #include "paddle/phi/core/ddim.h" #include "paddle/phi/core/distributed/auto_parallel/dist_tensor.h" -#include "paddle/phi/core/distributed/auto_parallel/reshard_function.h" -#include "paddle/phi/core/distributed/auto_parallel/reshard_utils.h" +#include "paddle/phi/core/distributed/auto_parallel/reshard/reshard_function.h" +#include "paddle/phi/core/distributed/auto_parallel/reshard/reshard_utils.h" #include "paddle/phi/core/flags.h" #include "paddle/phi/core/tensor_utils.h" #include "paddle/phi/kernels/funcs/math_function.h" diff --git a/paddle/phi/api/include/tensor_utils.h b/paddle/phi/api/include/tensor_utils.h index 83d02a7f716d0..0f5f1f1f8744e 100644 --- a/paddle/phi/api/include/tensor_utils.h +++ b/paddle/phi/api/include/tensor_utils.h @@ -18,8 +18,8 @@ limitations under the License. */ #include "paddle/phi/api/include/tensor.h" #ifdef PADDLE_WITH_DISTRIBUTE -#include "paddle/phi/core/distributed/auto_parallel/reshard_function.h" -#include "paddle/phi/core/distributed/auto_parallel/reshard_utils.h" +#include "paddle/phi/core/distributed/auto_parallel/reshard/reshard_function.h" +#include "paddle/phi/core/distributed/auto_parallel/reshard/reshard_utils.h" #endif namespace paddle { diff --git a/paddle/phi/api/lib/api_custom_impl.cc b/paddle/phi/api/lib/api_custom_impl.cc index 2f05194e1b708..1d0ae74a92a49 100644 --- a/paddle/phi/api/lib/api_custom_impl.cc +++ b/paddle/phi/api/lib/api_custom_impl.cc @@ -29,7 +29,7 @@ limitations under the License. */ #include "paddle/phi/infermeta/nullary.h" #include "paddle/phi/infermeta/unary.h" #ifdef PADDLE_WITH_DISTRIBUTE -#include "paddle/phi/core/distributed/auto_parallel/reshard_utils.h" +#include "paddle/phi/core/distributed/auto_parallel/reshard/reshard_utils.h" #include "paddle/phi/infermeta/spmd_rules/rules.h" #endif namespace paddle { diff --git a/paddle/phi/api/lib/data_transform.cc b/paddle/phi/api/lib/data_transform.cc index 369ba5dd77487..97508f7920716 100644 --- a/paddle/phi/api/lib/data_transform.cc +++ b/paddle/phi/api/lib/data_transform.cc @@ -23,8 +23,8 @@ limitations under the License. */ #include "paddle/phi/api/lib/utils/allocator.h" #include "paddle/phi/backends/context_pool.h" #include "paddle/phi/core/distributed/auto_parallel/dist_tensor.h" -#include "paddle/phi/core/distributed/auto_parallel/reshard_function.h" -#include "paddle/phi/core/distributed/auto_parallel/reshard_utils.h" +#include "paddle/phi/core/distributed/auto_parallel/reshard/reshard_function.h" +#include "paddle/phi/core/distributed/auto_parallel/reshard/reshard_utils.h" #include "paddle/phi/core/flags.h" #include "paddle/phi/core/kernel_registry.h" #include "paddle/phi/core/tensor_utils.h" diff --git a/paddle/phi/api/lib/tensor_copy.cc b/paddle/phi/api/lib/tensor_copy.cc index d0bc297179964..4e95157008995 100644 --- a/paddle/phi/api/lib/tensor_copy.cc +++ b/paddle/phi/api/lib/tensor_copy.cc @@ -26,7 +26,7 @@ limitations under the License. */ #include "paddle/phi/infermeta/unary.h" #ifdef PADDLE_WITH_DISTRIBUTE #include "paddle/phi/api/lib/data_transform.h" -#include "paddle/phi/core/distributed/auto_parallel/reshard_utils.h" +#include "paddle/phi/core/distributed/auto_parallel/reshard/reshard_utils.h" #include "paddle/phi/infermeta/spmd_rules/rules.h" #endif namespace paddle { diff --git a/paddle/phi/api/lib/tensor_method.cc b/paddle/phi/api/lib/tensor_method.cc index 61fe33fc5ad80..7058796f769d4 100644 --- a/paddle/phi/api/lib/tensor_method.cc +++ b/paddle/phi/api/lib/tensor_method.cc @@ -29,7 +29,7 @@ limitations under the License. */ // clang-format off #ifdef PADDLE_WITH_DISTRIBUTE #include "paddle/phi/infermeta/spmd_rules/rules.h" -#include "paddle/phi/core/distributed/auto_parallel/reshard_utils.h" +#include "paddle/phi/core/distributed/auto_parallel/reshard/reshard_utils.h" #include "paddle/phi/api/lib/data_transform.h" #endif namespace paddle { diff --git a/paddle/phi/api/yaml/generator/api_gen.py b/paddle/phi/api/yaml/generator/api_gen.py index 6d7bfbb232ead..27f329b80c607 100644 --- a/paddle/phi/api/yaml/generator/api_gen.py +++ b/paddle/phi/api/yaml/generator/api_gen.py @@ -382,7 +382,7 @@ def source_include(header_file_path): #ifdef PADDLE_WITH_DISTRIBUTE #include "paddle/phi/infermeta/spmd_rules/rules.h" -#include "paddle/phi/core/distributed/auto_parallel/reshard_utils.h" +#include "paddle/phi/core/distributed/auto_parallel/reshard/reshard_utils.h" #endif PD_DECLARE_bool(conv2d_disable_cudnn); diff --git a/paddle/phi/api/yaml/generator/dist_bw_api_gen.py b/paddle/phi/api/yaml/generator/dist_bw_api_gen.py index 61cc50248afbe..04b3af4ec48cf 100644 --- a/paddle/phi/api/yaml/generator/dist_bw_api_gen.py +++ b/paddle/phi/api/yaml/generator/dist_bw_api_gen.py @@ -340,7 +340,7 @@ def source_include(header_file_path, fw_header_file_path): #ifdef PADDLE_WITH_DISTRIBUTE #include "paddle/phi/infermeta/spmd_rules/rules.h" -#include "paddle/phi/core/distributed/auto_parallel/reshard_utils.h" +#include "paddle/phi/core/distributed/auto_parallel/reshard/reshard_utils.h" #endif PD_DECLARE_bool(conv2d_disable_cudnn); diff --git a/paddle/phi/core/distributed/auto_parallel/CMakeLists.txt b/paddle/phi/core/distributed/auto_parallel/CMakeLists.txt index 92e69e0dc7657..15e73c3d50215 100644 --- a/paddle/phi/core/distributed/auto_parallel/CMakeLists.txt +++ b/paddle/phi/core/distributed/auto_parallel/CMakeLists.txt @@ -7,15 +7,8 @@ collect_srcs( process_mesh.cc dist_attr.cc dist_mapper.cc - reshard_utils.cc dist_tensor.cc dist_meta_tensor.cc - inferspmd_utils.cc - reshard_function.cc - r_to_s_reshard_function.cc - s_to_r_reshard_function.cc - r_to_p_reshard_function.cc - p_to_r_reshard_function.cc - s_to_s_reshard_function.cc - nd_mesh_reshard_function.cc - same_status_reshard_function.cc) + inferspmd_utils.cc) + +add_subdirectory(reshard) diff --git a/paddle/phi/core/distributed/auto_parallel/dist_tensor.cc b/paddle/phi/core/distributed/auto_parallel/dist_tensor.cc index 8e3e6405f4d29..a2e3ac5123a44 100644 --- a/paddle/phi/core/distributed/auto_parallel/dist_tensor.cc +++ b/paddle/phi/core/distributed/auto_parallel/dist_tensor.cc @@ -16,8 +16,8 @@ #include "glog/logging.h" #include "paddle/phi/backends/context_pool.h" -#include "paddle/phi/core/distributed/auto_parallel/reshard_function.h" -#include "paddle/phi/core/distributed/auto_parallel/reshard_utils.h" +#include "paddle/phi/core/distributed/auto_parallel/reshard/reshard_function.h" +#include "paddle/phi/core/distributed/auto_parallel/reshard/reshard_utils.h" #include "paddle/phi/core/distributed/store/store_utils.h" namespace phi { diff --git a/paddle/phi/core/distributed/auto_parallel/reshard/CMakeLists.txt b/paddle/phi/core/distributed/auto_parallel/reshard/CMakeLists.txt new file mode 100644 index 0000000000000..e5902375cfec6 --- /dev/null +++ b/paddle/phi/core/distributed/auto_parallel/reshard/CMakeLists.txt @@ -0,0 +1,12 @@ +collect_srcs( + core_srcs + SRCS + reshard_utils.cc + reshard_function.cc + r_to_s_reshard_function.cc + s_to_r_reshard_function.cc + r_to_p_reshard_function.cc + p_to_r_reshard_function.cc + s_to_s_reshard_function.cc + nd_mesh_reshard_function.cc + same_status_reshard_function.cc) diff --git a/paddle/phi/core/distributed/auto_parallel/nd_mesh_reshard_function.cc b/paddle/phi/core/distributed/auto_parallel/reshard/nd_mesh_reshard_function.cc similarity index 95% rename from paddle/phi/core/distributed/auto_parallel/nd_mesh_reshard_function.cc rename to paddle/phi/core/distributed/auto_parallel/reshard/nd_mesh_reshard_function.cc index 960807000974e..28d71ff93b49c 100644 --- a/paddle/phi/core/distributed/auto_parallel/nd_mesh_reshard_function.cc +++ b/paddle/phi/core/distributed/auto_parallel/reshard/nd_mesh_reshard_function.cc @@ -12,17 +12,17 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "paddle/phi/core/distributed/auto_parallel/nd_mesh_reshard_function.h" +#include "paddle/phi/core/distributed/auto_parallel/reshard/nd_mesh_reshard_function.h" #include "glog/logging.h" #include "paddle/phi/common/int_array.h" #include "paddle/phi/core/distributed/auto_parallel/dist_attr.h" #include "paddle/phi/core/distributed/auto_parallel/dist_tensor.h" -#include "paddle/phi/core/distributed/auto_parallel/p_to_r_reshard_function.h" -#include "paddle/phi/core/distributed/auto_parallel/r_to_p_reshard_function.h" -#include "paddle/phi/core/distributed/auto_parallel/r_to_s_reshard_function.h" -#include "paddle/phi/core/distributed/auto_parallel/reshard_utils.h" -#include "paddle/phi/core/distributed/auto_parallel/s_to_r_reshard_function.h" +#include "paddle/phi/core/distributed/auto_parallel/reshard/p_to_r_reshard_function.h" +#include "paddle/phi/core/distributed/auto_parallel/reshard/r_to_p_reshard_function.h" +#include "paddle/phi/core/distributed/auto_parallel/reshard/r_to_s_reshard_function.h" +#include "paddle/phi/core/distributed/auto_parallel/reshard/reshard_utils.h" +#include "paddle/phi/core/distributed/auto_parallel/reshard/s_to_r_reshard_function.h" namespace phi { namespace distributed { diff --git a/paddle/phi/core/distributed/auto_parallel/nd_mesh_reshard_function.h b/paddle/phi/core/distributed/auto_parallel/reshard/nd_mesh_reshard_function.h similarity index 93% rename from paddle/phi/core/distributed/auto_parallel/nd_mesh_reshard_function.h rename to paddle/phi/core/distributed/auto_parallel/reshard/nd_mesh_reshard_function.h index e47cb46138f7b..169c51899717e 100644 --- a/paddle/phi/core/distributed/auto_parallel/nd_mesh_reshard_function.h +++ b/paddle/phi/core/distributed/auto_parallel/reshard/nd_mesh_reshard_function.h @@ -14,7 +14,7 @@ #pragma once -#include "paddle/phi/core/distributed/auto_parallel/reshard_function.h" +#include "paddle/phi/core/distributed/auto_parallel/reshard/reshard_function.h" namespace phi { namespace distributed { diff --git a/paddle/phi/core/distributed/auto_parallel/p_to_r_reshard_function.cc b/paddle/phi/core/distributed/auto_parallel/reshard/p_to_r_reshard_function.cc similarity index 95% rename from paddle/phi/core/distributed/auto_parallel/p_to_r_reshard_function.cc rename to paddle/phi/core/distributed/auto_parallel/reshard/p_to_r_reshard_function.cc index 53ea82569eb5e..ce4d571306cba 100644 --- a/paddle/phi/core/distributed/auto_parallel/p_to_r_reshard_function.cc +++ b/paddle/phi/core/distributed/auto_parallel/reshard/p_to_r_reshard_function.cc @@ -12,13 +12,13 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "paddle/phi/core/distributed/auto_parallel/p_to_r_reshard_function.h" +#include "paddle/phi/core/distributed/auto_parallel/reshard/p_to_r_reshard_function.h" #include "glog/logging.h" #include "paddle/phi/core/distributed/auto_parallel/dist_attr.h" #include "paddle/phi/core/distributed/auto_parallel/dist_tensor.h" -#include "paddle/phi/core/distributed/auto_parallel/reshard_utils.h" +#include "paddle/phi/core/distributed/auto_parallel/reshard/reshard_utils.h" #include "paddle/phi/kernels/all_reduce_kernel.h" #include "paddle/phi/kernels/elementwise_divide_kernel.h" #include "paddle/phi/kernels/full_kernel.h" diff --git a/paddle/phi/core/distributed/auto_parallel/p_to_r_reshard_function.h b/paddle/phi/core/distributed/auto_parallel/reshard/p_to_r_reshard_function.h similarity index 93% rename from paddle/phi/core/distributed/auto_parallel/p_to_r_reshard_function.h rename to paddle/phi/core/distributed/auto_parallel/reshard/p_to_r_reshard_function.h index 3895b9246f3c6..c1b0c3cd01060 100644 --- a/paddle/phi/core/distributed/auto_parallel/p_to_r_reshard_function.h +++ b/paddle/phi/core/distributed/auto_parallel/reshard/p_to_r_reshard_function.h @@ -14,7 +14,7 @@ #pragma once -#include "paddle/phi/core/distributed/auto_parallel/reshard_function.h" +#include "paddle/phi/core/distributed/auto_parallel/reshard/reshard_function.h" namespace phi { namespace distributed { diff --git a/paddle/phi/core/distributed/auto_parallel/r_to_p_reshard_function.cc b/paddle/phi/core/distributed/auto_parallel/reshard/r_to_p_reshard_function.cc similarity index 93% rename from paddle/phi/core/distributed/auto_parallel/r_to_p_reshard_function.cc rename to paddle/phi/core/distributed/auto_parallel/reshard/r_to_p_reshard_function.cc index 0af1c2b625a84..93bc88f7888a0 100644 --- a/paddle/phi/core/distributed/auto_parallel/r_to_p_reshard_function.cc +++ b/paddle/phi/core/distributed/auto_parallel/reshard/r_to_p_reshard_function.cc @@ -12,13 +12,13 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "paddle/phi/core/distributed/auto_parallel/r_to_p_reshard_function.h" +#include "paddle/phi/core/distributed/auto_parallel/reshard/r_to_p_reshard_function.h" #include "glog/logging.h" #include "paddle/phi/core/distributed/auto_parallel/dist_attr.h" #include "paddle/phi/core/distributed/auto_parallel/dist_tensor.h" -#include "paddle/phi/core/distributed/auto_parallel/reshard_utils.h" +#include "paddle/phi/core/distributed/auto_parallel/reshard/reshard_utils.h" #include "paddle/phi/kernels/assign_kernel.h" #include "paddle/phi/kernels/full_kernel.h" diff --git a/paddle/phi/core/distributed/auto_parallel/r_to_p_reshard_function.h b/paddle/phi/core/distributed/auto_parallel/reshard/r_to_p_reshard_function.h similarity index 93% rename from paddle/phi/core/distributed/auto_parallel/r_to_p_reshard_function.h rename to paddle/phi/core/distributed/auto_parallel/reshard/r_to_p_reshard_function.h index af3bdb41d78c1..3014cdc550e6c 100644 --- a/paddle/phi/core/distributed/auto_parallel/r_to_p_reshard_function.h +++ b/paddle/phi/core/distributed/auto_parallel/reshard/r_to_p_reshard_function.h @@ -14,7 +14,7 @@ #pragma once -#include "paddle/phi/core/distributed/auto_parallel/reshard_function.h" +#include "paddle/phi/core/distributed/auto_parallel/reshard/reshard_function.h" namespace phi { namespace distributed { diff --git a/paddle/phi/core/distributed/auto_parallel/r_to_s_reshard_function.cc b/paddle/phi/core/distributed/auto_parallel/reshard/r_to_s_reshard_function.cc similarity index 95% rename from paddle/phi/core/distributed/auto_parallel/r_to_s_reshard_function.cc rename to paddle/phi/core/distributed/auto_parallel/reshard/r_to_s_reshard_function.cc index d342dc53a86c7..f4651f0619999 100644 --- a/paddle/phi/core/distributed/auto_parallel/r_to_s_reshard_function.cc +++ b/paddle/phi/core/distributed/auto_parallel/reshard/r_to_s_reshard_function.cc @@ -12,13 +12,13 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "paddle/phi/core/distributed/auto_parallel/r_to_s_reshard_function.h" +#include "paddle/phi/core/distributed/auto_parallel/reshard/r_to_s_reshard_function.h" #include "glog/logging.h" #include "paddle/phi/core/distributed/auto_parallel/dist_attr.h" #include "paddle/phi/core/distributed/auto_parallel/dist_tensor.h" -#include "paddle/phi/core/distributed/auto_parallel/reshard_utils.h" -#include "paddle/phi/core/distributed/auto_parallel/same_status_reshard_function.h" +#include "paddle/phi/core/distributed/auto_parallel/reshard/reshard_utils.h" +#include "paddle/phi/core/distributed/auto_parallel/reshard/same_status_reshard_function.h" #include "paddle/phi/kernels/split_kernel.h" namespace phi { diff --git a/paddle/phi/core/distributed/auto_parallel/r_to_s_reshard_function.h b/paddle/phi/core/distributed/auto_parallel/reshard/r_to_s_reshard_function.h similarity index 94% rename from paddle/phi/core/distributed/auto_parallel/r_to_s_reshard_function.h rename to paddle/phi/core/distributed/auto_parallel/reshard/r_to_s_reshard_function.h index 4149426aacf66..4ca086525b0d2 100644 --- a/paddle/phi/core/distributed/auto_parallel/r_to_s_reshard_function.h +++ b/paddle/phi/core/distributed/auto_parallel/reshard/r_to_s_reshard_function.h @@ -14,7 +14,7 @@ #pragma once -#include "paddle/phi/core/distributed/auto_parallel/reshard_function.h" +#include "paddle/phi/core/distributed/auto_parallel/reshard/reshard_function.h" namespace phi { namespace distributed { diff --git a/paddle/phi/core/distributed/auto_parallel/reshard_function.cc b/paddle/phi/core/distributed/auto_parallel/reshard/reshard_function.cc similarity index 97% rename from paddle/phi/core/distributed/auto_parallel/reshard_function.cc rename to paddle/phi/core/distributed/auto_parallel/reshard/reshard_function.cc index 01824dd93bca1..04d47e4151d8a 100644 --- a/paddle/phi/core/distributed/auto_parallel/reshard_function.cc +++ b/paddle/phi/core/distributed/auto_parallel/reshard/reshard_function.cc @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "paddle/phi/core/distributed/auto_parallel/reshard_function.h" +#include "paddle/phi/core/distributed/auto_parallel/reshard/reshard_function.h" #include "paddle/phi/core/distributed/auto_parallel/dist_attr.h" #include "paddle/phi/core/distributed/auto_parallel/dist_tensor.h" diff --git a/paddle/phi/core/distributed/auto_parallel/reshard_function.h b/paddle/phi/core/distributed/auto_parallel/reshard/reshard_function.h similarity index 100% rename from paddle/phi/core/distributed/auto_parallel/reshard_function.h rename to paddle/phi/core/distributed/auto_parallel/reshard/reshard_function.h diff --git a/paddle/phi/core/distributed/auto_parallel/reshard_utils.cc b/paddle/phi/core/distributed/auto_parallel/reshard/reshard_utils.cc similarity index 97% rename from paddle/phi/core/distributed/auto_parallel/reshard_utils.cc rename to paddle/phi/core/distributed/auto_parallel/reshard/reshard_utils.cc index 56c39eadeb8c3..e7a1ec15da307 100644 --- a/paddle/phi/core/distributed/auto_parallel/reshard_utils.cc +++ b/paddle/phi/core/distributed/auto_parallel/reshard/reshard_utils.cc @@ -12,13 +12,13 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "paddle/phi/core/distributed/auto_parallel/reshard_utils.h" +#include "paddle/phi/core/distributed/auto_parallel/reshard/reshard_utils.h" #include "glog/logging.h" #include "paddle/phi/backends/context_pool.h" #include "paddle/phi/core/device_context.h" #include "paddle/phi/core/distributed/auto_parallel/process_mesh.h" -#include "paddle/phi/core/distributed/auto_parallel/reshard_function.h" +#include "paddle/phi/core/distributed/auto_parallel/reshard/reshard_function.h" #include "paddle/phi/core/distributed/comm_context_manager.h" #include "paddle/phi/core/distributed/store/store_utils.h" #include "paddle/phi/core/enforce.h" diff --git a/paddle/phi/core/distributed/auto_parallel/reshard_utils.h b/paddle/phi/core/distributed/auto_parallel/reshard/reshard_utils.h similarity index 100% rename from paddle/phi/core/distributed/auto_parallel/reshard_utils.h rename to paddle/phi/core/distributed/auto_parallel/reshard/reshard_utils.h diff --git a/paddle/phi/core/distributed/auto_parallel/s_to_r_reshard_function.cc b/paddle/phi/core/distributed/auto_parallel/reshard/s_to_r_reshard_function.cc similarity index 97% rename from paddle/phi/core/distributed/auto_parallel/s_to_r_reshard_function.cc rename to paddle/phi/core/distributed/auto_parallel/reshard/s_to_r_reshard_function.cc index d4d62844be34f..55c22fb034555 100644 --- a/paddle/phi/core/distributed/auto_parallel/s_to_r_reshard_function.cc +++ b/paddle/phi/core/distributed/auto_parallel/reshard/s_to_r_reshard_function.cc @@ -12,13 +12,13 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "paddle/phi/core/distributed/auto_parallel/s_to_r_reshard_function.h" +#include "paddle/phi/core/distributed/auto_parallel/reshard/s_to_r_reshard_function.h" #include "glog/logging.h" #include "paddle/phi/common/int_array.h" #include "paddle/phi/core/distributed/auto_parallel/dist_attr.h" #include "paddle/phi/core/distributed/auto_parallel/dist_tensor.h" -#include "paddle/phi/core/distributed/auto_parallel/reshard_utils.h" +#include "paddle/phi/core/distributed/auto_parallel/reshard/reshard_utils.h" #include "paddle/phi/kernels/all_gather_kernel.h" #include "paddle/phi/kernels/concat_kernel.h" #include "paddle/phi/kernels/split_kernel.h" diff --git a/paddle/phi/core/distributed/auto_parallel/s_to_r_reshard_function.h b/paddle/phi/core/distributed/auto_parallel/reshard/s_to_r_reshard_function.h similarity index 89% rename from paddle/phi/core/distributed/auto_parallel/s_to_r_reshard_function.h rename to paddle/phi/core/distributed/auto_parallel/reshard/s_to_r_reshard_function.h index 4360c616595be..ee4b65fade96e 100644 --- a/paddle/phi/core/distributed/auto_parallel/s_to_r_reshard_function.h +++ b/paddle/phi/core/distributed/auto_parallel/reshard/s_to_r_reshard_function.h @@ -13,8 +13,8 @@ // limitations under the License. #pragma once -#include "paddle/phi/core/distributed/auto_parallel/reshard_function.h" -#include "paddle/phi/core/distributed/auto_parallel/same_status_reshard_function.h" +#include "paddle/phi/core/distributed/auto_parallel/reshard/reshard_function.h" +#include "paddle/phi/core/distributed/auto_parallel/reshard/same_status_reshard_function.h" namespace phi { namespace distributed { diff --git a/paddle/phi/core/distributed/auto_parallel/s_to_s_reshard_function.cc b/paddle/phi/core/distributed/auto_parallel/reshard/s_to_s_reshard_function.cc similarity index 96% rename from paddle/phi/core/distributed/auto_parallel/s_to_s_reshard_function.cc rename to paddle/phi/core/distributed/auto_parallel/reshard/s_to_s_reshard_function.cc index d90903220d872..cf454926093dd 100644 --- a/paddle/phi/core/distributed/auto_parallel/s_to_s_reshard_function.cc +++ b/paddle/phi/core/distributed/auto_parallel/reshard/s_to_s_reshard_function.cc @@ -12,13 +12,13 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "paddle/phi/core/distributed/auto_parallel/s_to_s_reshard_function.h" +#include "paddle/phi/core/distributed/auto_parallel/reshard/s_to_s_reshard_function.h" #include "glog/logging.h" #include "paddle/phi/core/distributed/auto_parallel/dist_attr.h" #include "paddle/phi/core/distributed/auto_parallel/dist_tensor.h" -#include "paddle/phi/core/distributed/auto_parallel/reshard_utils.h" +#include "paddle/phi/core/distributed/auto_parallel/reshard/reshard_utils.h" #include "paddle/phi/kernels/all_to_all_kernel.h" #include "paddle/phi/kernels/reshape_kernel.h" #include "paddle/phi/kernels/transpose_kernel.h" diff --git a/paddle/phi/core/distributed/auto_parallel/s_to_s_reshard_function.h b/paddle/phi/core/distributed/auto_parallel/reshard/s_to_s_reshard_function.h similarity index 93% rename from paddle/phi/core/distributed/auto_parallel/s_to_s_reshard_function.h rename to paddle/phi/core/distributed/auto_parallel/reshard/s_to_s_reshard_function.h index b004ed919c192..383c7b522ad62 100644 --- a/paddle/phi/core/distributed/auto_parallel/s_to_s_reshard_function.h +++ b/paddle/phi/core/distributed/auto_parallel/reshard/s_to_s_reshard_function.h @@ -14,7 +14,7 @@ #pragma once -#include "paddle/phi/core/distributed/auto_parallel/reshard_function.h" +#include "paddle/phi/core/distributed/auto_parallel/reshard/reshard_function.h" namespace phi { namespace distributed { diff --git a/paddle/phi/core/distributed/auto_parallel/same_status_reshard_function.cc b/paddle/phi/core/distributed/auto_parallel/reshard/same_status_reshard_function.cc similarity index 97% rename from paddle/phi/core/distributed/auto_parallel/same_status_reshard_function.cc rename to paddle/phi/core/distributed/auto_parallel/reshard/same_status_reshard_function.cc index 5360368469f56..5740e14ae833a 100644 --- a/paddle/phi/core/distributed/auto_parallel/same_status_reshard_function.cc +++ b/paddle/phi/core/distributed/auto_parallel/reshard/same_status_reshard_function.cc @@ -12,14 +12,14 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "paddle/phi/core/distributed/auto_parallel/same_status_reshard_function.h" +#include "paddle/phi/core/distributed/auto_parallel/reshard/same_status_reshard_function.h" #include #include "glog/logging.h" #include "paddle/phi/core/distributed/auto_parallel/dist_attr.h" #include "paddle/phi/core/distributed/auto_parallel/dist_tensor.h" -#include "paddle/phi/core/distributed/auto_parallel/reshard_utils.h" +#include "paddle/phi/core/distributed/auto_parallel/reshard/reshard_utils.h" #include "paddle/phi/core/distributed/store/store_utils.h" #include "paddle/phi/kernels/p_recv_kernel.h" #include "paddle/phi/kernels/p_send_kernel.h" diff --git a/paddle/phi/core/distributed/auto_parallel/same_status_reshard_function.h b/paddle/phi/core/distributed/auto_parallel/reshard/same_status_reshard_function.h similarity index 93% rename from paddle/phi/core/distributed/auto_parallel/same_status_reshard_function.h rename to paddle/phi/core/distributed/auto_parallel/reshard/same_status_reshard_function.h index 38c044e083a09..7abaec5e8f6c3 100644 --- a/paddle/phi/core/distributed/auto_parallel/same_status_reshard_function.h +++ b/paddle/phi/core/distributed/auto_parallel/reshard/same_status_reshard_function.h @@ -14,7 +14,7 @@ #pragma once -#include "paddle/phi/core/distributed/auto_parallel/reshard_function.h" +#include "paddle/phi/core/distributed/auto_parallel/reshard/reshard_function.h" namespace phi { namespace distributed {