diff --git a/CMakeLists.txt b/CMakeLists.txt index c69b0d2a3..a07cff734 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -346,7 +346,6 @@ if(BUILD_DEPRECATED_CLI) PRIVATE ${xgboost_SOURCE_DIR}/include ${xgboost_SOURCE_DIR}/dmlc-core/include - ${xgboost_SOURCE_DIR}/rabit/include ) set_target_properties(runxgboost PROPERTIES OUTPUT_NAME xgboost) xgboost_target_properties(runxgboost) diff --git a/R-package/CMakeLists.txt b/R-package/CMakeLists.txt index 37c5dbf4c..75c3e2d77 100644 --- a/R-package/CMakeLists.txt +++ b/R-package/CMakeLists.txt @@ -29,7 +29,6 @@ target_compile_definitions( -DDMLC_LOG_BEFORE_THROW=0 -DDMLC_DISABLE_STDIN=1 -DDMLC_LOG_CUSTOMIZE=1 - -DRABIT_STRICT_CXX98_ ) target_include_directories( @@ -37,7 +36,6 @@ target_include_directories( ${LIBR_INCLUDE_DIRS} ${PROJECT_SOURCE_DIR}/include ${PROJECT_SOURCE_DIR}/dmlc-core/include - ${PROJECT_SOURCE_DIR}/rabit/include ) target_link_libraries(xgboost-r PUBLIC ${LIBR_CORE_LIBRARY}) diff --git a/R-package/src/Makevars.in b/R-package/src/Makevars.in index 93cfb8e5b..0cabffcad 100644 --- a/R-package/src/Makevars.in +++ b/R-package/src/Makevars.in @@ -21,7 +21,6 @@ $(foreach v, $(XGB_RFLAGS), $(warning $(v))) PKG_CPPFLAGS = \ -I$(PKGROOT)/include \ -I$(PKGROOT)/dmlc-core/include \ - -I$(PKGROOT)/rabit/include \ -I$(PKGROOT) \ $(XGB_RFLAGS) diff --git a/R-package/src/Makevars.win b/R-package/src/Makevars.win index f160930e8..c49006c5e 100644 --- a/R-package/src/Makevars.win +++ b/R-package/src/Makevars.win @@ -21,7 +21,6 @@ $(foreach v, $(XGB_RFLAGS), $(warning $(v))) PKG_CPPFLAGS = \ -I$(PKGROOT)/include \ -I$(PKGROOT)/dmlc-core/include \ - -I$(PKGROOT)/rabit/include \ -I$(PKGROOT) \ $(XGB_RFLAGS) diff --git a/cmake/Utils.cmake b/cmake/Utils.cmake index 317a71c00..9006bb0ea 100644 --- a/cmake/Utils.cmake +++ b/cmake/Utils.cmake @@ -151,7 +151,6 @@ function(xgboost_set_cuda_flags target) target_include_directories( ${target} PRIVATE ${xgboost_SOURCE_DIR}/gputreeshap - ${xgboost_SOURCE_DIR}/rabit/include ${CUDAToolkit_INCLUDE_DIRS}) if(MSVC) diff --git a/demo/c-api/basic/Makefile b/demo/c-api/basic/Makefile index 345079fa9..dceb9bc73 100644 --- a/demo/c-api/basic/Makefile +++ b/demo/c-api/basic/Makefile @@ -4,7 +4,7 @@ TGT=c-api-demo cc=cc CFLAGS ?=-O3 XGBOOST_ROOT ?=../.. -INCLUDE_DIR=-I$(XGBOOST_ROOT)/include -I$(XGBOOST_ROOT)/dmlc-core/include -I$(XGBOOST_ROOT)/rabit/include +INCLUDE_DIR=-I$(XGBOOST_ROOT)/include -I$(XGBOOST_ROOT)/dmlc-core/include LIB_DIR=-L$(XGBOOST_ROOT)/lib build: $(TGT) diff --git a/doc/build.rst b/doc/build.rst index 4a2d47c0f..fda64820a 100644 --- a/doc/build.rst +++ b/doc/build.rst @@ -138,7 +138,7 @@ From the command line on Linux starting from the XGBoost directory: .. note:: Faster distributed GPU training with NCCL - By default, distributed GPU training is enabled and uses Rabit for communication. For faster training, set the option ``USE_NCCL=ON``. Faster distributed GPU training depends on NCCL2, available at `this link `_. Since NCCL2 is only available for Linux machines, **faster distributed GPU training is available only for Linux**. + By default, distributed GPU training is enabled with the option ``USE_NCCL=ON``. Distributed GPU training depends on NCCL2, available at `this link `_. Since NCCL2 is only available for Linux machines, **Distributed GPU training is available only for Linux**. .. code-block:: bash diff --git a/doc/faq.rst b/doc/faq.rst index 4fe63076c..cdfb8bc2c 100644 --- a/doc/faq.rst +++ b/doc/faq.rst @@ -37,7 +37,7 @@ The ultimate question will still come back to how to push the limit of each comp and use less resources to complete the task (thus with less communication and chance of failure). To achieve these, we decide to reuse the optimizations in the single node XGBoost and build the distributed version on top of it. -The demand for communication in machine learning is rather simple, in the sense that we can depend on a limited set of APIs (in our case rabit). +The demand for communication in machine learning is rather simple, in the sense that we can depend on a limited set of APIs. Such design allows us to reuse most of the code, while being portable to major platforms such as Hadoop/Yarn, MPI, SGE. Most importantly, it pushes the limit of the computation resources we can use. diff --git a/rabit/include/rabit/internal/socket.h b/include/xgboost/collective/poll_utils.h similarity index 97% rename from rabit/include/rabit/internal/socket.h rename to include/xgboost/collective/poll_utils.h index 3701146d4..514e0a5c6 100644 --- a/rabit/include/rabit/internal/socket.h +++ b/include/xgboost/collective/poll_utils.h @@ -3,8 +3,7 @@ * \file socket.h * \author Tianqi Chen */ -#ifndef RABIT_INTERNAL_SOCKET_H_ -#define RABIT_INTERNAL_SOCKET_H_ +#pragma once #include "xgboost/collective/result.h" #include "xgboost/collective/socket.h" @@ -61,8 +60,8 @@ using sock_size_t = size_t; // NOLINT #pragma message("Distributed training on mingw is not supported.") typedef struct pollfd { SOCKET fd; - short events; - short revents; + short events; // NOLINT + short revents; // NOLINT } WSAPOLLFD, *PWSAPOLLFD, *LPWSAPOLLFD; // POLLRDNORM | POLLRDBAND @@ -97,7 +96,8 @@ std::enable_if_t, xgboost::collective::Result> PollError(E if ((revents & POLLERR) != 0) { auto err = errno; auto str = strerror(err); - return xgboost::system::FailWithCode(std::string{"Poll error condition:"} + std::string{str} + + return xgboost::system::FailWithCode(std::string{"Poll error condition:"} + // NOLINT + std::string{str} + // NOLINT " code:" + std::to_string(err)); } if ((revents & POLLNVAL) != 0) { @@ -229,5 +229,3 @@ struct PollHelper { #undef POLLPRI #undef POLLOUT #endif // IS_MINGW() - -#endif // RABIT_INTERNAL_SOCKET_H_ diff --git a/jvm-packages/CMakeLists.txt b/jvm-packages/CMakeLists.txt index 36ed61a6b..c6353d4b7 100644 --- a/jvm-packages/CMakeLists.txt +++ b/jvm-packages/CMakeLists.txt @@ -21,7 +21,6 @@ target_include_directories(xgboost4j ${JNI_INCLUDE_DIRS} ${PROJECT_SOURCE_DIR}/jvm-packages/xgboost4j/src/native ${PROJECT_SOURCE_DIR}/include - ${PROJECT_SOURCE_DIR}/dmlc-core/include - ${PROJECT_SOURCE_DIR}/rabit/include) + ${PROJECT_SOURCE_DIR}/dmlc-core/include) set_output_directory(xgboost4j ${PROJECT_SOURCE_DIR}/lib) diff --git a/python-package/packager/sdist.py b/python-package/packager/sdist.py index 4c70c24fe..013a28022 100644 --- a/python-package/packager/sdist.py +++ b/python-package/packager/sdist.py @@ -18,7 +18,6 @@ def copy_cpp_src_tree( "include", "dmlc-core", "gputreeshap", - "rabit", "cmake", "plugin", ]: diff --git a/src/collective/loop.cc b/src/collective/loop.cc index 8e84b6a82..cd7740fd2 100644 --- a/src/collective/loop.cc +++ b/src/collective/loop.cc @@ -14,10 +14,10 @@ #include // for thread #include // for move -#include "rabit/internal/socket.h" // for PollHelper -#include "xgboost/collective/result.h" // for Fail, Success -#include "xgboost/collective/socket.h" // for FailWithCode -#include "xgboost/logging.h" // for CHECK +#include "xgboost/collective/poll_utils.h" // for PollHelper +#include "xgboost/collective/result.h" // for Fail, Success +#include "xgboost/collective/socket.h" // for FailWithCode +#include "xgboost/logging.h" // for CHECK namespace xgboost::collective { Result Loop::ProcessQueue(std::queue* p_queue) const { diff --git a/src/collective/socket.cc b/src/collective/socket.cc index 99b02f665..38e727caf 100644 --- a/src/collective/socket.cc +++ b/src/collective/socket.cc @@ -11,8 +11,8 @@ #include // for error_code, system_category #include // for sleep_for -#include "rabit/internal/socket.h" // for PollHelper -#include "xgboost/collective/result.h" // for Result +#include "xgboost/collective/poll_utils.h" // for PollHelper +#include "xgboost/collective/result.h" // for Result #if defined(__unix__) || defined(__APPLE__) #include // getaddrinfo, freeaddrinfo diff --git a/src/collective/tracker.cc b/src/collective/tracker.cc index c8776f294..9441ab449 100644 --- a/src/collective/tracker.cc +++ b/src/collective/tracker.cc @@ -1,7 +1,7 @@ /** * Copyright 2023-2024, XGBoost Contributors */ -#include "rabit/internal/socket.h" + #if defined(__unix__) || defined(__APPLE__) #include // gethostbyname #include // socket, AF_INET6, AF_INET, connect, getsockname @@ -27,9 +27,10 @@ #include "comm.h" #include "protocol.h" // for kMagic, PeerInfo #include "tracker.h" -#include "xgboost/collective/result.h" // for Result, Fail, Success -#include "xgboost/collective/socket.h" // for GetHostName, FailWithCode, MakeSockAddress, ... -#include "xgboost/json.h" // for Json +#include "xgboost/collective/poll_utils.h" // for PollHelper +#include "xgboost/collective/result.h" // for Result, Fail, Success +#include "xgboost/collective/socket.h" // for GetHostName, FailWithCode, MakeSockAddress, ... +#include "xgboost/json.h" // for Json namespace xgboost::collective { diff --git a/tests/ci_build/deploy_jvm_packages.sh b/tests/ci_build/deploy_jvm_packages.sh index 9531d79a9..7c909483a 100755 --- a/tests/ci_build/deploy_jvm_packages.sh +++ b/tests/ci_build/deploy_jvm_packages.sh @@ -17,7 +17,7 @@ cd jvm-packages rm -rf $(find . -name target) rm -rf ../build/ -# Re-build package without Mock Rabit +# Re-build package # Maven profiles: # `default` includes modules: xgboost4j, xgboost4j-spark, xgboost4j-flink, xgboost4j-example # `gpu` includes modules: xgboost4j-gpu, xgboost4j-spark-gpu, sets `use.cuda = ON` diff --git a/tests/ci_build/test_r_package.py b/tests/ci_build/test_r_package.py index 1fe1644ad..add31b973 100644 --- a/tests/ci_build/test_r_package.py +++ b/tests/ci_build/test_r_package.py @@ -50,10 +50,6 @@ def pack_rpackage() -> Path: shutil.copytree("src", dest / "src" / "src") shutil.copytree("include", dest / "src" / "include") shutil.copytree("amalgamation", dest / "src" / "amalgamation") - # rabit - rabit = Path("rabit") - os.mkdir(dest / "src" / rabit) - shutil.copytree(rabit / "include", dest / "src" / "rabit" / "include") # dmlc-core dmlc_core = Path("dmlc-core") os.mkdir(dest / "src" / dmlc_core) diff --git a/tests/ci_build/tidy.py b/tests/ci_build/tidy.py index 16fb07e0d..7116eb78e 100755 --- a/tests/ci_build/tidy.py +++ b/tests/ci_build/tidy.py @@ -192,8 +192,7 @@ class ClangTidy(object): def should_lint(path): if not self.cpp_lint and path.endswith('.cc'): return False - isxgb = path.find('rabit') == -1 - isxgb = isxgb and path.find('dmlc-core') == -1 + isxgb = path.find('dmlc-core') == -1 isxgb = isxgb and (not path.startswith(self.cdb_path)) if isxgb: print(path) diff --git a/tests/cpp/CMakeLists.txt b/tests/cpp/CMakeLists.txt index 2748e1309..6496f8af4 100644 --- a/tests/cpp/CMakeLists.txt +++ b/tests/cpp/CMakeLists.txt @@ -25,8 +25,7 @@ if(PLUGIN_SYCL) PRIVATE ${gtest_SOURCE_DIR}/include ${xgboost_SOURCE_DIR}/include - ${xgboost_SOURCE_DIR}/dmlc-core/include - ${xgboost_SOURCE_DIR}/rabit/include) + ${xgboost_SOURCE_DIR}/dmlc-core/include) target_compile_definitions(plugin_sycl_test PUBLIC -DXGBOOST_USE_SYCL=1) target_link_libraries(plugin_sycl_test PUBLIC -fsycl) @@ -66,8 +65,7 @@ target_include_directories(testxgboost PRIVATE ${GTEST_INCLUDE_DIRS} ${xgboost_SOURCE_DIR}/include - ${xgboost_SOURCE_DIR}/dmlc-core/include - ${xgboost_SOURCE_DIR}/rabit/include) + ${xgboost_SOURCE_DIR}/dmlc-core/include) target_link_libraries(testxgboost PRIVATE GTest::gtest GTest::gmock)