Remove the deprecated gpu_hist.#11549
Merged
Merged
Conversation
trivialfis
commented
Jul 8, 2025
gpu_hist.gpu_hist.
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR removes the deprecated gpu_hist tree method across the codebase, replacing its usage with hist or approx, and cleans up related GPU configuration hooks.
- Replace all references to
gpu_histin tests, docs, and code with supported methods (historapprox). - Remove
UseGPUoverrides andConfigureGpuIdlogic now thatgpu_histis gone. - Update Spark, Python, Scala, and C++ layers to drop unsupported
gpu_histhandling.
Reviewed Changes
Copilot reviewed 17 out of 17 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| tests/test_distributed/test_with_spark/test_spark_local.py | Replaced gpu_hist with hist/approx in Spark tests |
| tests/python-gpu/test_gpu_pickling.py | Refactored pickling test into a helper, added type hint |
| tests/cpp/gbm/test_gbtree.cc | Updated mapping table and expectations for approx |
| src/learner.cc | Removed deprecated ConfigureGpuId calls |
| src/gbm/gbtree.h | Dropped kGPUHist enum and registration |
| src/gbm/gbtree.cc | Removed TreeMethod::kGPUHist updater and fallback |
| src/gbm/gblinear.cc | Removed GPU support checks and UseGPU override |
| src/context.cc | Deleted deprecated ConfigureGpuId method |
| python-package/xgboost/spark/core.py | Simplified _run_on_gpu logic, dropped gpu_hist case |
| python-package/xgboost/sklearn.py | Removed gpu_hist from _can_use_qdm |
| jvm-packages/.../XGBoostEstimatorSuite.scala | Deleted tests for gpu_hist in Scala suite |
| jvm-packages/.../TreeBoosterParams.scala | Removed gpu_hist from supported methods |
| jvm-packages/.../XGBoostEstimator.scala | Simplified runOnGpu logic |
| jvm-packages/.../GpuXGBoostPluginSuite.scala | Removed gpu_hist validation tests |
| jvm-packages/.../GpuXGBoostPlugin.scala | Adjusted require check to only depend on device |
| include/xgboost/gbm.h | Removed virtual UseGPU declaration |
| include/xgboost/context.h | Deleted deprecated GPU configuration doc and method |
Comments suppressed due to low confidence (2)
python-package/xgboost/spark/core.py:504
- [nitpick] Update this docstring to clarify that GPU execution now depends solely on
deviceor theuse_gpuflag, sincetree_methodno longer triggers a GPU path.
"""If train or transform on the gpu according to the parameters"""
tests/test_distributed/test_with_spark/test_spark_local.py:930
- Add an assertion after validation to verify that
clf._run_on_gpu()returns True whendevice='cuda'andtree_method='approx', ensuring the new approximate GPU path is tested.
clf._validate_params()
hcho3
approved these changes
Jul 10, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.