Skip to content
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

SYCL. Remove sycl-specific implementation for multiclass-objective #11029

Merged
merged 17 commits into from
Dec 2, 2024
6 changes: 0 additions & 6 deletions include/xgboost/objective.h
Original file line number Diff line number Diff line change
Expand Up @@ -133,12 +133,6 @@ class ObjFunction : public Configurable {
* \param name Name of the objective.
*/
static ObjFunction* Create(const std::string& name, Context const* ctx);

/*!
* \brief Return sycl specific implementation name if possible.
* \param name Name of the objective.
*/
static std::string GetSyclImplementationName(const std::string& name);
};

/*!
Expand Down
3 changes: 2 additions & 1 deletion plugin/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ if(PLUGIN_SYCL)
list(APPEND SYCL_SOURCES
${xgboost_SOURCE_DIR}/src/objective/regression_obj.cc
${xgboost_SOURCE_DIR}/src/objective/hinge.cc
${xgboost_SOURCE_DIR}/src/objective/quantile_obj.cc)
${xgboost_SOURCE_DIR}/src/objective/quantile_obj.cc
${xgboost_SOURCE_DIR}/src/objective/multiclass_obj.cc)
add_library(plugin_sycl OBJECT ${SYCL_SOURCES})
target_include_directories(plugin_sycl
PRIVATE
Expand Down
203 changes: 0 additions & 203 deletions plugin/sycl/objective/multiclass_obj.cc

This file was deleted.

1 change: 1 addition & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ if(PLUGIN_SYCL)
list(REMOVE_ITEM CPU_SOURCES ${xgboost_SOURCE_DIR}/src/objective/regression_obj.cc)
list(REMOVE_ITEM CPU_SOURCES ${xgboost_SOURCE_DIR}/src/objective/hinge.cc)
list(REMOVE_ITEM CPU_SOURCES ${xgboost_SOURCE_DIR}/src/objective/quantile_obj.cc)
list(REMOVE_ITEM CPU_SOURCES ${xgboost_SOURCE_DIR}/src/objective/multiclass_obj.cc)
endif()

#-- Object library
Expand Down
19 changes: 0 additions & 19 deletions src/objective/objective.cc
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@ namespace xgboost {
// implement factory functions
ObjFunction* ObjFunction::Create(const std::string& name, Context const* ctx) {
std::string obj_name = name;
if (ctx->IsSycl()) {
obj_name = GetSyclImplementationName(obj_name);
}
auto *e = ::dmlc::Registry< ::xgboost::ObjFunctionReg>::Get()->Find(obj_name);
if (e == nullptr) {
std::stringstream ss;
Expand All @@ -36,22 +33,6 @@ ObjFunction* ObjFunction::Create(const std::string& name, Context const* ctx) {
return pobj;
}

/* If the objective function has sycl-specific implementation,
* returns the specific implementation name.
* Otherwise return the orginal name without modifications.
*/
std::string ObjFunction::GetSyclImplementationName(const std::string& name) {
const std::string sycl_postfix = "_sycl";
auto *e = ::dmlc::Registry< ::xgboost::ObjFunctionReg>::Get()->Find(name + sycl_postfix);
if (e != nullptr) {
// Function has specific sycl implementation
return name + sycl_postfix;
} else {
// Function hasn't specific sycl implementation
return name;
}
}

void ObjFunction::InitEstimation(MetaInfo const&, linalg::Tensor<float, 1>* base_score) const {
CHECK(base_score);
base_score->Reshape(1);
Expand Down
Loading