fix objective/objective.cc, CMakeFile and setup.py

This commit is contained in:
amdsc21 2023-03-23 20:22:34 +01:00
parent 595cd81251
commit e0716afabf
5 changed files with 16 additions and 3 deletions

View File

@ -187,6 +187,7 @@ if (USE_HIP)
set(CMAKE_HIP_FLAGS "${CMAKE_HIP_FLAGS} -Wunused-result -w") set(CMAKE_HIP_FLAGS "${CMAKE_HIP_FLAGS} -Wunused-result -w")
set(CMAKE_HIP_FLAGS "${CMAKE_HIP_FLAGS} -D__HIP_PLATFORM_AMD__") set(CMAKE_HIP_FLAGS "${CMAKE_HIP_FLAGS} -D__HIP_PLATFORM_AMD__")
add_subdirectory(${PROJECT_SOURCE_DIR}/rocgputreeshap) add_subdirectory(${PROJECT_SOURCE_DIR}/rocgputreeshap)
add_subdirectory(${PROJECT_SOURCE_DIR}/warp-primitives)
endif (USE_HIP) endif (USE_HIP)
if (FORCE_COLORED_OUTPUT AND (CMAKE_GENERATOR STREQUAL "Ninja") AND if (FORCE_COLORED_OUTPUT AND (CMAKE_GENERATOR STREQUAL "Ninja") AND
@ -228,6 +229,10 @@ if (USE_NCCL)
find_package(Nccl REQUIRED) find_package(Nccl REQUIRED)
endif (USE_NCCL) endif (USE_NCCL)
if (USE_RCCL)
find_package(rccl REQUIRED)
endif (USE_RCCL)
# dmlc-core # dmlc-core
msvc_use_static_runtime() msvc_use_static_runtime()
if (FORCE_SHARED_CRT) if (FORCE_SHARED_CRT)

View File

@ -23,6 +23,8 @@ USER_OPTIONS = {
"use-cuda": (None, "Build with GPU acceleration.", 0), "use-cuda": (None, "Build with GPU acceleration.", 0),
"use-nccl": (None, "Build with NCCL to enable distributed GPU support.", 0), "use-nccl": (None, "Build with NCCL to enable distributed GPU support.", 0),
"build-with-shared-nccl": (None, "Build with shared NCCL library.", 0), "build-with-shared-nccl": (None, "Build with shared NCCL library.", 0),
"use-hip": (None, "Build with GPU acceleration.", 0),
"use-rccl": (None, "Build with RCCL to enable distributed GPU support.", 0),
"hide-cxx-symbols": (None, "Hide all C++ symbols during build.", 1), "hide-cxx-symbols": (None, "Hide all C++ symbols during build.", 1),
"use-hdfs": (None, "Build with HDFS support", 0), "use-hdfs": (None, "Build with HDFS support", 0),
"use-azure": (None, "Build with AZURE support.", 0), "use-azure": (None, "Build with AZURE support.", 0),
@ -65,6 +67,8 @@ def copy_tree(src_dir: str, target_dir: str) -> None:
inc = os.path.join(src_dir, "include") inc = os.path.join(src_dir, "include")
dmlc_core = os.path.join(src_dir, "dmlc-core") dmlc_core = os.path.join(src_dir, "dmlc-core")
gputreeshap = os.path.join(src_dir, "gputreeshap") gputreeshap = os.path.join(src_dir, "gputreeshap")
rocgputreeshap = os.path.join(src_dir, "rocgputreeshap")
warpprim= os.path.join(src_dir, "warp-primitives")
rabit = os.path.join(src_dir, "rabit") rabit = os.path.join(src_dir, "rabit")
cmake = os.path.join(src_dir, "cmake") cmake = os.path.join(src_dir, "cmake")
plugin = os.path.join(src_dir, "plugin") plugin = os.path.join(src_dir, "plugin")
@ -73,6 +77,8 @@ def copy_tree(src_dir: str, target_dir: str) -> None:
clean_copy_tree(inc, os.path.join(target_dir, "include")) clean_copy_tree(inc, os.path.join(target_dir, "include"))
clean_copy_tree(dmlc_core, os.path.join(target_dir, "dmlc-core")) clean_copy_tree(dmlc_core, os.path.join(target_dir, "dmlc-core"))
clean_copy_tree(gputreeshap, os.path.join(target_dir, "gputreeshap")) clean_copy_tree(gputreeshap, os.path.join(target_dir, "gputreeshap"))
clean_copy_tree(rocgputreeshap, os.path.join(target_dir, "rocgputreeshap"))
clean_copy_tree(warpprim, os.path.join(target_dir, "warp-primitives"))
clean_copy_tree(rabit, os.path.join(target_dir, "rabit")) clean_copy_tree(rabit, os.path.join(target_dir, "rabit"))
clean_copy_tree(cmake, os.path.join(target_dir, "cmake")) clean_copy_tree(cmake, os.path.join(target_dir, "cmake"))
clean_copy_tree(plugin, os.path.join(target_dir, "plugin")) clean_copy_tree(plugin, os.path.join(target_dir, "plugin"))
@ -306,6 +312,8 @@ class Install(install.install): # pylint: disable=too-many-instance-attributes
self.use_cuda = 0 self.use_cuda = 0
self.use_nccl = 0 self.use_nccl = 0
self.build_with_shared_nccl = 0 self.build_with_shared_nccl = 0
self.use_hip= 0
self.use_rccl = 0
self.hide_cxx_symbols = 1 self.hide_cxx_symbols = 1
self.use_hdfs = 0 self.use_hdfs = 0

@ -1 +1 @@
Subproject commit 0ce793d3476d3d1a36256a6beb40626748cac608 Subproject commit 3704f6142138766bb6e3585f496c8b7de61d2d32

View File

@ -42,7 +42,7 @@ void ObjFunction::InitEstimation(MetaInfo const&, linalg::Tensor<float, 1>* base
namespace xgboost { namespace xgboost {
namespace obj { namespace obj {
// List of files that will be force linked in static links. // List of files that will be force linked in static links.
#if !defined(XGBOOST_USE_CUDA) && !defined(XGBOOST_USE_HIP) #if defined(XGBOOST_USE_CUDA) || defined(XGBOOST_USE_HIP)
DMLC_REGISTRY_LINK_TAG(regression_obj_gpu); DMLC_REGISTRY_LINK_TAG(regression_obj_gpu);
DMLC_REGISTRY_LINK_TAG(quantile_obj_gpu); DMLC_REGISTRY_LINK_TAG(quantile_obj_gpu);
DMLC_REGISTRY_LINK_TAG(hinge_obj_gpu); DMLC_REGISTRY_LINK_TAG(hinge_obj_gpu);

@ -1 +1 @@
Subproject commit d8d1bb6fff784e3c30f42d22d1fe09ca18c4c2e7 Subproject commit af1eccf8313f0579ff190d4b76627b4559f19d1a