Skip to content

Commit

Permalink
Remove gpu_exact tree method (#4742)
Browse files Browse the repository at this point in the history
  • Loading branch information
rongou authored and RAMitchell committed Aug 6, 2019
1 parent 2a4df8e commit 851b5b3
Show file tree
Hide file tree
Showing 16 changed files with 36 additions and 971 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ lib/
# spark
metastore_db

plugin/updater_gpu/test/cpp/data
/include/xgboost/build_config.h

# files from R-package source install
Expand Down
2 changes: 1 addition & 1 deletion R-package/demo/gpu_accelerated.R
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ wl <- list(train = dtrain, test = dtest)
# - similar to the 'hist'
# - the fastest option for moderately large datasets
# - current limitations: max_depth < 16, does not implement guided loss
# You can use tree_method = 'gpu_exact' for another GPU accelerated algorithm,
# You can use tree_method = 'gpu_hist' for another GPU accelerated algorithm,
# which is slower, more memory-hungry, but does not use binning.
param <- list(objective = 'reg:logistic', eval_metric = 'auc', subsample = 0.5, nthread = 4,
max_bin = 64, tree_method = 'gpu_hist')
Expand Down
2 changes: 1 addition & 1 deletion doc/build.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Installation Guide
# * xgboost-{version}-py2.py3-none-win_amd64.whl
pip3 install xgboost
* The binary wheel will support GPU algorithms (`gpu_exact`, `gpu_hist`) on machines with NVIDIA GPUs. Please note that **training with multiple GPUs is only supported for Linux platform**. See :doc:`gpu/index`.
* The binary wheel will support GPU algorithms (`gpu_hist`) on machines with NVIDIA GPUs. Please note that **training with multiple GPUs is only supported for Linux platform**. See :doc:`gpu/index`.
* Currently, we provide binary wheels for 64-bit Linux and Windows.

****************************
Expand Down
56 changes: 26 additions & 30 deletions doc/gpu/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ Algorithms
+-----------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| tree_method | Description |
+=======================+=======================================================================================================================================================================+
| gpu_exact (deprecated)| The standard XGBoost tree construction algorithm. Performs exact search for splits. Slower and uses considerably more memory than ``gpu_hist``. |
+-----------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| gpu_hist | Equivalent to the XGBoost fast histogram algorithm. Much faster and uses considerably less memory. NOTE: Will run very slowly on GPUs older than Pascal architecture. |
+-----------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------+

Expand All @@ -37,31 +35,31 @@ Supported parameters
.. |tick| unicode:: U+2714
.. |cross| unicode:: U+2718

+--------------------------------+----------------------------+--------------+
| parameter | ``gpu_exact`` (deprecated) | ``gpu_hist`` |
+================================+============================+==============+
| ``subsample`` | |cross| | |tick| |
+--------------------------------+----------------------------+--------------+
| ``colsample_bytree`` | |cross| | |tick| |
+--------------------------------+----------------------------+--------------+
| ``colsample_bylevel`` | |cross| | |tick| |
+--------------------------------+----------------------------+--------------+
| ``max_bin`` | |cross| | |tick| |
+--------------------------------+----------------------------+--------------+
| ``gpu_id`` | |tick| | |tick| |
+--------------------------------+----------------------------+--------------+
| ``n_gpus`` (deprecated) | |cross| | |tick| |
+--------------------------------+----------------------------+--------------+
| ``predictor`` | |tick| | |tick| |
+--------------------------------+----------------------------+--------------+
| ``grow_policy`` | |cross| | |tick| |
+--------------------------------+----------------------------+--------------+
| ``monotone_constraints`` | |cross| | |tick| |
+--------------------------------+----------------------------+--------------+
| ``interaction_constraints`` | |cross| | |tick| |
+--------------------------------+----------------------------+--------------+
| ``single_precision_histogram`` | |cross| | |tick| |
+--------------------------------+----------------------------+--------------+
+--------------------------------+--------------+
| parameter | ``gpu_hist`` |
+================================+==============+
| ``subsample`` | |tick| |
+--------------------------------+--------------+
| ``colsample_bytree`` | |tick| |
+--------------------------------+--------------+
| ``colsample_bylevel`` | |tick| |
+--------------------------------+--------------+
| ``max_bin`` | |tick| |
+--------------------------------+--------------+
| ``gpu_id`` | |tick| |
+--------------------------------+--------------+
| ``n_gpus`` (deprecated) | |tick| |
+--------------------------------+--------------+
| ``predictor`` | |tick| |
+--------------------------------+--------------+
| ``grow_policy`` | |tick| |
+--------------------------------+--------------+
| ``monotone_constraints`` | |tick| |
+--------------------------------+--------------+
| ``interaction_constraints`` | |tick| |
+--------------------------------+--------------+
| ``single_precision_histogram`` | |tick| |
+--------------------------------+--------------+

GPU accelerated prediction is enabled by default for the above mentioned ``tree_method`` parameters but can be switched to CPU prediction by setting ``predictor`` to ``cpu_predictor``. This could be useful if you want to conserve GPU memory. Likewise when using CPU algorithms, GPU accelerated prediction can be enabled by setting ``predictor`` to ``gpu_predictor``.

Expand Down Expand Up @@ -194,12 +192,10 @@ Training time time on 1,000,000 rows x 50 columns with 500 boosting iterations a
+--------------+----------+
| hist | 63.55 |
+--------------+----------+
| gpu_exact | 161.08 |
+--------------+----------+
| exact | 1082.20 |
+--------------+----------+

See `GPU Accelerated XGBoost <https://xgboost.ai/2016/12/14/GPU-accelerated-xgboost.html>`_ and `Updates to the XGBoost GPU algorithms <https://xgboost.ai/2018/07/04/gpu-xgboost-update.html>`_ for additional performance benchmarks of the ``gpu_exact`` and ``gpu_hist`` tree methods.
See `GPU Accelerated XGBoost <https://xgboost.ai/2016/12/14/GPU-accelerated-xgboost.html>`_ and `Updates to the XGBoost GPU algorithms <https://xgboost.ai/2018/07/04/gpu-xgboost-update.html>`_ for additional performance benchmarks of the ``gpu_hist`` tree method.

Developer notes
===============
Expand Down
2 changes: 1 addition & 1 deletion doc/parameter.rst
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ Parameters for Tree Booster
- The type of predictor algorithm to use. Provides the same results but allows the use of GPU or CPU.

- ``cpu_predictor``: Multicore CPU prediction algorithm.
- ``gpu_predictor``: Prediction using GPU. Default when ``tree_method`` is ``gpu_exact`` or ``gpu_hist``.
- ``gpu_predictor``: Prediction using GPU. Default when ``tree_method`` is ``gpu_hist``.

* ``num_parallel_tree``, [default=1]
- Number of parallel trees constructed during each iteration. This option is used to support boosted random forest.
Expand Down
2 changes: 1 addition & 1 deletion doc/tutorials/external_memory.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ path to a cache file that XGBoost will use for external memory cache.

.. note:: External memory is not available with GPU algorithms

External memory is not available when ``tree_method`` is set to ``gpu_exact`` or ``gpu_hist``.
External memory is not available when ``tree_method`` is set to ``gpu_hist``.

The following code was extracted from `demo/guide-python/external_memory.py <https://github.com/dmlc/xgboost/blob/master/demo/guide-python/external_memory.py>`_:

Expand Down
6 changes: 0 additions & 6 deletions make/config.mk
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,3 @@ CUB_PATH ?= cub
# you can also add your own plugin like this
#
# XGB_PLUGINS += plugin/example/plugin.mk

# plugin to build tree on GPUs using CUDA
PLUGIN_UPDATER_GPU ?= OFF
ifeq ($(PLUGIN_UPDATER_GPU),ON)
XGB_PLUGINS += plugin/updater_gpu/plugin.mk
endif
7 changes: 0 additions & 7 deletions src/gbm/gbtree.cc
Original file line number Diff line number Diff line change
Expand Up @@ -146,13 +146,6 @@ void GBTree::ConfigureUpdaters(const std::map<std::string, std::string>& cfg) {
"single updater grow_quantile_histmaker.";
tparam_.updater_seq = "grow_quantile_histmaker";
break;
case TreeMethod::kGPUExact:
this->AssertGPUSupport();
tparam_.updater_seq = "grow_gpu,prune";
if (cfg.find("predictor") == cfg.cend()) {
tparam_.predictor = "gpu_predictor";
}
break;
case TreeMethod::kGPUHist:
this->AssertGPUSupport();
tparam_.updater_seq = "grow_gpu_hist";
Expand Down
6 changes: 2 additions & 4 deletions src/gbm/gbtree.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
namespace xgboost {
enum class TreeMethod : int {
kAuto = 0, kApprox = 1, kExact = 2, kHist = 3,
kGPUExact = 4, kGPUHist = 5
kGPUHist = 5
};

// boosting process types
Expand Down Expand Up @@ -88,7 +88,6 @@ struct GBTreeTrainParam : public dmlc::Parameter<GBTreeTrainParam> {
.add_enum("approx", TreeMethod::kApprox)
.add_enum("exact", TreeMethod::kExact)
.add_enum("hist", TreeMethod::kHist)
.add_enum("gpu_exact", TreeMethod::kGPUExact)
.add_enum("gpu_hist", TreeMethod::kGPUHist)
.describe("Choice of tree construction method.");
}
Expand Down Expand Up @@ -171,8 +170,7 @@ class GBTree : public GradientBooster {
bool UseGPU() const override {
return
tparam_.predictor == "gpu_predictor" ||
tparam_.tree_method == TreeMethod::kGPUHist ||
tparam_.tree_method == TreeMethod::kGPUExact;
tparam_.tree_method == TreeMethod::kGPUHist;
}

void Load(dmlc::Stream* fi) override {
Expand Down
1 change: 0 additions & 1 deletion src/tree/tree_updater.cc
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ DMLC_REGISTRY_LINK_TAG(updater_quantile_hist);
DMLC_REGISTRY_LINK_TAG(updater_histmaker);
DMLC_REGISTRY_LINK_TAG(updater_sync);
#ifdef XGBOOST_USE_CUDA
DMLC_REGISTRY_LINK_TAG(updater_gpu);
DMLC_REGISTRY_LINK_TAG(updater_gpu_hist);
#endif // XGBOOST_USE_CUDA
} // namespace tree
Expand Down
Loading

0 comments on commit 851b5b3

Please sign in to comment.