A GPU is a massively parallel processor that can shorten model-training waits when datasets contain many cases or features. For gradient-boosted decision trees, it is especially effective with XGBoost and can also accelerate LightGBM. section 6.4.3
Use GPU acceleration when reducing the training data would compromise model quality:
- Configure XGBoost with device="cuda" or device="gpu"; select a particular device with a CUDA ordinal such as device="cuda:1". section 6.4.3
- Treat gpu_hist as a deprecated XGBoost 2.0.0 setting and use device instead. section 6.4.3
- Check CUDA 11.00 or later and a GPU with compute capability 5.0 before using XGBoost acceleration. section 6.4.3
model.set_param({"predictor": "gpu_predictor"})
shap_values = model.predict(X, pred_contribs=True)
shap_interaction_values = model.predict(X, pred_interactions=True)
Inspect the XGBoost prediction configuration and GPU-based SHAP prediction calls. section 6.4.3













