Skip to content

clean custom_device_common_op_registry #72338

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 18, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions paddle/fluid/eager/auto_code_generator/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,6 @@ if(WITH_CINN)
list(REMOVE_ITEM EAGER_GENERATOR_DEPS imperative_flag)
endif()

if(WITH_CUSTOM_DEVICE)
set(EAGER_GENERATOR_DEPS ${EAGER_GENERATOR_DEPS}
custom_device_common_op_registry)
endif()

get_property(os_dependency_modules GLOBAL PROPERTY OS_DEPENDENCY_MODULES)

# Prepare file structure
Expand Down
4 changes: 0 additions & 4 deletions paddle/fluid/operators/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -139,10 +139,6 @@ endif()

copy_if_different(${pybind_file} ${pybind_file_final})

if (WITH_CUSTOM_DEVICE)
cc_library(custom_device_common_op_registry SRCS custom_device_common_op_registry.cc DEPS operator phi common type_info)
endif()

if(NOT "${OP_LIST}" STREQUAL "")
prune_pybind_h()
endif()
1,327 changes: 0 additions & 1,327 deletions paddle/fluid/operators/custom_device_common_op_registry.cc

This file was deleted.

29 changes: 0 additions & 29 deletions paddle/fluid/operators/custom_device_common_op_registry.h

This file was deleted.

14 changes: 0 additions & 14 deletions paddle/fluid/pybind/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -171,10 +171,6 @@ else()
set(PYBIND_DEPS ${PYBIND_DEPS} pir)
endif()

if(WITH_CUSTOM_DEVICE)
set(PYBIND_DEPS ${PYBIND_DEPS} custom_device_common_op_registry)
endif()

if(WITH_PYTHON)
set(PYBIND_DEPS ${PYBIND_DEPS} process_group eager_reducer)
if(WITH_NCCL OR WITH_RCCL)
Expand Down Expand Up @@ -299,11 +295,6 @@ if(WITH_PYTHON)
list(APPEND OP_FUNCTION_GENERATOR_DEPS ${PYTHON_LIBRARIES})
endif()

if(WITH_CUSTOM_DEVICE)
set(OP_FUNCTION_GENERATOR_DEPS ${OP_FUNCTION_GENERATOR_DEPS}
custom_device_common_op_registry)
endif()

set(GENERATOR_DEPS ${PYBIND_DEPS})
list(REMOVE_DUPLICATES GENERATOR_DEPS)
if(WIN32)
Expand Down Expand Up @@ -341,11 +332,6 @@ if(WITH_PYTHON)
list(REMOVE_ITEM EAGER_GENERATOR_DEPS imperative_flag)
endif()

if(WITH_CUSTOM_DEVICE)
set(EAGER_GENERATOR_DEPS ${EAGER_GENERATOR_DEPS}
custom_device_common_op_registry)
endif()

add_executable(
eager_generator generator.cc eager_legacy_op_function_generator.cc
eager_generator.cc)
Expand Down
7 changes: 0 additions & 7 deletions paddle/fluid/pybind/eager_generator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
#include "paddle/fluid/framework/operator.h"
#include "paddle/fluid/framework/program_desc.h"
#include "paddle/fluid/framework/variable.h"
#include "paddle/fluid/operators/custom_device_common_op_registry.h"
#include "paddle/fluid/pybind/eager_generator.h"
#include "paddle/fluid/pybind/pybind.h"
#include "paddle/utils/string/string_helper.h"
Expand Down Expand Up @@ -3786,12 +3785,6 @@ std::set<std::string> special_no_need_buffer_op_set = {
};

int run_generator(int argc, char* argv[]) {
#ifdef PADDLE_WITH_CUSTOM_DEVICE
// We need a fake device to trigger the registration of the common kernel and
// generate api
paddle::operators::RegisterCustomDeviceCommonKernel("fake_device");
#endif

std::string eager_root = argv[1];
int split_count = atoi(argv[2]);

Expand Down
7 changes: 0 additions & 7 deletions paddle/fluid/pybind/eager_legacy_op_function_generator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
#include "paddle/fluid/framework/op_registry.h"
#include "paddle/fluid/framework/operator.h"
#include "paddle/fluid/framework/variable.h"
#include "paddle/fluid/operators/custom_device_common_op_registry.h"
#include "paddle/fluid/pybind/eager_generator.h"
#include "paddle/fluid/pybind/eager_legacy_op_function_generator.h"
#include "paddle/fluid/pybind/pybind.h"
Expand Down Expand Up @@ -474,12 +473,6 @@ GenerateOpFunctions() {
}

int run_legacy_generator(int argc, char* argv[]) {
#ifdef PADDLE_WITH_CUSTOM_DEVICE
// We need a fake device to trigger the registration of the common kernel and
// generate api
paddle::operators::RegisterCustomDeviceCommonKernel("fake_device");
#endif

const std::string str = "\"paddle/fluid/eager/api/generated/fluid_generated/";
std::vector<std::string> headers{
"<Python.h>",
Expand Down
10 changes: 1 addition & 9 deletions paddle/fluid/pybind/pybind.cc
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,6 @@ limitations under the License. */
#endif

#ifdef PADDLE_WITH_CUSTOM_DEVICE
#include "paddle/fluid/operators/custom_device_common_op_registry.h"
#include "paddle/fluid/platform/profiler/custom_device/custom_tracer.h"
#include "paddle/phi/capi/capi.h"
#include "paddle/phi/core/platform/collective_helper.h"
Expand Down Expand Up @@ -2571,14 +2570,7 @@ All parameter, weight, gradient are variables in Paddle.
egr::Controller::Instance().MergeOpMetaInfoMap(
framework::LoadOpMetaInfoAndRegisterOp(dso_name));
});
m.def("init_devices", []() {
framework::InitDevices();
#ifdef PADDLE_WITH_CUSTOM_DEVICE
for (auto &dev_type : phi::DeviceManager::GetAllCustomDeviceTypes()) {
paddle::operators::RegisterCustomDeviceCommonKernel(dev_type);
}
#endif
});
m.def("init_devices", []() { framework::InitDevices(); });
m.def("init_default_kernel_signatures",
[]() { framework::InitDefaultKernelSignatureMap(); });
m.def("init_tensor_operants", []() {
Expand Down
Loading