Jiaming Yuan 0715ab3c10
Use dlopen to load NCCL. (#9796)
This PR adds optional support for loading nccl with `dlopen` as an alternative of compile time linking. This is to address the size bloat issue with the PyPI binary release.
- Add CMake option to load `nccl` at runtime.
- Add an NCCL stub.

After this, `nccl` will be fetched from PyPI when using pip to install XGBoost, either by a user or by `pyproject.toml`. Others who want to link the nccl at compile time can continue to do so without any change.

At the moment, this is Linux only since we only support MNMG on Linux.
2023-11-22 19:27:31 +08:00
..
2023-08-24 05:29:52 +08:00

XGBoost Plugins Modules

This folder contains plugin modules to xgboost that can be optionally installed. The plugin system helps us to extend xgboost with additional features, and add experimental features that may not yet be ready to be included in the main project.

To include a certain plugin, say plugin_a, you only need to add the following line to xgboost/plugin/CMakeLists.txt

set(PLUGIN_SOURCES ${PLUGIN_SOURCES}
    ${xgboost_SOURCE_DIR}/plugin/plugin_a.cc PARENT_SCOPE)

along with specified source file plugin_a.cc.

Then rebuild XGBoost with CMake.

Write Your Own Plugin

You can plugin your own modules to xgboost by adding code to this folder, without modification to the main code repo. The example folder provides an example to write a plugin.

List of register functions

A plugin has to register a new functionality to xgboost to be able to use it. The register macros available to plugin writers are:

  • XGBOOST_REGISTER_METRIC - Register an evaluation metric
  • XGBOOST_REGISTER_GBM - Register a new gradient booster that learns through gradient statistics
  • XGBOOST_REGISTER_OBJECTIVE - Register a new objective function used by xgboost
  • XGBOOST_REGISTER_TREE_UPDATER - Register a new tree-updater which updates the tree given the gradient information

And from dmlc-core:

  • DMLC_REGISTER_PARAMETER - Register a set of parameter for a specific usecase
  • DMLC_REGISTER_DATA_PARSER - Register a data parser where the data can be represented by a URL. This is used by DMatrix.