Skip to content

Commit

Permalink
Initial support for IPv6.
Browse files Browse the repository at this point in the history
- Merge rabit socket into XGBoost.
- Dask interface support.
- Add test to socket.
- Add more compatibility code with mysys32, including correct linking and enable most of
  the system function calls.
- Workaround windows includes in tests. dmlc filesystem includes `windows.h`, which
  conflicts with winsock2.h.
  • Loading branch information
trivialfis committed Sep 8, 2022
1 parent e888eb2 commit f1e657c
Show file tree
Hide file tree
Showing 48 changed files with 1,048 additions and 692 deletions.
7 changes: 5 additions & 2 deletions .gitignore
Expand Up @@ -97,8 +97,11 @@ metastore_db
R-package/src/Makevars
*.lib

# Visual Studio Code
/.vscode/
# Visual Studio
.vs/
CMakeSettings.json
*.ilk
*.pdb

# IntelliJ/CLion
.idea
Expand Down
28 changes: 28 additions & 0 deletions .readthedocs.yaml
@@ -0,0 +1,28 @@
# .readthedocs.yaml
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details

# Required
version: 2

# Set the version of Python and other tools you might need
build:
os: ubuntu-22.04
tools:
python: "3.8"
apt_packages:
- graphviz

# Build documentation in the docs/ directory with Sphinx
sphinx:
configuration: doc/conf.py

# If using Sphinx, optionally build your docs in additional formats such as PDF
formats:
- pdf

# Optionally declare the Python requirements required to build your docs
python:
install:
- requirements: doc/requirements.txt
system_packages: true
2 changes: 1 addition & 1 deletion R-package/src/Makevars.win
Expand Up @@ -30,7 +30,7 @@ $(foreach v, $(XGB_RFLAGS), $(warning $(v)))

PKG_CPPFLAGS= -I$(PKGROOT)/include -I$(PKGROOT)/dmlc-core/include -I$(PKGROOT)/rabit/include -I$(PKGROOT) $(XGB_RFLAGS)
PKG_CXXFLAGS= $(SHLIB_OPENMP_CXXFLAGS) $(SHLIB_PTHREAD_FLAGS)
PKG_LIBS = $(SHLIB_OPENMP_CXXFLAGS) $(SHLIB_PTHREAD_FLAGS)
PKG_LIBS = $(SHLIB_OPENMP_CXXFLAGS) $(SHLIB_PTHREAD_FLAGS) -lwsock32 -lws2_32
OBJECTS= ./xgboost_R.o ./xgboost_custom.o ./xgboost_assert.o ./init.o \
$(PKGROOT)/amalgamation/xgboost-all0.o $(PKGROOT)/amalgamation/dmlc-minimum0.o \
$(PKGROOT)/rabit/src/engine.o $(PKGROOT)/rabit/src/rabit_c_api.o \
Expand Down
3 changes: 3 additions & 0 deletions amalgamation/xgboost-all0.cc
Expand Up @@ -87,6 +87,9 @@
#include "../src/common/threading_utils.cc"
#include "../src/common/version.cc"

// collective
#include "../src/collective/socket.cc"

// c_api
#include "../src/c_api/c_api.cc"
#include "../src/c_api/c_api_error.cc"
6 changes: 5 additions & 1 deletion cmake/Utils.cmake
Expand Up @@ -244,7 +244,7 @@ macro(xgboost_target_properties target)
$<$<NOT:$<COMPILE_LANGUAGE:CUDA>>:/utf-8>
-D_CRT_SECURE_NO_WARNINGS
-D_CRT_SECURE_NO_DEPRECATE
)
)
endif (MSVC)

if (WIN32 AND MINGW)
Expand Down Expand Up @@ -314,4 +314,8 @@ macro(xgboost_target_link_libraries target)
if (RABIT_BUILD_MPI)
target_link_libraries(${target} PRIVATE MPI::MPI_CXX)
endif (RABIT_BUILD_MPI)

if (MINGW)
target_link_libraries(${target} PRIVATE wsock32 ws2_32)
endif (MINGW)
endmacro(xgboost_target_link_libraries)
2 changes: 1 addition & 1 deletion doc/conf.py
Expand Up @@ -204,7 +204,7 @@
]

intersphinx_mapping = {
"python": ("https://docs.python.org/3.6", None),
"python": ("https://docs.python.org/3.8", None),
"numpy": ("https://docs.scipy.org/doc/numpy/", None),
"scipy": ("https://docs.scipy.org/doc/scipy/reference/", None),
"pandas": ("https://pandas.pydata.org/pandas-docs/stable/", None),
Expand Down
31 changes: 30 additions & 1 deletion doc/tutorials/dask.rst
Expand Up @@ -474,7 +474,6 @@ interface, including callback functions, custom evaluation metric and objective:
callbacks=[early_stop],
)
.. _tracker-ip:

***************
Expand Down Expand Up @@ -504,6 +503,36 @@ dask config is used:
reg = dxgb.DaskXGBRegressor()
************
IPv6 Support
************

.. versionadded:: 2.0.0

XGBoost has initial IPv6 support for the dask interface. Due to most of the cluster
support for IPv6 is partial (duo stack instead of IPv6 only), we require additional user
configuration similar to :ref:`tracker-ip` to help XGBoost obtain the correct address
information:

.. code-block:: python
import dask
from distributed import Client
from xgboost import dask as dxgb
# let xgboost know the scheduler address, use the same bracket format as dask.
with dask.config.set({"xgboost.scheduler_address": "[::1]"}):
with LocalCluster(host="[::1]", n_workers=2) as cluster:
with Client(cluster) as client:
reg = dxgb.DaskXGBRegressor(tree_method="hist")
When GPU is used, XGBoost employs `NCCL <https://developer.nvidia.com/nccl>`_ as the
underlying communication framework, which may require some additional configuration via
environment variable depending on the setting of the cluster. Please note that IPv6
support is Unix only.


*****************************************************************************
Why is the initialization of ``DaskDMatrix`` so slow and throws weird errors
*****************************************************************************
Expand Down

0 comments on commit f1e657c

Please sign in to comment.