Vladislav Epifanov 388f975cf5
Introducing DPC++-based plugin (predictor, objective function) supporting oneAPI programming model (#5825)
* Added plugin with DPC++-based predictor and objective function

* Update CMakeLists.txt

* Update regression_obj_oneapi.cc

* Added README.md for OneAPI plugin

* Added OneAPI predictor support to gbtree

* Update README.md

* Merged kernels in gradient computation. Enabled multiple loss functions with DPC++ backend

* Aligned plugin CMake files with latest master changes. Fixed whitespace typos

* Removed debug output

* [CI] Make oneapi_plugin a CMake target

* Added tests for OneAPI plugin for predictor and obj. functions

* Temporarily switched to default selector for device dispacthing in OneAPI plugin to enable execution in environments without gpus

* Updated readme file.

* Fixed USM usage in predictor

* Removed workaround with explicit templated names for DPC++ kernels

* Fixed warnings in plugin tests

* Fix CMake build of gtest

Co-authored-by: Hyunsu Cho <chohyu01@cs.washington.edu>
2020-08-08 18:40:40 -07:00
..
2020-04-05 04:42:29 +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.